google-cloud-dialogflow 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/AUTHENTICATION.md +199 -0
- data/README.md +2 -2
- data/lib/google/cloud/dialogflow.rb +21 -14
- data/lib/google/cloud/dialogflow/v2.rb +21 -14
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +14 -14
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +56 -36
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +51 -0
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +7 -3
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +48 -26
- data/lib/google/cloud/dialogflow/v2/credentials.rb +3 -2
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +31 -26
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +120 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +8 -4
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +74 -56
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +78 -44
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +111 -37
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +11 -5
- data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +2 -44
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +3 -2
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +19 -27
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +18 -15
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +1 -35
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +12 -14
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +104 -69
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +6 -4
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +73 -45
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -2
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +28 -8
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +23 -0
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +15 -3
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +2 -1
- metadata +28 -6
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2019 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -46,19 +46,22 @@ module Google
|
|
46
46
|
#
|
47
47
|
# You can create an agent using both Dialogflow Standard Edition and
|
48
48
|
# Dialogflow Enterprise Edition. For details, see
|
49
|
-
# [Dialogflow
|
49
|
+
# [Dialogflow
|
50
|
+
# Editions](https://cloud.google.com/dialogflow-enterprise/docs/editions).
|
50
51
|
#
|
51
52
|
# You can save your agent for backup or versioning by exporting the agent by
|
52
53
|
# using the {Google::Cloud::Dialogflow::V2::Agents::ExportAgent ExportAgent} method. You can import a saved
|
53
54
|
# agent by using the {Google::Cloud::Dialogflow::V2::Agents::ImportAgent ImportAgent} method.
|
54
55
|
#
|
55
56
|
# Dialogflow provides several
|
56
|
-
# [prebuilt
|
57
|
-
#
|
58
|
-
#
|
57
|
+
# [prebuilt
|
58
|
+
# agents](https://cloud.google.com/dialogflow-enterprise/docs/agents-prebuilt)
|
59
|
+
# for common conversation scenarios such as determining a date and time,
|
60
|
+
# converting currency, and so on.
|
59
61
|
#
|
60
62
|
# For more information about agents, see the
|
61
|
-
# [Dialogflow
|
63
|
+
# [Dialogflow
|
64
|
+
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/agents-overview).
|
62
65
|
#
|
63
66
|
# @!attribute [r] agents_stub
|
64
67
|
# @return [Google::Cloud::Dialogflow::V2::Agents::Stub]
|
@@ -89,7 +92,8 @@ module Google
|
|
89
92
|
# The scopes needed to make gRPC calls to all of the methods defined in
|
90
93
|
# this service.
|
91
94
|
ALL_SCOPES = [
|
92
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
95
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
96
|
+
"https://www.googleapis.com/auth/dialogflow"
|
93
97
|
].freeze
|
94
98
|
|
95
99
|
# @private
|
@@ -228,32 +232,50 @@ module Google
|
|
228
232
|
@get_agent = Google::Gax.create_api_call(
|
229
233
|
@agents_stub.method(:get_agent),
|
230
234
|
defaults["get_agent"],
|
231
|
-
exception_transformer: exception_transformer
|
235
|
+
exception_transformer: exception_transformer,
|
236
|
+
params_extractor: proc do |request|
|
237
|
+
{'parent' => request.parent}
|
238
|
+
end
|
232
239
|
)
|
233
240
|
@search_agents = Google::Gax.create_api_call(
|
234
241
|
@agents_stub.method(:search_agents),
|
235
242
|
defaults["search_agents"],
|
236
|
-
exception_transformer: exception_transformer
|
243
|
+
exception_transformer: exception_transformer,
|
244
|
+
params_extractor: proc do |request|
|
245
|
+
{'parent' => request.parent}
|
246
|
+
end
|
237
247
|
)
|
238
248
|
@train_agent = Google::Gax.create_api_call(
|
239
249
|
@agents_stub.method(:train_agent),
|
240
250
|
defaults["train_agent"],
|
241
|
-
exception_transformer: exception_transformer
|
251
|
+
exception_transformer: exception_transformer,
|
252
|
+
params_extractor: proc do |request|
|
253
|
+
{'parent' => request.parent}
|
254
|
+
end
|
242
255
|
)
|
243
256
|
@export_agent = Google::Gax.create_api_call(
|
244
257
|
@agents_stub.method(:export_agent),
|
245
258
|
defaults["export_agent"],
|
246
|
-
exception_transformer: exception_transformer
|
259
|
+
exception_transformer: exception_transformer,
|
260
|
+
params_extractor: proc do |request|
|
261
|
+
{'parent' => request.parent}
|
262
|
+
end
|
247
263
|
)
|
248
264
|
@import_agent = Google::Gax.create_api_call(
|
249
265
|
@agents_stub.method(:import_agent),
|
250
266
|
defaults["import_agent"],
|
251
|
-
exception_transformer: exception_transformer
|
267
|
+
exception_transformer: exception_transformer,
|
268
|
+
params_extractor: proc do |request|
|
269
|
+
{'parent' => request.parent}
|
270
|
+
end
|
252
271
|
)
|
253
272
|
@restore_agent = Google::Gax.create_api_call(
|
254
273
|
@agents_stub.method(:restore_agent),
|
255
274
|
defaults["restore_agent"],
|
256
|
-
exception_transformer: exception_transformer
|
275
|
+
exception_transformer: exception_transformer,
|
276
|
+
params_extractor: proc do |request|
|
277
|
+
{'parent' => request.parent}
|
278
|
+
end
|
257
279
|
)
|
258
280
|
end
|
259
281
|
|
@@ -353,8 +375,7 @@ module Google
|
|
353
375
|
|
354
376
|
# Trains the specified agent.
|
355
377
|
#
|
356
|
-
# Operation <response: {Google::Protobuf::Empty}
|
357
|
-
# metadata: {Google::Protobuf::Struct}>
|
378
|
+
# Operation <response: {Google::Protobuf::Empty}>
|
358
379
|
#
|
359
380
|
# @param parent [String]
|
360
381
|
# Required. The project that the agent to train is associated with.
|
@@ -417,16 +438,17 @@ module Google
|
|
417
438
|
|
418
439
|
# Exports the specified agent to a ZIP file.
|
419
440
|
#
|
420
|
-
# Operation <response: {Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}
|
421
|
-
# metadata: {Google::Protobuf::Struct}>
|
441
|
+
# Operation <response: {Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}>
|
422
442
|
#
|
423
443
|
# @param parent [String]
|
424
444
|
# Required. The project that the agent to export is associated with.
|
425
445
|
# Format: `projects/<Project ID>`.
|
426
446
|
# @param agent_uri [String]
|
427
|
-
# Optional. The
|
428
|
-
#
|
429
|
-
#
|
447
|
+
# Optional. The
|
448
|
+
# [Google Cloud Storage](https://cloud.google.com/storage/docs/)
|
449
|
+
# URI to export the agent to.
|
450
|
+
# The format of this URI must be `gs://<bucket-name>/<object-name>`.
|
451
|
+
# If left unspecified, the serialized agent is returned inline.
|
430
452
|
# @param options [Google::Gax::CallOptions]
|
431
453
|
# Overrides the default settings for this call, e.g, timeout,
|
432
454
|
# retries, etc.
|
@@ -491,8 +513,7 @@ module Google
|
|
491
513
|
# Intents and entity types with the same name are replaced with the new
|
492
514
|
# versions from ImportAgentRequest.
|
493
515
|
#
|
494
|
-
# Operation <response: {Google::Protobuf::Empty}
|
495
|
-
# metadata: {Google::Protobuf::Struct}>
|
516
|
+
# Operation <response: {Google::Protobuf::Empty}>
|
496
517
|
#
|
497
518
|
# @param parent [String]
|
498
519
|
# Required. The project that the agent to import is associated with.
|
@@ -504,17 +525,17 @@ module Google
|
|
504
525
|
# The agent to import.
|
505
526
|
#
|
506
527
|
# Example for how to import an agent via the command line:
|
507
|
-
#
|
508
|
-
#
|
509
|
-
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\
|
528
|
+
# <pre>curl \
|
529
|
+
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\
|
510
530
|
# -X POST \
|
511
|
-
# -H 'Authorization: Bearer '$(gcloud auth
|
531
|
+
# -H 'Authorization: Bearer '$(gcloud auth application-default
|
532
|
+
# print-access-token) \
|
512
533
|
# -H 'Accept: application/json' \
|
513
534
|
# -H 'Content-Type: application/json' \
|
514
535
|
# --compressed \
|
515
536
|
# --data-binary "{
|
516
|
-
# 'agentContent': '$(cat
|
517
|
-
# }"
|
537
|
+
# 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
|
538
|
+
# }"</pre>
|
518
539
|
# @param options [Google::Gax::CallOptions]
|
519
540
|
# Overrides the default settings for this call, e.g, timeout,
|
520
541
|
# retries, etc.
|
@@ -580,8 +601,7 @@ module Google
|
|
580
601
|
# Replaces the current agent version with a new one. All the intents and
|
581
602
|
# entity types in the older version are deleted.
|
582
603
|
#
|
583
|
-
# Operation <response: {Google::Protobuf::Empty}
|
584
|
-
# metadata: {Google::Protobuf::Struct}>
|
604
|
+
# Operation <response: {Google::Protobuf::Empty}>
|
585
605
|
#
|
586
606
|
# @param parent [String]
|
587
607
|
# Required. The project that the agent to restore is associated with.
|
@@ -593,17 +613,17 @@ module Google
|
|
593
613
|
# The agent to restore.
|
594
614
|
#
|
595
615
|
# Example for how to restore an agent via the command line:
|
596
|
-
#
|
597
|
-
#
|
598
|
-
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\
|
616
|
+
# <pre>curl \
|
617
|
+
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\
|
599
618
|
# -X POST \
|
600
|
-
# -H 'Authorization: Bearer '$(gcloud auth
|
619
|
+
# -H 'Authorization: Bearer '$(gcloud auth application-default
|
620
|
+
# print-access-token) \
|
601
621
|
# -H 'Accept: application/json' \
|
602
622
|
# -H 'Content-Type: application/json' \
|
603
623
|
# --compressed \
|
604
624
|
# --data-binary "{
|
605
|
-
# 'agentContent': '$(cat
|
606
|
-
# }"
|
625
|
+
# 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
|
626
|
+
# }"</pre>
|
607
627
|
# @param options [Google::Gax::CallOptions]
|
608
628
|
# Overrides the default settings for this call, e.g, timeout,
|
609
629
|
# retries, etc.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/dialogflow/v2/audio_config.proto
|
3
|
+
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
+
add_message "google.cloud.dialogflow.v2.VoiceSelectionParams" do
|
10
|
+
optional :name, :string, 1
|
11
|
+
optional :ssml_gender, :enum, 2, "google.cloud.dialogflow.v2.SsmlVoiceGender"
|
12
|
+
end
|
13
|
+
add_message "google.cloud.dialogflow.v2.SynthesizeSpeechConfig" do
|
14
|
+
optional :speaking_rate, :double, 1
|
15
|
+
optional :pitch, :double, 2
|
16
|
+
optional :volume_gain_db, :double, 3
|
17
|
+
repeated :effects_profile_id, :string, 5
|
18
|
+
optional :voice, :message, 4, "google.cloud.dialogflow.v2.VoiceSelectionParams"
|
19
|
+
end
|
20
|
+
add_message "google.cloud.dialogflow.v2.OutputAudioConfig" do
|
21
|
+
optional :audio_encoding, :enum, 1, "google.cloud.dialogflow.v2.OutputAudioEncoding"
|
22
|
+
optional :sample_rate_hertz, :int32, 2
|
23
|
+
optional :synthesize_speech_config, :message, 3, "google.cloud.dialogflow.v2.SynthesizeSpeechConfig"
|
24
|
+
end
|
25
|
+
add_enum "google.cloud.dialogflow.v2.SsmlVoiceGender" do
|
26
|
+
value :SSML_VOICE_GENDER_UNSPECIFIED, 0
|
27
|
+
value :SSML_VOICE_GENDER_MALE, 1
|
28
|
+
value :SSML_VOICE_GENDER_FEMALE, 2
|
29
|
+
value :SSML_VOICE_GENDER_NEUTRAL, 3
|
30
|
+
end
|
31
|
+
add_enum "google.cloud.dialogflow.v2.OutputAudioEncoding" do
|
32
|
+
value :OUTPUT_AUDIO_ENCODING_UNSPECIFIED, 0
|
33
|
+
value :OUTPUT_AUDIO_ENCODING_LINEAR_16, 1
|
34
|
+
value :OUTPUT_AUDIO_ENCODING_MP3, 2
|
35
|
+
value :OUTPUT_AUDIO_ENCODING_OGG_OPUS, 3
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
module Google
|
40
|
+
module Cloud
|
41
|
+
module Dialogflow
|
42
|
+
module V2
|
43
|
+
VoiceSelectionParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass
|
44
|
+
SynthesizeSpeechConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass
|
45
|
+
OutputAudioConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass
|
46
|
+
SsmlVoiceGender = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule
|
47
|
+
OutputAudioEncoding = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioEncoding").enummodule
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/cloud/dialogflow/v2/context.proto for package 'google.cloud.dialogflow.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2019 Google LLC.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,6 +15,7 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
+
#
|
18
19
|
|
19
20
|
|
20
21
|
require 'grpc'
|
@@ -37,11 +38,12 @@ module Google
|
|
37
38
|
# [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) request,
|
38
39
|
# or as output contexts included in the returned intent.
|
39
40
|
# Contexts expire when an intent is matched, after the number of `DetectIntent`
|
40
|
-
# requests specified by the `lifespan_count` parameter, or after
|
41
|
+
# requests specified by the `lifespan_count` parameter, or after 20 minutes
|
41
42
|
# if no intents are matched for a `DetectIntent` request.
|
42
43
|
#
|
43
44
|
# For more information about contexts, see the
|
44
|
-
# [Dialogflow
|
45
|
+
# [Dialogflow
|
46
|
+
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview).
|
45
47
|
class Service
|
46
48
|
|
47
49
|
include GRPC::GenericService
|
@@ -55,6 +57,8 @@ module Google
|
|
55
57
|
# Retrieves the specified context.
|
56
58
|
rpc :GetContext, GetContextRequest, Context
|
57
59
|
# Creates a context.
|
60
|
+
#
|
61
|
+
# If the specified context already exists, overrides the context.
|
58
62
|
rpc :CreateContext, CreateContextRequest, Context
|
59
63
|
# Updates the specified context.
|
60
64
|
rpc :UpdateContext, UpdateContextRequest, Context
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2019 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -44,11 +44,12 @@ module Google
|
|
44
44
|
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) request,
|
45
45
|
# or as output contexts included in the returned intent.
|
46
46
|
# Contexts expire when an intent is matched, after the number of `DetectIntent`
|
47
|
-
# requests specified by the `lifespan_count` parameter, or after
|
47
|
+
# requests specified by the `lifespan_count` parameter, or after 20 minutes
|
48
48
|
# if no intents are matched for a `DetectIntent` request.
|
49
49
|
#
|
50
50
|
# For more information about contexts, see the
|
51
|
-
# [Dialogflow
|
51
|
+
# [Dialogflow
|
52
|
+
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview).
|
52
53
|
#
|
53
54
|
# @!attribute [r] contexts_stub
|
54
55
|
# @return [Google::Cloud::Dialogflow::V2::Contexts::Stub]
|
@@ -79,32 +80,22 @@ module Google
|
|
79
80
|
# The scopes needed to make gRPC calls to all of the methods defined in
|
80
81
|
# this service.
|
81
82
|
ALL_SCOPES = [
|
82
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
83
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
84
|
+
"https://www.googleapis.com/auth/dialogflow"
|
83
85
|
].freeze
|
84
86
|
|
85
87
|
|
86
|
-
SESSION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
87
|
-
"projects/{project}/agent/sessions/{session}"
|
88
|
-
)
|
89
|
-
|
90
|
-
private_constant :SESSION_PATH_TEMPLATE
|
91
|
-
|
92
88
|
CONTEXT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
93
89
|
"projects/{project}/agent/sessions/{session}/contexts/{context}"
|
94
90
|
)
|
95
91
|
|
96
92
|
private_constant :CONTEXT_PATH_TEMPLATE
|
97
93
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
SESSION_PATH_TEMPLATE.render(
|
104
|
-
:"project" => project,
|
105
|
-
:"session" => session
|
106
|
-
)
|
107
|
-
end
|
94
|
+
SESSION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
95
|
+
"projects/{project}/agent/sessions/{session}"
|
96
|
+
)
|
97
|
+
|
98
|
+
private_constant :SESSION_PATH_TEMPLATE
|
108
99
|
|
109
100
|
# Returns a fully-qualified context resource name string.
|
110
101
|
# @param project [String]
|
@@ -119,6 +110,17 @@ module Google
|
|
119
110
|
)
|
120
111
|
end
|
121
112
|
|
113
|
+
# Returns a fully-qualified session resource name string.
|
114
|
+
# @param project [String]
|
115
|
+
# @param session [String]
|
116
|
+
# @return [String]
|
117
|
+
def self.session_path project, session
|
118
|
+
SESSION_PATH_TEMPLATE.render(
|
119
|
+
:"project" => project,
|
120
|
+
:"session" => session
|
121
|
+
)
|
122
|
+
end
|
123
|
+
|
122
124
|
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
123
125
|
# Provides the means for authenticating requests made by the client. This parameter can
|
124
126
|
# be many types.
|
@@ -225,32 +227,50 @@ module Google
|
|
225
227
|
@list_contexts = Google::Gax.create_api_call(
|
226
228
|
@contexts_stub.method(:list_contexts),
|
227
229
|
defaults["list_contexts"],
|
228
|
-
exception_transformer: exception_transformer
|
230
|
+
exception_transformer: exception_transformer,
|
231
|
+
params_extractor: proc do |request|
|
232
|
+
{'parent' => request.parent}
|
233
|
+
end
|
229
234
|
)
|
230
235
|
@get_context = Google::Gax.create_api_call(
|
231
236
|
@contexts_stub.method(:get_context),
|
232
237
|
defaults["get_context"],
|
233
|
-
exception_transformer: exception_transformer
|
238
|
+
exception_transformer: exception_transformer,
|
239
|
+
params_extractor: proc do |request|
|
240
|
+
{'name' => request.name}
|
241
|
+
end
|
234
242
|
)
|
235
243
|
@create_context = Google::Gax.create_api_call(
|
236
244
|
@contexts_stub.method(:create_context),
|
237
245
|
defaults["create_context"],
|
238
|
-
exception_transformer: exception_transformer
|
246
|
+
exception_transformer: exception_transformer,
|
247
|
+
params_extractor: proc do |request|
|
248
|
+
{'parent' => request.parent}
|
249
|
+
end
|
239
250
|
)
|
240
251
|
@update_context = Google::Gax.create_api_call(
|
241
252
|
@contexts_stub.method(:update_context),
|
242
253
|
defaults["update_context"],
|
243
|
-
exception_transformer: exception_transformer
|
254
|
+
exception_transformer: exception_transformer,
|
255
|
+
params_extractor: proc do |request|
|
256
|
+
{'context.name' => request.context.name}
|
257
|
+
end
|
244
258
|
)
|
245
259
|
@delete_context = Google::Gax.create_api_call(
|
246
260
|
@contexts_stub.method(:delete_context),
|
247
261
|
defaults["delete_context"],
|
248
|
-
exception_transformer: exception_transformer
|
262
|
+
exception_transformer: exception_transformer,
|
263
|
+
params_extractor: proc do |request|
|
264
|
+
{'name' => request.name}
|
265
|
+
end
|
249
266
|
)
|
250
267
|
@delete_all_contexts = Google::Gax.create_api_call(
|
251
268
|
@contexts_stub.method(:delete_all_contexts),
|
252
269
|
defaults["delete_all_contexts"],
|
253
|
-
exception_transformer: exception_transformer
|
270
|
+
exception_transformer: exception_transformer,
|
271
|
+
params_extractor: proc do |request|
|
272
|
+
{'parent' => request.parent}
|
273
|
+
end
|
254
274
|
)
|
255
275
|
end
|
256
276
|
|
@@ -344,6 +364,8 @@ module Google
|
|
344
364
|
|
345
365
|
# Creates a context.
|
346
366
|
#
|
367
|
+
# If the specified context already exists, overrides the context.
|
368
|
+
#
|
347
369
|
# @param parent [String]
|
348
370
|
# Required. The session to create a context for.
|
349
371
|
# Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2019 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -21,7 +21,8 @@ module Google
|
|
21
21
|
module V2
|
22
22
|
class Credentials < Google::Auth::Credentials
|
23
23
|
SCOPE = [
|
24
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
24
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
25
|
+
"https://www.googleapis.com/auth/dialogflow"
|
25
26
|
].freeze
|
26
27
|
PATH_ENV_VARS = %w(DIALOGFLOW_CREDENTIALS
|
27
28
|
DIALOGFLOW_KEYFILE
|