/
v2.ts
6170 lines (5900 loc) · 235 KB
/
v2.ts
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 2019 Google LLC
*
* 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.
*/
import {GaxiosPromise} from 'gaxios';
import {Compute, JWT, OAuth2Client, UserRefreshClient} from 'google-auth-library';
import {APIRequestContext, BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';
// tslint:disable: no-any
// tslint:disable: class-name
// tslint:disable: variable-name
// tslint:disable: jsdoc-format
// tslint:disable: no-namespace
export namespace dialogflow_v2 {
export interface Options extends GlobalOptions {
version: 'v2';
}
let context: APIRequestContext;
interface StandardParameters {
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API
* access, quota, and reports. Required unless you provide an OAuth 2.0
* token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be
* any arbitrary string assigned to a user, but should not exceed 40
* characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Dialogflow API
*
* Builds conversational interfaces (for example, chatbots, and voice-powered
* apps and devices).
*
* @example
* const {google} = require('googleapis');
* const dialogflow = google.dialogflow('v2');
*
* @namespace dialogflow
* @type {Function}
* @version v2
* @variation v2
* @param {object=} options Options for Dialogflow
*/
export class Dialogflow {
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
context = {_options: options || {}, google};
this.projects = new Resource$Projects();
}
}
/**
* Represents a conversational agent.
*/
export interface Schema$GoogleCloudDialogflowV2Agent {
/**
* Optional. The URI of the agent's avatar. Avatars are used throughout
* the Dialogflow console and in the self-hosted [Web
* Demo](https://dialogflow.com/docs/integrations/web-demo) integration.
*/
avatarUri?: string;
/**
* Optional. To filter out false positive results and still get variety in
* matched natural language inputs for your agent, you can tune the machine
* learning classification threshold. If the returned score value is less
* than the threshold value, then a fallback intent is be triggered or, if
* there are no fallback intents defined, no intent will be triggered. The
* score values range from 0.0 (completely uncertain) to 1.0 (completely
* certain). If set to 0.0, the default of 0.3 is used.
*/
classificationThreshold?: number;
/**
* Required. The default language of the agent as a language tag. See
* [Language Support](https://dialogflow.com/docs/reference/language) for a
* list of the currently supported language codes. This field cannot be set
* by the `Update` method.
*/
defaultLanguageCode?: string;
/**
* Optional. The description of this agent. The maximum length is 500
* characters. If exceeded, the request is rejected.
*/
description?: string;
/**
* Required. The name of this agent.
*/
displayName?: string;
/**
* Optional. Determines whether this agent should log conversation queries.
*/
enableLogging?: boolean;
/**
* Optional. Determines how intents are detected from user queries.
*/
matchMode?: string;
/**
* Required. The project of this agent. Format: `projects/<Project
* ID>`.
*/
parent?: string;
/**
* Optional. The list of all languages supported by this agent (except for
* the `default_language_code`).
*/
supportedLanguageCodes?: string[];
/**
* Required. The time zone of this agent from the [time zone
* database](https://www.iana.org/time-zones), e.g., America/New_York,
* Europe/Paris.
*/
timeZone?: string;
}
/**
* The request message for EntityTypes.BatchCreateEntities.
*/
export interface Schema$GoogleCloudDialogflowV2BatchCreateEntitiesRequest {
/**
* Required. The entities to create.
*/
entities?: Schema$GoogleCloudDialogflowV2EntityTypeEntity[];
/**
* Optional. The language of entity synonyms defined in `entities`. If not
* specified, the agent's default language is used. [More than a dozen
* languages](https://dialogflow.com/docs/reference/language) are supported.
* Note: languages must be enabled in the agent, before they can be used.
*/
languageCode?: string;
}
/**
* The request message for EntityTypes.BatchDeleteEntities.
*/
export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntitiesRequest {
/**
* Required. The canonical `values` of the entities to delete. Note that
* these are not fully-qualified names, i.e. they don't start with
* `projects/<Project ID>`.
*/
entityValues?: string[];
/**
* Optional. The language of entity synonyms defined in `entities`. If not
* specified, the agent's default language is used. [More than a dozen
* languages](https://dialogflow.com/docs/reference/language) are supported.
* Note: languages must be enabled in the agent, before they can be used.
*/
languageCode?: string;
}
/**
* The request message for EntityTypes.BatchDeleteEntityTypes.
*/
export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest {
/**
* Required. The names entity types to delete. All names must point to the
* same agent as `parent`.
*/
entityTypeNames?: string[];
}
/**
* The request message for Intents.BatchDeleteIntents.
*/
export interface Schema$GoogleCloudDialogflowV2BatchDeleteIntentsRequest {
/**
* Required. The collection of intents to delete. Only intent `name` must be
* filled in.
*/
intents?: Schema$GoogleCloudDialogflowV2Intent[];
}
/**
* The request message for EntityTypes.BatchUpdateEntities.
*/
export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntitiesRequest {
/**
* Required. The entities to update or create.
*/
entities?: Schema$GoogleCloudDialogflowV2EntityTypeEntity[];
/**
* Optional. The language of entity synonyms defined in `entities`. If not
* specified, the agent's default language is used. [More than a dozen
* languages](https://dialogflow.com/docs/reference/language) are supported.
* Note: languages must be enabled in the agent, before they can be used.
*/
languageCode?: string;
/**
* Optional. The mask to control which fields get updated.
*/
updateMask?: string;
}
/**
* The request message for EntityTypes.BatchUpdateEntityTypes.
*/
export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest {
/**
* The collection of entity types to update or create.
*/
entityTypeBatchInline?: Schema$GoogleCloudDialogflowV2EntityTypeBatch;
/**
* The URI to a Google Cloud Storage file containing entity types to update
* or create. The file format can either be a serialized proto (of
* EntityBatch type) or a JSON object. Note: The URI must start with
* "gs://".
*/
entityTypeBatchUri?: string;
/**
* Optional. The language of entity synonyms defined in `entity_types`. If
* not specified, the agent's default language is used. [More than a
* dozen languages](https://dialogflow.com/docs/reference/language) are
* supported. Note: languages must be enabled in the agent, before they can
* be used.
*/
languageCode?: string;
/**
* Optional. The mask to control which fields get updated.
*/
updateMask?: string;
}
/**
* The response message for EntityTypes.BatchUpdateEntityTypes.
*/
export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse {
/**
* The collection of updated or created entity types.
*/
entityTypes?: Schema$GoogleCloudDialogflowV2EntityType[];
}
/**
* The request message for Intents.BatchUpdateIntents.
*/
export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsRequest {
/**
* The collection of intents to update or create.
*/
intentBatchInline?: Schema$GoogleCloudDialogflowV2IntentBatch;
/**
* The URI to a Google Cloud Storage file containing intents to update or
* create. The file format can either be a serialized proto (of IntentBatch
* type) or JSON object. Note: The URI must start with "gs://".
*/
intentBatchUri?: string;
/**
* Optional. The resource view to apply to the returned intent.
*/
intentView?: string;
/**
* Optional. The language of training phrases, parameters and rich messages
* defined in `intents`. If not specified, the agent's default language
* is used. [More than a dozen
* languages](https://dialogflow.com/docs/reference/language) are supported.
* Note: languages must be enabled in the agent, before they can be used.
*/
languageCode?: string;
/**
* Optional. The mask to control which fields get updated.
*/
updateMask?: string;
}
/**
* The response message for Intents.BatchUpdateIntents.
*/
export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse {
/**
* The collection of updated or created intents.
*/
intents?: Schema$GoogleCloudDialogflowV2Intent[];
}
/**
* The response message for EntityTypes.BatchUpdateEntityTypes.
*/
export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse {
/**
* The collection of updated or created entity types.
*/
entityTypes?: Schema$GoogleCloudDialogflowV2beta1EntityType[];
}
/**
* The response message for Intents.BatchUpdateIntents.
*/
export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse {
/**
* The collection of updated or created intents.
*/
intents?: Schema$GoogleCloudDialogflowV2beta1Intent[];
}
/**
* Represents a context.
*/
export interface Schema$GoogleCloudDialogflowV2beta1Context {
/**
* Optional. The number of conversational query requests after which the
* context expires. If set to `0` (the default) the context expires
* immediately. Contexts expire automatically after 10 minutes even if there
* are no matching queries.
*/
lifespanCount?: number;
/**
* Required. The unique identifier of the context. Format:
* `projects/<Project ID>/agent/sessions/<Session
* ID>/contexts/<Context ID>`, or `projects/<Project
* ID>/agent/environments/<Environment ID>/users/<User
* ID>/sessions/<Session ID>/contexts/<Context ID>`. The
* `Context ID` is always converted to lowercase, may only contain
* characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If
* `Environment ID` is not specified, we assume default 'draft'
* environment. If `User ID` is not specified, we assume default '-'
* user.
*/
name?: string;
/**
* Optional. The collection of parameters associated with this context.
* Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters)
* for syntax.
*/
parameters?: {[key: string]: any;};
}
/**
* Represents an entity type. Entity types serve as a tool for extracting
* parameter values from natural language queries.
*/
export interface Schema$GoogleCloudDialogflowV2beta1EntityType {
/**
* Optional. Indicates whether the entity type can be automatically
* expanded.
*/
autoExpansionMode?: string;
/**
* Required. The name of the entity type.
*/
displayName?: string;
/**
* Optional. The collection of entity entries associated with the entity
* type.
*/
entities?: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[];
/**
* Required. Indicates the kind of entity type.
*/
kind?: string;
/**
* The unique identifier of the entity type. Required for
* EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes
* methods. Format: `projects/<Project
* ID>/agent/entityTypes/<Entity Type ID>`.
*/
name?: string;
}
/**
* An **entity entry** for an associated entity type.
*/
export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity {
/**
* Required. A collection of value synonyms. For example, if the entity type
* is *vegetable*, and `value` is *scallions*, a synonym could be *green
* onions*. For `KIND_LIST` entity types: * This collection must contain
* exactly one synonym equal to `value`.
*/
synonyms?: string[];
/**
* Required. The primary value associated with this entity entry. For
* example, if the entity type is *vegetable*, the value could be
* *scallions*. For `KIND_MAP` entity types: * A canonical value to be
* used in place of synonyms. For `KIND_LIST` entity types: * A string
* that can contain references to other entity types (with or without
* aliases).
*/
value?: string;
}
/**
* Events allow for matching intents by event name instead of the natural
* language input. For instance, input `<event: { name:
* "welcome_event", parameters: { name: "Sam" } }>` can
* trigger a personalized welcome response. The parameter `name` may be used
* by the agent in the response: `"Hello #welcome_event.name! What can I
* do for you today?"`.
*/
export interface Schema$GoogleCloudDialogflowV2beta1EventInput {
/**
* Required. The language of this query. See [Language
* Support](https://dialogflow.com/docs/languages) for a list of the
* currently supported language codes. Note that queries in the same session
* do not necessarily need to specify the same language.
*/
languageCode?: string;
/**
* Required. The unique identifier of the event.
*/
name?: string;
/**
* Optional. The collection of parameters associated with the event.
*/
parameters?: {[key: string]: any;};
}
/**
* The response message for Agents.ExportAgent.
*/
export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse {
/**
* The exported agent. Example for how to export an agent to a zip file via
* a command line: <pre>curl \
* 'https://dialogflow.googleapis.com/v2beta1/projects/&lt;project_name&gt;/agent:export'\
* -X POST \ -H 'Authorization: Bearer '$(gcloud auth
* application-default print-access-token) \ -H 'Accept:
* application/json' \ -H 'Content-Type: application/json' \
* --compressed \ --data-binary '{}' \ | grep agentContent | sed
* -e 's/.*"agentContent":
* "\([^"]*\)".x/\1/' \ | base64 --decode >
* &lt;agent zip file&gt;</pre>
*/
agentContent?: string;
/**
* The URI to a file containing the exported agent. This field is populated
* only if `agent_uri` is specified in `ExportAgentRequest`.
*/
agentUri?: string;
}
/**
* Represents an intent. Intents convert a number of user expressions or
* patterns into an action. An action is an extraction of a user command or
* sentence semantics.
*/
export interface Schema$GoogleCloudDialogflowV2beta1Intent {
/**
* Optional. The name of the action associated with the intent. Note: The
* action name must not contain whitespaces.
*/
action?: string;
/**
* Optional. The list of platforms for which the first response will be
* taken from among the messages assigned to the DEFAULT_PLATFORM.
*/
defaultResponsePlatforms?: string[];
/**
* Required. The name of this intent.
*/
displayName?: string;
/**
* Optional. Indicates that this intent ends an interaction. Some
* integrations (e.g., Actions on Google or Dialogflow phone gateway) use
* this information to close interaction with an end user. Default is false.
*/
endInteraction?: boolean;
/**
* Optional. The collection of event names that trigger the intent. If the
* collection of input contexts is not empty, all of the contexts must be
* present in the active user session for an event to trigger this intent.
*/
events?: string[];
/**
* Read-only. Information about all followup intents that have this intent
* as a direct or indirect parent. We populate this field only in the
* output.
*/
followupIntentInfo?:
Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[];
/**
* Optional. The list of context names required for this intent to be
* triggered. Format: `projects/<Project
* ID>/agent/sessions/-/contexts/<Context ID>`.
*/
inputContextNames?: string[];
/**
* Optional. Indicates whether this is a fallback intent.
*/
isFallback?: boolean;
/**
* Optional. The collection of rich messages corresponding to the `Response`
* field in the Dialogflow console.
*/
messages?: Schema$GoogleCloudDialogflowV2beta1IntentMessage[];
/**
* Optional. Indicates whether Machine Learning is disabled for the intent.
* Note: If `ml_disabled` setting is set to true, then this intent is not
* taken into account during inference in `ML ONLY` match mode. Also,
* auto-markup in the UI is turned off.
*/
mlDisabled?: boolean;
/**
* Optional. Indicates whether Machine Learning is enabled for the intent.
* Note: If `ml_enabled` setting is set to false, then this intent is not
* taken into account during inference in `ML ONLY` match mode. Also,
* auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled`
* field instead. NOTE: If both `ml_enabled` and `ml_disabled` are either
* not set or false, then the default value is determined as follows: -
* Before April 15th, 2018 the default is: ml_enabled = false /
* ml_disabled = true. - After April 15th, 2018 the default is: ml_enabled
* = true / ml_disabled = false.
*/
mlEnabled?: boolean;
/**
* The unique identifier of this intent. Required for Intents.UpdateIntent
* and Intents.BatchUpdateIntents methods. Format: `projects/<Project
* ID>/agent/intents/<Intent ID>`.
*/
name?: string;
/**
* Optional. The collection of contexts that are activated when the intent
* is matched. Context messages in this collection should not set the
* parameters field. Setting the `lifespan_count` to 0 will reset the
* context when the intent is matched. Format: `projects/<Project
* ID>/agent/sessions/-/contexts/<Context ID>`.
*/
outputContexts?: Schema$GoogleCloudDialogflowV2beta1Context[];
/**
* Optional. The collection of parameters associated with the intent.
*/
parameters?: Schema$GoogleCloudDialogflowV2beta1IntentParameter[];
/**
* Read-only after creation. The unique identifier of the parent intent in
* the chain of followup intents. You can set this field when creating an
* intent, for example with CreateIntent or BatchUpdateIntents, in order to
* make this intent a followup intent. It identifies the parent followup
* intent. Format: `projects/<Project ID>/agent/intents/<Intent
* ID>`.
*/
parentFollowupIntentName?: string;
/**
* Optional. The priority of this intent. Higher numbers represent higher
* priorities. If this is zero or unspecified, we use the default priority
* 500000. Negative numbers mean that the intent is disabled.
*/
priority?: number;
/**
* Optional. Indicates whether to delete all contexts in the current session
* when this intent is matched.
*/
resetContexts?: boolean;
/**
* Read-only. The unique identifier of the root intent in the chain of
* followup intents. It identifies the correct followup intents chain for
* this intent. We populate this field only in the output. Format:
* `projects/<Project ID>/agent/intents/<Intent ID>`.
*/
rootFollowupIntentName?: string;
/**
* Optional. The collection of examples that the agent is trained on.
*/
trainingPhrases?: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[];
/**
* Optional. Indicates whether webhooks are enabled for the intent.
*/
webhookState?: string;
}
/**
* Represents a single followup intent in the chain.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo {
/**
* The unique identifier of the followup intent. Format:
* `projects/<Project ID>/agent/intents/<Intent ID>`.
*/
followupIntentName?: string;
/**
* The unique identifier of the followup intent's parent. Format:
* `projects/<Project ID>/agent/intents/<Intent ID>`.
*/
parentFollowupIntentName?: string;
}
/**
* Corresponds to the `Response` field in the Dialogflow console.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage {
/**
* Displays a basic card for Actions on Google.
*/
basicCard?: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard;
/**
* Displays a card.
*/
card?: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard;
/**
* Displays a carousel card for Actions on Google.
*/
carouselSelect?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect;
/**
* Displays an image.
*/
image?: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage;
/**
* Displays a link out suggestion chip for Actions on Google.
*/
linkOutSuggestion?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion;
/**
* Displays a list card for Actions on Google.
*/
listSelect?: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect;
/**
* Returns a response containing a custom, platform-specific payload. See
* the Intent.Message.Platform type for a description of the structure that
* may be required for your platform.
*/
payload?: {[key: string]: any;};
/**
* Optional. The platform that this message is intended for.
*/
platform?: string;
/**
* Displays quick replies.
*/
quickReplies?: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies;
/**
* Returns a voice or text-only response for Actions on Google.
*/
simpleResponses?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses;
/**
* Displays suggestion chips for Actions on Google.
*/
suggestions?: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions;
/**
* Plays audio from a file in Telephony Gateway.
*/
telephonyPlayAudio?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio;
/**
* Synthesizes speech in Telephony Gateway.
*/
telephonySynthesizeSpeech?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech;
/**
* Transfers the call in Telephony Gateway.
*/
telephonyTransferCall?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall;
/**
* Returns a text response.
*/
text?: Schema$GoogleCloudDialogflowV2beta1IntentMessageText;
}
/**
* The basic card message. Useful for displaying information.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard {
/**
* Optional. The collection of card buttons.
*/
buttons?: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[];
/**
* Required, unless image is present. The body text of the card.
*/
formattedText?: string;
/**
* Optional. The image for the card.
*/
image?: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage;
/**
* Optional. The subtitle of the card.
*/
subtitle?: string;
/**
* Optional. The title of the card.
*/
title?: string;
}
/**
* The button object that appears at the bottom of a card.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton {
/**
* Required. Action to take when a user taps on the button.
*/
openUriAction?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction;
/**
* Required. The title of the button.
*/
title?: string;
}
/**
* Opens the given URI.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction {
/**
* Required. The HTTP or HTTPS scheme URI.
*/
uri?: string;
}
/**
* The card response message.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard {
/**
* Optional. The collection of card buttons.
*/
buttons?: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[];
/**
* Optional. The public URI to an image file for the card.
*/
imageUri?: string;
/**
* Optional. The subtitle of the card.
*/
subtitle?: string;
/**
* Optional. The title of the card.
*/
title?: string;
}
/**
* Optional. Contains information about a button.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton {
/**
* Optional. The text to send back to the Dialogflow API or a URI to open.
*/
postback?: string;
/**
* Optional. The text to show on the button.
*/
text?: string;
}
/**
* The card for presenting a carousel of options to select from.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect {
/**
* Required. Carousel items.
*/
items?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[];
}
/**
* An item in the carousel.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem {
/**
* Optional. The body text of the card.
*/
description?: string;
/**
* Optional. The image to display.
*/
image?: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage;
/**
* Required. Additional info about the option item.
*/
info?: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo;
/**
* Required. Title of the carousel item.
*/
title?: string;
}
/**
* The image response message.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage {
/**
* A text description of the image to be used for accessibility, e.g.,
* screen readers. Required if image_uri is set for CarouselSelect.
*/
accessibilityText?: string;
/**
* Optional. The public URI to an image file.
*/
imageUri?: string;
}
/**
* The suggestion chip message that allows the user to jump out to the app or
* website associated with this agent.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion {
/**
* Required. The name of the app or site this chip is linking to.
*/
destinationName?: string;
/**
* Required. The URI of the app or site to open when the user taps the
* suggestion chip.
*/
uri?: string;
}
/**
* The card for presenting a list of options to select from.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect {
/**
* Required. List items.
*/
items?: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[];
/**
* Optional. The overall title of the list.
*/
title?: string;
}
/**
* An item in the list.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem {
/**
* Optional. The main text describing the item.
*/
description?: string;
/**
* Optional. The image to display.
*/
image?: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage;
/**
* Required. Additional information about this option.
*/
info?: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo;
/**
* Required. The title of the list item.
*/
title?: string;
}
/**
* The quick replies response message.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies {
/**
* Optional. The collection of quick replies.
*/
quickReplies?: string[];
/**
* Optional. The title of the collection of quick replies.
*/
title?: string;
}
/**
* Additional info about the select item for when it is triggered in a dialog.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo {
/**
* Required. A unique key that will be sent back to the agent if this
* response is given.
*/
key?: string;
/**
* Optional. A list of synonyms that can also be used to trigger this item
* in dialog.
*/
synonyms?: string[];
}
/**
* The simple response message containing speech or text.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse {
/**
* Optional. The text to display.
*/
displayText?: string;
/**
* One of text_to_speech or ssml must be provided. Structured spoken
* response to the user in the SSML format. Mutually exclusive with
* text_to_speech.
*/
ssml?: string;
/**
* One of text_to_speech or ssml must be provided. The plain text of the
* speech output. Mutually exclusive with ssml.
*/
textToSpeech?: string;
}
/**
* The collection of simple response candidates. This message in
* `QueryResult.fulfillment_messages` and
* `WebhookResponse.fulfillment_messages` should contain only one
* `SimpleResponse`.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses {
/**
* Required. The list of simple responses.
*/
simpleResponses?:
Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[];
}
/**
* The suggestion chip message that the user can tap to quickly post a reply
* to the conversation.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion {
/**
* Required. The text shown the in the suggestion chip.
*/
title?: string;
}
/**
* The collection of suggestions.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions {
/**
* Required. The list of suggested replies.
*/
suggestions?: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[];
}
/**
* Plays audio from a file in Telephony Gateway.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio {
/**
* Required. URI to a Google Cloud Storage object containing the audio to
* play, e.g., "gs://bucket/object". The object must contain a
* single channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz.
* This object must be readable by the `service-<Project
* Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` service account
* where <Project Number> is the number of the Telephony Gateway
* project (usually the same as the Dialogflow agent project). If the Google
* Cloud Storage bucket is in the Telephony Gateway project, this permission
* is added by default when enabling the Dialogflow V2 API. For audio from
* other sources, consider using the `TelephonySynthesizeSpeech` message
* with SSML.
*/
audioUri?: string;
}
/**
* Synthesizes speech and plays back the synthesized audio to the caller in
* Telephony Gateway. Telephony Gateway takes the synthesizer settings from
* `DetectIntentResponse.output_audio_config` which can either be set at
* request-level or can come from the agent-level synthesizer config.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech {
/**
* The SSML to be synthesized. For more information, see
* [SSML](https://developers.google.com/actions/reference/ssml).
*/
ssml?: string;
/**
* The raw text to be synthesized.
*/
text?: string;
}
/**
* Transfers the call in Telephony Gateway.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall {
/**
* Required. The phone number to transfer the call to in [E.164
* format](https://en.wikipedia.org/wiki/E.164). We currently only allow
* transferring to US numbers (+1xxxyyyzzzz).
*/
phoneNumber?: string;
}
/**
* The text response message.
*/
export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText {
/**
* Optional. The collection of the agent's responses.
*/
text?: string[];
}
/**
* Represents intent parameters.