forked from googleapis/google-api-ruby-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.rb
4488 lines (3785 loc) · 188 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 DialogflowV2
# Represents a conversational agent.
class GoogleCloudDialogflowV2Agent
include Google::Apis::Core::Hashable
# 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.
# Corresponds to the JSON property `avatarUri`
# @return [String]
attr_accessor :avatar_uri
# 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.
# Corresponds to the JSON property `classificationThreshold`
# @return [Float]
attr_accessor :classification_threshold
# 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.
# Corresponds to the JSON property `defaultLanguageCode`
# @return [String]
attr_accessor :default_language_code
# Optional. The description of this agent.
# The maximum length is 500 characters. If exceeded, the request is rejected.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Required. The name of this agent.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Optional. Determines whether this agent should log conversation queries.
# Corresponds to the JSON property `enableLogging`
# @return [Boolean]
attr_accessor :enable_logging
alias_method :enable_logging?, :enable_logging
# Optional. Determines how intents are detected from user queries.
# Corresponds to the JSON property `matchMode`
# @return [String]
attr_accessor :match_mode
# Required. The project of this agent.
# Format: `projects/<Project ID>`.
# Corresponds to the JSON property `parent`
# @return [String]
attr_accessor :parent
# Optional. The list of all languages supported by this agent (except for the
# `default_language_code`).
# Corresponds to the JSON property `supportedLanguageCodes`
# @return [Array<String>]
attr_accessor :supported_language_codes
# 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.
# Corresponds to the JSON property `timeZone`
# @return [String]
attr_accessor :time_zone
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@avatar_uri = args[:avatar_uri] if args.key?(:avatar_uri)
@classification_threshold = args[:classification_threshold] if args.key?(:classification_threshold)
@default_language_code = args[:default_language_code] if args.key?(:default_language_code)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@enable_logging = args[:enable_logging] if args.key?(:enable_logging)
@match_mode = args[:match_mode] if args.key?(:match_mode)
@parent = args[:parent] if args.key?(:parent)
@supported_language_codes = args[:supported_language_codes] if args.key?(:supported_language_codes)
@time_zone = args[:time_zone] if args.key?(:time_zone)
end
end
# The request message for EntityTypes.BatchCreateEntities.
class GoogleCloudDialogflowV2BatchCreateEntitiesRequest
include Google::Apis::Core::Hashable
# Required. The entities to create.
# Corresponds to the JSON property `entities`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityTypeEntity>]
attr_accessor :entities
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entities = args[:entities] if args.key?(:entities)
@language_code = args[:language_code] if args.key?(:language_code)
end
end
# The request message for EntityTypes.BatchDeleteEntities.
class GoogleCloudDialogflowV2BatchDeleteEntitiesRequest
include Google::Apis::Core::Hashable
# 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>`.
# Corresponds to the JSON property `entityValues`
# @return [Array<String>]
attr_accessor :entity_values
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity_values = args[:entity_values] if args.key?(:entity_values)
@language_code = args[:language_code] if args.key?(:language_code)
end
end
# The request message for EntityTypes.BatchDeleteEntityTypes.
class GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest
include Google::Apis::Core::Hashable
# Required. The names entity types to delete. All names must point to the
# same agent as `parent`.
# Corresponds to the JSON property `entityTypeNames`
# @return [Array<String>]
attr_accessor :entity_type_names
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity_type_names = args[:entity_type_names] if args.key?(:entity_type_names)
end
end
# The request message for Intents.BatchDeleteIntents.
class GoogleCloudDialogflowV2BatchDeleteIntentsRequest
include Google::Apis::Core::Hashable
# Required. The collection of intents to delete. Only intent `name` must be
# filled in.
# Corresponds to the JSON property `intents`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Intent>]
attr_accessor :intents
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@intents = args[:intents] if args.key?(:intents)
end
end
# The request message for EntityTypes.BatchUpdateEntities.
class GoogleCloudDialogflowV2BatchUpdateEntitiesRequest
include Google::Apis::Core::Hashable
# Required. The entities to update or create.
# Corresponds to the JSON property `entities`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityTypeEntity>]
attr_accessor :entities
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Optional. The mask to control which fields get updated.
# Corresponds to the JSON property `updateMask`
# @return [String]
attr_accessor :update_mask
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entities = args[:entities] if args.key?(:entities)
@language_code = args[:language_code] if args.key?(:language_code)
@update_mask = args[:update_mask] if args.key?(:update_mask)
end
end
# The request message for EntityTypes.BatchUpdateEntityTypes.
class GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest
include Google::Apis::Core::Hashable
# This message is a wrapper around a collection of entity types.
# Corresponds to the JSON property `entityTypeBatchInline`
# @return [Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityTypeBatch]
attr_accessor :entity_type_batch_inline
# 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://".
# Corresponds to the JSON property `entityTypeBatchUri`
# @return [String]
attr_accessor :entity_type_batch_uri
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Optional. The mask to control which fields get updated.
# Corresponds to the JSON property `updateMask`
# @return [String]
attr_accessor :update_mask
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity_type_batch_inline = args[:entity_type_batch_inline] if args.key?(:entity_type_batch_inline)
@entity_type_batch_uri = args[:entity_type_batch_uri] if args.key?(:entity_type_batch_uri)
@language_code = args[:language_code] if args.key?(:language_code)
@update_mask = args[:update_mask] if args.key?(:update_mask)
end
end
# The response message for EntityTypes.BatchUpdateEntityTypes.
class GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse
include Google::Apis::Core::Hashable
# The collection of updated or created entity types.
# Corresponds to the JSON property `entityTypes`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityType>]
attr_accessor :entity_types
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity_types = args[:entity_types] if args.key?(:entity_types)
end
end
# The request message for Intents.BatchUpdateIntents.
class GoogleCloudDialogflowV2BatchUpdateIntentsRequest
include Google::Apis::Core::Hashable
# This message is a wrapper around a collection of intents.
# Corresponds to the JSON property `intentBatchInline`
# @return [Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentBatch]
attr_accessor :intent_batch_inline
# 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://".
# Corresponds to the JSON property `intentBatchUri`
# @return [String]
attr_accessor :intent_batch_uri
# Optional. The resource view to apply to the returned intent.
# Corresponds to the JSON property `intentView`
# @return [String]
attr_accessor :intent_view
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Optional. The mask to control which fields get updated.
# Corresponds to the JSON property `updateMask`
# @return [String]
attr_accessor :update_mask
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@intent_batch_inline = args[:intent_batch_inline] if args.key?(:intent_batch_inline)
@intent_batch_uri = args[:intent_batch_uri] if args.key?(:intent_batch_uri)
@intent_view = args[:intent_view] if args.key?(:intent_view)
@language_code = args[:language_code] if args.key?(:language_code)
@update_mask = args[:update_mask] if args.key?(:update_mask)
end
end
# The response message for Intents.BatchUpdateIntents.
class GoogleCloudDialogflowV2BatchUpdateIntentsResponse
include Google::Apis::Core::Hashable
# The collection of updated or created intents.
# Corresponds to the JSON property `intents`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Intent>]
attr_accessor :intents
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@intents = args[:intents] if args.key?(:intents)
end
end
# Represents a context.
class GoogleCloudDialogflowV2Context
include Google::Apis::Core::Hashable
# 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 20 minutes even if there
# are no matching queries.
# Corresponds to the JSON property `lifespanCount`
# @return [Fixnum]
attr_accessor :lifespan_count
# Required. The unique identifier of the context. Format:
# `projects/<Project ID>/agent/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.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Optional. The collection of parameters associated with this context.
# Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
# syntax.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Object>]
attr_accessor :parameters
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@lifespan_count = args[:lifespan_count] if args.key?(:lifespan_count)
@name = args[:name] if args.key?(:name)
@parameters = args[:parameters] if args.key?(:parameters)
end
end
# The request to detect user's intent.
class GoogleCloudDialogflowV2DetectIntentRequest
include Google::Apis::Core::Hashable
# Optional. The natural language speech audio to be processed. This field
# should be populated iff `query_input` is set to an input audio config.
# A single request can contain up to 1 minute of speech audio data.
# Corresponds to the JSON property `inputAudio`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :input_audio
# Represents the query input. It can contain either:
# 1. An audio config which
# instructs the speech recognizer how to process the speech audio.
# 2. A conversational query in the form of text,.
# 3. An event that specifies which intent to trigger.
# Corresponds to the JSON property `queryInput`
# @return [Google::Apis::DialogflowV2::GoogleCloudDialogflowV2QueryInput]
attr_accessor :query_input
# Represents the parameters of the conversational query.
# Corresponds to the JSON property `queryParams`
# @return [Google::Apis::DialogflowV2::GoogleCloudDialogflowV2QueryParameters]
attr_accessor :query_params
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@input_audio = args[:input_audio] if args.key?(:input_audio)
@query_input = args[:query_input] if args.key?(:query_input)
@query_params = args[:query_params] if args.key?(:query_params)
end
end
# The message returned from the DetectIntent method.
class GoogleCloudDialogflowV2DetectIntentResponse
include Google::Apis::Core::Hashable
# Represents the result of conversational query or event processing.
# Corresponds to the JSON property `queryResult`
# @return [Google::Apis::DialogflowV2::GoogleCloudDialogflowV2QueryResult]
attr_accessor :query_result
# The unique identifier of the response. It can be used to
# locate a response in the training example set or for reporting issues.
# Corresponds to the JSON property `responseId`
# @return [String]
attr_accessor :response_id
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by
# [gRPC](https://github.com/grpc). The error model is designed to be:
# - Simple to use and understand for most users
# - Flexible enough to meet unexpected needs
# # Overview
# The `Status` message contains three pieces of data: error code, error message,
# and error details. The error code should be an enum value of
# google.rpc.Code, but it may accept additional error codes if needed. The
# error message should be a developer-facing English message that helps
# developers *understand* and *resolve* the error. If a localized user-facing
# error message is needed, put the localized message in the error details or
# localize it in the client. The optional error details may contain arbitrary
# information about the error. There is a predefined set of error detail types
# in the package `google.rpc` that can be used for common error conditions.
# # Language mapping
# The `Status` message is the logical representation of the error model, but it
# is not necessarily the actual wire format. When the `Status` message is
# exposed in different client libraries and different wire protocols, it can be
# mapped differently. For example, it will likely be mapped to some exceptions
# in Java, but more likely mapped to some error codes in C.
# # Other uses
# The error model and the `Status` message can be used in a variety of
# environments, either with or without APIs, to provide a
# consistent developer experience across different environments.
# Example uses of this error model include:
# - Partial errors. If a service needs to return partial errors to the client,
# it may embed the `Status` in the normal response to indicate the partial
# errors.
# - Workflow errors. A typical workflow has multiple steps. Each step may
# have a `Status` message for error reporting.
# - Batch operations. If a client uses batch request and batch response, the
# `Status` message should be used directly inside batch response, one for
# each error sub-response.
# - Asynchronous operations. If an API call embeds asynchronous operation
# results in its response, the status of those operations should be
# represented directly using the `Status` message.
# - Logging. If some API errors are stored in logs, the message `Status` could
# be used directly after any stripping needed for security/privacy reasons.
# Corresponds to the JSON property `webhookStatus`
# @return [Google::Apis::DialogflowV2::GoogleRpcStatus]
attr_accessor :webhook_status
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@query_result = args[:query_result] if args.key?(:query_result)
@response_id = args[:response_id] if args.key?(:response_id)
@webhook_status = args[:webhook_status] if args.key?(:webhook_status)
end
end
# Represents an entity type.
# Entity types serve as a tool for extracting parameter values from natural
# language queries.
class GoogleCloudDialogflowV2EntityType
include Google::Apis::Core::Hashable
# Optional. Indicates whether the entity type can be automatically
# expanded.
# Corresponds to the JSON property `autoExpansionMode`
# @return [String]
attr_accessor :auto_expansion_mode
# Required. The name of the entity type.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Optional. The collection of entities associated with the entity type.
# Corresponds to the JSON property `entities`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityTypeEntity>]
attr_accessor :entities
# Required. Indicates the kind of entity type.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Required for all methods except `create` (`create` populates the name
# automatically.
# The unique identifier of the entity type. Format:
# `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@auto_expansion_mode = args[:auto_expansion_mode] if args.key?(:auto_expansion_mode)
@display_name = args[:display_name] if args.key?(:display_name)
@entities = args[:entities] if args.key?(:entities)
@kind = args[:kind] if args.key?(:kind)
@name = args[:name] if args.key?(:name)
end
end
# This message is a wrapper around a collection of entity types.
class GoogleCloudDialogflowV2EntityTypeBatch
include Google::Apis::Core::Hashable
# A collection of entity types.
# Corresponds to the JSON property `entityTypes`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2EntityType>]
attr_accessor :entity_types
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity_types = args[:entity_types] if args.key?(:entity_types)
end
end
# Optional. Represents an entity.
class GoogleCloudDialogflowV2EntityTypeEntity
include Google::Apis::Core::Hashable
# Required. A collection of synonyms. For `KIND_LIST` entity types this
# must contain exactly one synonym equal to `value`.
# Corresponds to the JSON property `synonyms`
# @return [Array<String>]
attr_accessor :synonyms
# Required.
# For `KIND_MAP` entity types:
# A canonical name 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).
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@synonyms = args[:synonyms] if args.key?(:synonyms)
@value = args[:value] if args.key?(:value)
end
end
# 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?”`.
class GoogleCloudDialogflowV2EventInput
include Google::Apis::Core::Hashable
# 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Required. The unique identifier of the event.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Optional. The collection of parameters associated with the event.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Object>]
attr_accessor :parameters
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@language_code = args[:language_code] if args.key?(:language_code)
@name = args[:name] if args.key?(:name)
@parameters = args[:parameters] if args.key?(:parameters)
end
end
# The request message for Agents.ExportAgent.
class GoogleCloudDialogflowV2ExportAgentRequest
include Google::Apis::Core::Hashable
# Optional. The
# [Google Cloud Storage](https://cloud.google.com/storage/docs/)
# URI to export the agent to.
# The format of this URI must be `gs://<bucket-name>/<object-name>`.
# If left unspecified, the serialized agent is returned inline.
# 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_uri = args[:agent_uri] if args.key?(:agent_uri)
end
end
# The response message for Agents.ExportAgent.
class GoogleCloudDialogflowV2ExportAgentResponse
include Google::Apis::Core::Hashable
# The exported agent.
# Example for how to export an agent to a zip file via a command line:
# <pre>curl \
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/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": "\([^"]*\)".*/\1/' \
# | base64 --decode > <agent zip file></pre>
# 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
# The request message for Agents.ImportAgent.
class GoogleCloudDialogflowV2ImportAgentRequest
include Google::Apis::Core::Hashable
# The agent to import.
# Example for how to import an agent via the command line:
# <pre>curl \
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:
# import\
# -X POST \
# -H 'Authorization: Bearer '$(gcloud auth application-default
# print-access-token) \
# -H 'Accept: application/json' \
# -H 'Content-Type: application/json' \
# --compressed \
# --data-binary "`
# 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
# `"</pre>
# 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 Google Cloud Storage file containing the agent to import.
# Note: The URI must start with "gs://".
# 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
# Instructs the speech recognizer how to process the audio content.
class GoogleCloudDialogflowV2InputAudioConfig
include Google::Apis::Core::Hashable
# Required. Audio encoding of the audio content to process.
# Corresponds to the JSON property `audioEncoding`
# @return [String]
attr_accessor :audio_encoding
# Required. The language of the supplied audio. Dialogflow does not do
# translations. 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.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Optional. The collection of phrase hints which are used to boost accuracy
# of speech recognition.
# Refer to
# [Cloud Speech API
# documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-
# hints)
# for more details.
# Corresponds to the JSON property `phraseHints`
# @return [Array<String>]
attr_accessor :phrase_hints
# Required. Sample rate (in Hertz) of the audio content sent in the query.
# Refer to
# [Cloud Speech API
# documentation](https://cloud.google.com/speech-to-text/docs/basics) for
# more details.
# Corresponds to the JSON property `sampleRateHertz`
# @return [Fixnum]
attr_accessor :sample_rate_hertz
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@audio_encoding = args[:audio_encoding] if args.key?(:audio_encoding)
@language_code = args[:language_code] if args.key?(:language_code)
@phrase_hints = args[:phrase_hints] if args.key?(:phrase_hints)
@sample_rate_hertz = args[:sample_rate_hertz] if args.key?(:sample_rate_hertz)
end
end
# 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.
class GoogleCloudDialogflowV2Intent
include Google::Apis::Core::Hashable
# Optional. The name of the action associated with the intent.
# Note: The action name must not contain whitespaces.
# Corresponds to the JSON property `action`
# @return [String]
attr_accessor :action
# Optional. The list of platforms for which the first response will be
# taken from among the messages assigned to the DEFAULT_PLATFORM.
# Corresponds to the JSON property `defaultResponsePlatforms`
# @return [Array<String>]
attr_accessor :default_response_platforms
# Required. The name of this intent.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# 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.
# Corresponds to the JSON property `events`
# @return [Array<String>]
attr_accessor :events
# 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.
# Corresponds to the JSON property `followupIntentInfo`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentFollowupIntentInfo>]
attr_accessor :followup_intent_info
# Optional. The list of context names required for this intent to be
# triggered.
# Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
# Corresponds to the JSON property `inputContextNames`
# @return [Array<String>]
attr_accessor :input_context_names
# Optional. Indicates whether this is a fallback intent.
# Corresponds to the JSON property `isFallback`
# @return [Boolean]
attr_accessor :is_fallback
alias_method :is_fallback?, :is_fallback
# Optional. The collection of rich messages corresponding to the
# `Response` field in the Dialogflow console.
# Corresponds to the JSON property `messages`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentMessage>]
attr_accessor :messages
# Optional. Indicates whether Machine Learning is disabled for the intent.
# Note: If `ml_diabled` 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.
# Corresponds to the JSON property `mlDisabled`
# @return [Boolean]
attr_accessor :ml_disabled
alias_method :ml_disabled?, :ml_disabled
# Required for all methods except `create` (`create` populates the name
# automatically.
# The unique identifier of this intent.
# Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# 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>`.
# Corresponds to the JSON property `outputContexts`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Context>]
attr_accessor :output_contexts
# Optional. The collection of parameters associated with the intent.
# Corresponds to the JSON property `parameters`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentParameter>]
attr_accessor :parameters
# 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>`.
# Corresponds to the JSON property `parentFollowupIntentName`
# @return [String]
attr_accessor :parent_followup_intent_name
# Optional. The priority of this intent. Higher numbers represent higher
# priorities. Zero or negative numbers mean that the intent is disabled.
# Corresponds to the JSON property `priority`
# @return [Fixnum]
attr_accessor :priority
# Optional. Indicates whether to delete all contexts in the current
# session when this intent is matched.
# Corresponds to the JSON property `resetContexts`
# @return [Boolean]
attr_accessor :reset_contexts
alias_method :reset_contexts?, :reset_contexts
# 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>`.
# Corresponds to the JSON property `rootFollowupIntentName`
# @return [String]
attr_accessor :root_followup_intent_name
# Optional. The collection of examples/templates that the agent is
# trained on.
# Corresponds to the JSON property `trainingPhrases`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentTrainingPhrase>]
attr_accessor :training_phrases
# Optional. Indicates whether webhooks are enabled for the intent.
# Corresponds to the JSON property `webhookState`
# @return [String]
attr_accessor :webhook_state
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@action = args[:action] if args.key?(:action)
@default_response_platforms = args[:default_response_platforms] if args.key?(:default_response_platforms)
@display_name = args[:display_name] if args.key?(:display_name)
@events = args[:events] if args.key?(:events)
@followup_intent_info = args[:followup_intent_info] if args.key?(:followup_intent_info)
@input_context_names = args[:input_context_names] if args.key?(:input_context_names)
@is_fallback = args[:is_fallback] if args.key?(:is_fallback)
@messages = args[:messages] if args.key?(:messages)
@ml_disabled = args[:ml_disabled] if args.key?(:ml_disabled)
@name = args[:name] if args.key?(:name)
@output_contexts = args[:output_contexts] if args.key?(:output_contexts)
@parameters = args[:parameters] if args.key?(:parameters)
@parent_followup_intent_name = args[:parent_followup_intent_name] if args.key?(:parent_followup_intent_name)
@priority = args[:priority] if args.key?(:priority)
@reset_contexts = args[:reset_contexts] if args.key?(:reset_contexts)
@root_followup_intent_name = args[:root_followup_intent_name] if args.key?(:root_followup_intent_name)
@training_phrases = args[:training_phrases] if args.key?(:training_phrases)
@webhook_state = args[:webhook_state] if args.key?(:webhook_state)
end
end
# This message is a wrapper around a collection of intents.
class GoogleCloudDialogflowV2IntentBatch
include Google::Apis::Core::Hashable
# A collection of intents.
# Corresponds to the JSON property `intents`
# @return [Array<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Intent>]
attr_accessor :intents
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@intents = args[:intents] if args.key?(:intents)
end
end
# Represents a single followup intent in the chain.
class GoogleCloudDialogflowV2IntentFollowupIntentInfo
include Google::Apis::Core::Hashable
# The unique identifier of the followup intent.
# Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
# Corresponds to the JSON property `followupIntentName`
# @return [String]