/
classes.rb
7841 lines (6560 loc) · 346 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module DialogflowV2beta1
# Represents page information communicated to and from the webhook.
class GoogleCloudDialogflowCxV3PageInfo
include Google::Apis::Core::Hashable
# Always present for WebhookRequest. Ignored for WebhookResponse. The unique
# identifier of the current page. Format: `projects//locations//agents//flows//
# pages/`.
# Corresponds to the JSON property `currentPage`
# @return [String]
attr_accessor :current_page
# Represents form information.
# Corresponds to the JSON property `formInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3PageInfoFormInfo]
attr_accessor :form_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@current_page = args[:current_page] if args.key?(:current_page)
@form_info = args[:form_info] if args.key?(:form_info)
end
end
# Represents form information.
class GoogleCloudDialogflowCxV3PageInfoFormInfo
include Google::Apis::Core::Hashable
# Optional for both WebhookRequest and WebhookResponse. The parameters contained
# in the form. Note that the webhook cannot add or remove any form parameter.
# Corresponds to the JSON property `parameterInfo`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo>]
attr_accessor :parameter_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@parameter_info = args[:parameter_info] if args.key?(:parameter_info)
end
end
# Represents parameter information.
class GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo
include Google::Apis::Core::Hashable
# Always present for WebhookRequest. Required for WebhookResponse. The human-
# readable name of the parameter, unique within the form. This field cannot be
# modified by the webhook.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the
# parameter value was just collected on the last conversation turn.
# Corresponds to the JSON property `justCollected`
# @return [Boolean]
attr_accessor :just_collected
alias_method :just_collected?, :just_collected
# Optional for both WebhookRequest and WebhookResponse. Indicates whether the
# parameter is required. Optional parameters will not trigger prompts; however,
# they are filled if the user specifies them. Required parameters must be filled
# before form filling concludes.
# Corresponds to the JSON property `required`
# @return [Boolean]
attr_accessor :required
alias_method :required?, :required
# Always present for WebhookRequest. Required for WebhookResponse. The state of
# the parameter. This field can be set to INVALID by the webhook to invalidate
# the parameter; other values set by the webhook will be ignored.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# Optional for both WebhookRequest and WebhookResponse. The value of the
# parameter. This field can be set by the webhook to change the parameter value.
# Corresponds to the JSON property `value`
# @return [Object]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@just_collected = args[:just_collected] if args.key?(:just_collected)
@required = args[:required] if args.key?(:required)
@state = args[:state] if args.key?(:state)
@value = args[:value] if args.key?(:value)
end
end
# Represents a response message that can be returned by a conversational agent.
# Response messages are also used for output audio synthesis. The approach is as
# follows: * If at least one OutputAudioText response is present, then all
# OutputAudioText responses are linearly concatenated, and the result is used
# for output audio synthesis. * If the OutputAudioText responses are a mixture
# of text and SSML, then the concatenated result is treated as SSML; otherwise,
# the result is treated as either text or SSML as appropriate. The agent
# designer should ideally use either text or SSML consistently throughout the
# bot design. * Otherwise, all Text responses are linearly concatenated, and the
# result is used for output audio synthesis. This approach allows for more
# sophisticated user experience scenarios, where the text displayed to the user
# may differ from what is heard.
class GoogleCloudDialogflowCxV3ResponseMessage
include Google::Apis::Core::Hashable
# Indicates that the conversation succeeded, i.e., the bot handled the issue
# that the customer talked to it about. Dialogflow only uses this to determine
# which conversations should be counted as successful and doesn't process the
# metadata in this message in any way. Note that Dialogflow also considers
# conversations that get to the conversation end page as successful even if they
# don't return ConversationSuccess. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates that the
# conversation succeeded. * In a webhook response when you determine that you
# handled the customer issue.
# Corresponds to the JSON property `conversationSuccess`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess]
attr_accessor :conversation_success
# Indicates that interaction with the Dialogflow agent has ended. This message
# is generated by Dialogflow only and not supposed to be defined by the user.
# Corresponds to the JSON property `endInteraction`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageEndInteraction]
attr_accessor :end_interaction
# Indicates that the conversation should be handed off to a live agent.
# Dialogflow only uses this to determine which conversations were handed off to
# a human agent for measurement purposes. What else to do with this signal is up
# to you and your handoff procedures. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates something went
# extremely wrong in the conversation. * In a webhook response when you
# determine that the customer issue can only be handled by a human.
# Corresponds to the JSON property `liveAgentHandoff`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff]
attr_accessor :live_agent_handoff
# Represents an audio message that is composed of both segments synthesized from
# the Dialogflow agent prompts and ones hosted externally at the specified URIs.
# The external URIs are specified via play_audio. This message is generated by
# Dialogflow only and not supposed to be defined by the user.
# Corresponds to the JSON property `mixedAudio`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageMixedAudio]
attr_accessor :mixed_audio
# A text or ssml response that is preferentially used for TTS output audio
# synthesis, as described in the comment on the ResponseMessage message.
# Corresponds to the JSON property `outputAudioText`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText]
attr_accessor :output_audio_text
# Returns a response containing a custom, platform-specific payload.
# Corresponds to the JSON property `payload`
# @return [Hash<String,Object>]
attr_accessor :payload
# Specifies an audio clip to be played by the client as part of the response.
# Corresponds to the JSON property `playAudio`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessagePlayAudio]
attr_accessor :play_audio
# The text response message.
# Corresponds to the JSON property `text`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageText]
attr_accessor :text
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@conversation_success = args[:conversation_success] if args.key?(:conversation_success)
@end_interaction = args[:end_interaction] if args.key?(:end_interaction)
@live_agent_handoff = args[:live_agent_handoff] if args.key?(:live_agent_handoff)
@mixed_audio = args[:mixed_audio] if args.key?(:mixed_audio)
@output_audio_text = args[:output_audio_text] if args.key?(:output_audio_text)
@payload = args[:payload] if args.key?(:payload)
@play_audio = args[:play_audio] if args.key?(:play_audio)
@text = args[:text] if args.key?(:text)
end
end
# Indicates that the conversation succeeded, i.e., the bot handled the issue
# that the customer talked to it about. Dialogflow only uses this to determine
# which conversations should be counted as successful and doesn't process the
# metadata in this message in any way. Note that Dialogflow also considers
# conversations that get to the conversation end page as successful even if they
# don't return ConversationSuccess. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates that the
# conversation succeeded. * In a webhook response when you determine that you
# handled the customer issue.
class GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess
include Google::Apis::Core::Hashable
# Custom metadata. Dialogflow doesn't impose any structure on this.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@metadata = args[:metadata] if args.key?(:metadata)
end
end
# Indicates that interaction with the Dialogflow agent has ended. This message
# is generated by Dialogflow only and not supposed to be defined by the user.
class GoogleCloudDialogflowCxV3ResponseMessageEndInteraction
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Indicates that the conversation should be handed off to a live agent.
# Dialogflow only uses this to determine which conversations were handed off to
# a human agent for measurement purposes. What else to do with this signal is up
# to you and your handoff procedures. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates something went
# extremely wrong in the conversation. * In a webhook response when you
# determine that the customer issue can only be handled by a human.
class GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff
include Google::Apis::Core::Hashable
# Custom metadata for your handoff procedure. Dialogflow doesn't impose any
# structure on this.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@metadata = args[:metadata] if args.key?(:metadata)
end
end
# Represents an audio message that is composed of both segments synthesized from
# the Dialogflow agent prompts and ones hosted externally at the specified URIs.
# The external URIs are specified via play_audio. This message is generated by
# Dialogflow only and not supposed to be defined by the user.
class GoogleCloudDialogflowCxV3ResponseMessageMixedAudio
include Google::Apis::Core::Hashable
# Segments this audio response is composed of.
# Corresponds to the JSON property `segments`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment>]
attr_accessor :segments
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@segments = args[:segments] if args.key?(:segments)
end
end
# Represents one segment of audio.
class GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment
include Google::Apis::Core::Hashable
# Output only. Whether the playback of this segment can be interrupted by the
# end user's speech and the client should then start the next Dialogflow request.
# Corresponds to the JSON property `allowPlaybackInterruption`
# @return [Boolean]
attr_accessor :allow_playback_interruption
alias_method :allow_playback_interruption?, :allow_playback_interruption
# Raw audio synthesized from the Dialogflow agent's response using the output
# config specified in the request.
# Corresponds to the JSON property `audio`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :audio
# Client-specific URI that points to an audio clip accessible to the client.
# Dialogflow does not impose any validation on it.
# Corresponds to the JSON property `uri`
# @return [String]
attr_accessor :uri
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allow_playback_interruption = args[:allow_playback_interruption] if args.key?(:allow_playback_interruption)
@audio = args[:audio] if args.key?(:audio)
@uri = args[:uri] if args.key?(:uri)
end
end
# A text or ssml response that is preferentially used for TTS output audio
# synthesis, as described in the comment on the ResponseMessage message.
class GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText
include Google::Apis::Core::Hashable
# Output only. Whether the playback of this message can be interrupted by the
# end user's speech and the client can then starts the next Dialogflow request.
# Corresponds to the JSON property `allowPlaybackInterruption`
# @return [Boolean]
attr_accessor :allow_playback_interruption
alias_method :allow_playback_interruption?, :allow_playback_interruption
# The SSML text to be synthesized. For more information, see [SSML](/speech/text-
# to-speech/docs/ssml).
# Corresponds to the JSON property `ssml`
# @return [String]
attr_accessor :ssml
# The raw text to be synthesized.
# Corresponds to the JSON property `text`
# @return [String]
attr_accessor :text
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allow_playback_interruption = args[:allow_playback_interruption] if args.key?(:allow_playback_interruption)
@ssml = args[:ssml] if args.key?(:ssml)
@text = args[:text] if args.key?(:text)
end
end
# Specifies an audio clip to be played by the client as part of the response.
class GoogleCloudDialogflowCxV3ResponseMessagePlayAudio
include Google::Apis::Core::Hashable
# Output only. Whether the playback of this message can be interrupted by the
# end user's speech and the client can then starts the next Dialogflow request.
# Corresponds to the JSON property `allowPlaybackInterruption`
# @return [Boolean]
attr_accessor :allow_playback_interruption
alias_method :allow_playback_interruption?, :allow_playback_interruption
# Required. URI of the audio clip. Dialogflow does not impose any validation on
# this value. It is specific to the client that reads it.
# Corresponds to the JSON property `audioUri`
# @return [String]
attr_accessor :audio_uri
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allow_playback_interruption = args[:allow_playback_interruption] if args.key?(:allow_playback_interruption)
@audio_uri = args[:audio_uri] if args.key?(:audio_uri)
end
end
# The text response message.
class GoogleCloudDialogflowCxV3ResponseMessageText
include Google::Apis::Core::Hashable
# Output only. Whether the playback of this message can be interrupted by the
# end user's speech and the client can then starts the next Dialogflow request.
# Corresponds to the JSON property `allowPlaybackInterruption`
# @return [Boolean]
attr_accessor :allow_playback_interruption
alias_method :allow_playback_interruption?, :allow_playback_interruption
# Required. A collection of text responses.
# Corresponds to the JSON property `text`
# @return [Array<String>]
attr_accessor :text
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@allow_playback_interruption = args[:allow_playback_interruption] if args.key?(:allow_playback_interruption)
@text = args[:text] if args.key?(:text)
end
end
# Represents session information communicated to and from the webhook.
class GoogleCloudDialogflowCxV3SessionInfo
include Google::Apis::Core::Hashable
# Optional for WebhookRequest. Optional for WebhookResponse. All parameters
# collected from forms and intents during the session. Parameters can be created,
# updated, or removed by the webhook. To remove a parameter from the session,
# the webhook should explicitly set the parameter value to null in
# WebhookResponse. The map is keyed by parameters' display names.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Object>]
attr_accessor :parameters
# Always present for WebhookRequest. Ignored for WebhookResponse. The unique
# identifier of the session. This field can be used by the webhook to identify a
# user. Format: `projects//locations//agents//sessions/`.
# Corresponds to the JSON property `session`
# @return [String]
attr_accessor :session
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@parameters = args[:parameters] if args.key?(:parameters)
@session = args[:session] if args.key?(:session)
end
end
# The request message for a webhook call.
class GoogleCloudDialogflowCxV3WebhookRequest
include Google::Apis::Core::Hashable
# Always present. The unique identifier of the DetectIntentResponse that will be
# returned to the API caller.
# Corresponds to the JSON property `detectIntentResponseId`
# @return [String]
attr_accessor :detect_intent_response_id
# Represents fulfillment information communicated to the webhook.
# Corresponds to the JSON property `fulfillmentInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo]
attr_accessor :fulfillment_info
# Represents intent information communicated to the webhook.
# Corresponds to the JSON property `intentInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3WebhookRequestIntentInfo]
attr_accessor :intent_info
# The list of rich message responses to present to the user. Webhook can choose
# to append or replace this list in WebhookResponse.fulfillment_response;
# Corresponds to the JSON property `messages`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessage>]
attr_accessor :messages
# Represents page information communicated to and from the webhook.
# Corresponds to the JSON property `pageInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3PageInfo]
attr_accessor :page_info
# Custom data set in QueryParameters.payload.
# Corresponds to the JSON property `payload`
# @return [Hash<String,Object>]
attr_accessor :payload
# Represents session information communicated to and from the webhook.
# Corresponds to the JSON property `sessionInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3SessionInfo]
attr_accessor :session_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@detect_intent_response_id = args[:detect_intent_response_id] if args.key?(:detect_intent_response_id)
@fulfillment_info = args[:fulfillment_info] if args.key?(:fulfillment_info)
@intent_info = args[:intent_info] if args.key?(:intent_info)
@messages = args[:messages] if args.key?(:messages)
@page_info = args[:page_info] if args.key?(:page_info)
@payload = args[:payload] if args.key?(:payload)
@session_info = args[:session_info] if args.key?(:session_info)
end
end
# Represents fulfillment information communicated to the webhook.
class GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo
include Google::Apis::Core::Hashable
# Always present. The tag used to identify which fulfillment is being called.
# Corresponds to the JSON property `tag`
# @return [String]
attr_accessor :tag
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@tag = args[:tag] if args.key?(:tag)
end
end
# Represents intent information communicated to the webhook.
class GoogleCloudDialogflowCxV3WebhookRequestIntentInfo
include Google::Apis::Core::Hashable
# Always present. The unique identifier of the last matched intent. Format: `
# projects//locations//agents//intents/`.
# Corresponds to the JSON property `lastMatchedIntent`
# @return [String]
attr_accessor :last_matched_intent
# Parameters identified as a result of intent matching. This is a map of the
# name of the identified parameter to the value of the parameter identified from
# the user's utterance. All parameters defined in the matched intent that are
# identified will be surfaced here.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue>]
attr_accessor :parameters
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@last_matched_intent = args[:last_matched_intent] if args.key?(:last_matched_intent)
@parameters = args[:parameters] if args.key?(:parameters)
end
end
# Represents a value for an intent parameter.
class GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue
include Google::Apis::Core::Hashable
# Always present. Original text value extracted from user utterance.
# Corresponds to the JSON property `originalValue`
# @return [String]
attr_accessor :original_value
# Always present. Structured value for the parameter extracted from user
# utterance.
# Corresponds to the JSON property `resolvedValue`
# @return [Object]
attr_accessor :resolved_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@original_value = args[:original_value] if args.key?(:original_value)
@resolved_value = args[:resolved_value] if args.key?(:resolved_value)
end
end
# The response message for a webhook call.
class GoogleCloudDialogflowCxV3WebhookResponse
include Google::Apis::Core::Hashable
# Represents a fulfillment response to the user.
# Corresponds to the JSON property `fulfillmentResponse`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse]
attr_accessor :fulfillment_response
# Represents page information communicated to and from the webhook.
# Corresponds to the JSON property `pageInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3PageInfo]
attr_accessor :page_info
# Value to append directly to QueryResult.webhook_payloads.
# Corresponds to the JSON property `payload`
# @return [Hash<String,Object>]
attr_accessor :payload
# Represents session information communicated to and from the webhook.
# Corresponds to the JSON property `sessionInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3SessionInfo]
attr_accessor :session_info
# The target flow to transition to. Format: `projects//locations//agents//flows/`
# .
# Corresponds to the JSON property `targetFlow`
# @return [String]
attr_accessor :target_flow
# The target page to transition to. Format: `projects//locations//agents//flows//
# pages/`.
# Corresponds to the JSON property `targetPage`
# @return [String]
attr_accessor :target_page
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@fulfillment_response = args[:fulfillment_response] if args.key?(:fulfillment_response)
@page_info = args[:page_info] if args.key?(:page_info)
@payload = args[:payload] if args.key?(:payload)
@session_info = args[:session_info] if args.key?(:session_info)
@target_flow = args[:target_flow] if args.key?(:target_flow)
@target_page = args[:target_page] if args.key?(:target_page)
end
end
# Represents a fulfillment response to the user.
class GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse
include Google::Apis::Core::Hashable
# Merge behavior for `messages`.
# Corresponds to the JSON property `mergeBehavior`
# @return [String]
attr_accessor :merge_behavior
# The list of rich message responses to present to the user.
# Corresponds to the JSON property `messages`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3ResponseMessage>]
attr_accessor :messages
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@merge_behavior = args[:merge_behavior] if args.key?(:merge_behavior)
@messages = args[:messages] if args.key?(:messages)
end
end
# Metadata associated with the long running operation for Versions.CreateVersion.
class GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata
include Google::Apis::Core::Hashable
# Name of the created version. Format: `projects//locations//agents//flows//
# versions/`.
# Corresponds to the JSON property `version`
# @return [String]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@version = args[:version] if args.key?(:version)
end
end
# The response message for Agents.ExportAgent.
class GoogleCloudDialogflowCxV3beta1ExportAgentResponse
include Google::Apis::Core::Hashable
# Uncompressed raw byte content for agent.
# Corresponds to the JSON property `agentContent`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :agent_content
# The URI to a file containing the exported agent. This field is populated only
# if `agent_uri` is specified in ExportAgentRequest.
# Corresponds to the JSON property `agentUri`
# @return [String]
attr_accessor :agent_uri
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@agent_content = args[:agent_content] if args.key?(:agent_content)
@agent_uri = args[:agent_uri] if args.key?(:agent_uri)
end
end
# Represents page information communicated to and from the webhook.
class GoogleCloudDialogflowCxV3beta1PageInfo
include Google::Apis::Core::Hashable
# Always present for WebhookRequest. Ignored for WebhookResponse. The unique
# identifier of the current page. Format: `projects//locations//agents//flows//
# pages/`.
# Corresponds to the JSON property `currentPage`
# @return [String]
attr_accessor :current_page
# Represents form information.
# Corresponds to the JSON property `formInfo`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1PageInfoFormInfo]
attr_accessor :form_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@current_page = args[:current_page] if args.key?(:current_page)
@form_info = args[:form_info] if args.key?(:form_info)
end
end
# Represents form information.
class GoogleCloudDialogflowCxV3beta1PageInfoFormInfo
include Google::Apis::Core::Hashable
# Optional for both WebhookRequest and WebhookResponse. The parameters contained
# in the form. Note that the webhook cannot add or remove any form parameter.
# Corresponds to the JSON property `parameterInfo`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo>]
attr_accessor :parameter_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@parameter_info = args[:parameter_info] if args.key?(:parameter_info)
end
end
# Represents parameter information.
class GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo
include Google::Apis::Core::Hashable
# Always present for WebhookRequest. Required for WebhookResponse. The human-
# readable name of the parameter, unique within the form. This field cannot be
# modified by the webhook.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the
# parameter value was just collected on the last conversation turn.
# Corresponds to the JSON property `justCollected`
# @return [Boolean]
attr_accessor :just_collected
alias_method :just_collected?, :just_collected
# Optional for both WebhookRequest and WebhookResponse. Indicates whether the
# parameter is required. Optional parameters will not trigger prompts; however,
# they are filled if the user specifies them. Required parameters must be filled
# before form filling concludes.
# Corresponds to the JSON property `required`
# @return [Boolean]
attr_accessor :required
alias_method :required?, :required
# Always present for WebhookRequest. Required for WebhookResponse. The state of
# the parameter. This field can be set to INVALID by the webhook to invalidate
# the parameter; other values set by the webhook will be ignored.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# Optional for both WebhookRequest and WebhookResponse. The value of the
# parameter. This field can be set by the webhook to change the parameter value.
# Corresponds to the JSON property `value`
# @return [Object]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@just_collected = args[:just_collected] if args.key?(:just_collected)
@required = args[:required] if args.key?(:required)
@state = args[:state] if args.key?(:state)
@value = args[:value] if args.key?(:value)
end
end
# Represents a response message that can be returned by a conversational agent.
# Response messages are also used for output audio synthesis. The approach is as
# follows: * If at least one OutputAudioText response is present, then all
# OutputAudioText responses are linearly concatenated, and the result is used
# for output audio synthesis. * If the OutputAudioText responses are a mixture
# of text and SSML, then the concatenated result is treated as SSML; otherwise,
# the result is treated as either text or SSML as appropriate. The agent
# designer should ideally use either text or SSML consistently throughout the
# bot design. * Otherwise, all Text responses are linearly concatenated, and the
# result is used for output audio synthesis. This approach allows for more
# sophisticated user experience scenarios, where the text displayed to the user
# may differ from what is heard.
class GoogleCloudDialogflowCxV3beta1ResponseMessage
include Google::Apis::Core::Hashable
# Indicates that the conversation succeeded, i.e., the bot handled the issue
# that the customer talked to it about. Dialogflow only uses this to determine
# which conversations should be counted as successful and doesn't process the
# metadata in this message in any way. Note that Dialogflow also considers
# conversations that get to the conversation end page as successful even if they
# don't return ConversationSuccess. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates that the
# conversation succeeded. * In a webhook response when you determine that you
# handled the customer issue.
# Corresponds to the JSON property `conversationSuccess`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess]
attr_accessor :conversation_success
# Indicates that interaction with the Dialogflow agent has ended. This message
# is generated by Dialogflow only and not supposed to be defined by the user.
# Corresponds to the JSON property `endInteraction`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction]
attr_accessor :end_interaction
# Indicates that the conversation should be handed off to a live agent.
# Dialogflow only uses this to determine which conversations were handed off to
# a human agent for measurement purposes. What else to do with this signal is up
# to you and your handoff procedures. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates something went
# extremely wrong in the conversation. * In a webhook response when you
# determine that the customer issue can only be handled by a human.
# Corresponds to the JSON property `liveAgentHandoff`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff]
attr_accessor :live_agent_handoff
# Represents an audio message that is composed of both segments synthesized from
# the Dialogflow agent prompts and ones hosted externally at the specified URIs.
# The external URIs are specified via play_audio. This message is generated by
# Dialogflow only and not supposed to be defined by the user.
# Corresponds to the JSON property `mixedAudio`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio]
attr_accessor :mixed_audio
# A text or ssml response that is preferentially used for TTS output audio
# synthesis, as described in the comment on the ResponseMessage message.
# Corresponds to the JSON property `outputAudioText`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText]
attr_accessor :output_audio_text
# Returns a response containing a custom, platform-specific payload.
# Corresponds to the JSON property `payload`
# @return [Hash<String,Object>]
attr_accessor :payload
# Specifies an audio clip to be played by the client as part of the response.
# Corresponds to the JSON property `playAudio`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio]
attr_accessor :play_audio
# The text response message.
# Corresponds to the JSON property `text`
# @return [Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageText]
attr_accessor :text
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@conversation_success = args[:conversation_success] if args.key?(:conversation_success)
@end_interaction = args[:end_interaction] if args.key?(:end_interaction)
@live_agent_handoff = args[:live_agent_handoff] if args.key?(:live_agent_handoff)
@mixed_audio = args[:mixed_audio] if args.key?(:mixed_audio)
@output_audio_text = args[:output_audio_text] if args.key?(:output_audio_text)
@payload = args[:payload] if args.key?(:payload)
@play_audio = args[:play_audio] if args.key?(:play_audio)
@text = args[:text] if args.key?(:text)
end
end
# Indicates that the conversation succeeded, i.e., the bot handled the issue
# that the customer talked to it about. Dialogflow only uses this to determine
# which conversations should be counted as successful and doesn't process the
# metadata in this message in any way. Note that Dialogflow also considers
# conversations that get to the conversation end page as successful even if they
# don't return ConversationSuccess. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates that the
# conversation succeeded. * In a webhook response when you determine that you
# handled the customer issue.
class GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess
include Google::Apis::Core::Hashable
# Custom metadata. Dialogflow doesn't impose any structure on this.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@metadata = args[:metadata] if args.key?(:metadata)
end
end
# Indicates that interaction with the Dialogflow agent has ended. This message
# is generated by Dialogflow only and not supposed to be defined by the user.
class GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Indicates that the conversation should be handed off to a live agent.
# Dialogflow only uses this to determine which conversations were handed off to
# a human agent for measurement purposes. What else to do with this signal is up
# to you and your handoff procedures. You may set this, for example: * In the
# entry_fulfillment of a Page if entering the page indicates something went
# extremely wrong in the conversation. * In a webhook response when you
# determine that the customer issue can only be handled by a human.
class GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff
include Google::Apis::Core::Hashable
# Custom metadata for your handoff procedure. Dialogflow doesn't impose any
# structure on this.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@metadata = args[:metadata] if args.key?(:metadata)
end
end
# Represents an audio message that is composed of both segments synthesized from
# the Dialogflow agent prompts and ones hosted externally at the specified URIs.
# The external URIs are specified via play_audio. This message is generated by
# Dialogflow only and not supposed to be defined by the user.
class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio
include Google::Apis::Core::Hashable
# Segments this audio response is composed of.
# Corresponds to the JSON property `segments`
# @return [Array<Google::Apis::DialogflowV2beta1::GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment>]
attr_accessor :segments
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@segments = args[:segments] if args.key?(:segments)
end
end
# Represents one segment of audio.
class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment
include Google::Apis::Core::Hashable