google-cloud-dialogflow-v2 0.7.0 → 0.10.1
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/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/dialogflow/v2.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +16 -5
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +18 -10
- data/lib/google/cloud/dialogflow/v2/agents/operations.rb +4 -4
- data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
- data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +1 -2
- data/lib/google/cloud/dialogflow/v2/answer_records.rb +1 -2
- data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +3 -7
- data/lib/google/cloud/dialogflow/v2/contexts/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +72 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +44 -3
- data/lib/google/cloud/dialogflow/v2/conversations/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/documents/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/documents/operations.rb +4 -4
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +28 -7
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +30 -12
- data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +4 -4
- data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
- data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
- data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +21 -0
- data/lib/google/cloud/dialogflow/v2/environments/client.rb +413 -6
- data/lib/google/cloud/dialogflow/v2/environments/paths.rb +145 -5
- data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +457 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +20 -2
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +31 -8
- data/lib/google/cloud/dialogflow/v2/intents/operations.rb +4 -4
- data/lib/google/cloud/dialogflow/v2/intents/paths.rb +96 -12
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/participant_pb.rb +9 -0
- data/lib/google/cloud/dialogflow/v2/participants/client.rb +3 -9
- data/lib/google/cloud/dialogflow/v2/participants/paths.rb +76 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +2 -5
- data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +72 -0
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/v2/sessions/client.rb +3 -9
- data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +110 -0
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/versions/client.rb +706 -0
- data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +9 -16
- data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +14 -2
- data/proto_docs/google/cloud/dialogflow/v2/environment.rb +170 -5
- data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
- data/proto_docs/google/cloud/dialogflow/v2/intent.rb +9 -1
- data/proto_docs/google/cloud/dialogflow/v2/participant.rb +22 -0
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
- metadata +27 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c023c07476d29e91e2b3f6e943f5e6a0deecdea280e661fe0c469ce4cfe0cac4
|
4
|
+
data.tar.gz: 77d7d8f0136cec992efc97f5f228501bd1a7343010caa7285b09ae1e04245e88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e23ef0fdbc073fff3d268e9e16cb43583efeb8e62612187f30fd54ec9d7551cff324478535842c6d2995fe422773651bbe57da5612fe73ec38ca9013b3f78b9
|
7
|
+
data.tar.gz: 6837388b581f23b0049114ed4667500050a770e177fd2eef4bc029f011e2ce0d15fd63e2f2b67edd075e7bc18a25e4d4d0b529cba75fe303689b44ef620303c0
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-dialogflow-v2
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Dialogflow::V2::Agents::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `DIALOGFLOW_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `DIALOGFLOW_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/dialogflow/v2"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/dialogflow/v2"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/dialogflow/v2"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/dialogflow/v2"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.get_agent request
|
38
38
|
```
|
39
39
|
|
@@ -27,8 +27,10 @@ require "google/cloud/dialogflow/v2/answer_records"
|
|
27
27
|
require "google/cloud/dialogflow/v2/conversations"
|
28
28
|
require "google/cloud/dialogflow/v2/conversation_profiles"
|
29
29
|
require "google/cloud/dialogflow/v2/documents"
|
30
|
+
require "google/cloud/dialogflow/v2/fulfillments"
|
30
31
|
require "google/cloud/dialogflow/v2/environments"
|
31
32
|
require "google/cloud/dialogflow/v2/knowledge_bases"
|
33
|
+
require "google/cloud/dialogflow/v2/versions"
|
32
34
|
require "google/cloud/dialogflow/v2/version"
|
33
35
|
|
34
36
|
module Google
|
@@ -36,6 +36,10 @@ module Google
|
|
36
36
|
# Retrieves the specified agent.
|
37
37
|
rpc :GetAgent, ::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent
|
38
38
|
# Creates/updates the specified agent.
|
39
|
+
#
|
40
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
41
|
+
# [training
|
42
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
39
43
|
rpc :SetAgent, ::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent
|
40
44
|
# Deletes the specified agent.
|
41
45
|
rpc :DeleteAgent, ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Google::Protobuf::Empty
|
@@ -49,11 +53,12 @@ module Google
|
|
49
53
|
rpc :SearchAgents, ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse
|
50
54
|
# Trains the specified agent.
|
51
55
|
#
|
52
|
-
#
|
56
|
+
#
|
57
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
58
|
+
# [training
|
59
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
53
60
|
rpc :TrainAgent, ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Google::Longrunning::Operation
|
54
61
|
# Exports the specified agent to a ZIP file.
|
55
|
-
#
|
56
|
-
# Operation <response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]>
|
57
62
|
rpc :ExportAgent, ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Google::Longrunning::Operation
|
58
63
|
# Imports the specified agent from a ZIP file.
|
59
64
|
#
|
@@ -65,9 +70,12 @@ module Google
|
|
65
70
|
# call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it returns in order to train
|
66
71
|
# explicitly.
|
67
72
|
#
|
68
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
69
73
|
# An operation which tracks when importing is complete. It only tracks
|
70
74
|
# when the draft agent is updated not when it is done training.
|
75
|
+
#
|
76
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
77
|
+
# [training
|
78
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
71
79
|
rpc :ImportAgent, ::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Google::Longrunning::Operation
|
72
80
|
# Restores the specified agent from a ZIP file.
|
73
81
|
#
|
@@ -78,9 +86,12 @@ module Google
|
|
78
86
|
# completed yet. Please call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it
|
79
87
|
# returns in order to train explicitly.
|
80
88
|
#
|
81
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
82
89
|
# An operation which tracks when restoring is complete. It only tracks
|
83
90
|
# when the draft agent is updated not when it is done training.
|
91
|
+
#
|
92
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
93
|
+
# [training
|
94
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
84
95
|
rpc :RestoreAgent, ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Google::Longrunning::Operation
|
85
96
|
# Gets agent validation result. Agent validation is performed during
|
86
97
|
# training time and is updated automatically when training is completed.
|
@@ -67,10 +67,7 @@ module Google
|
|
67
67
|
|
68
68
|
default_config.timeout = 60.0
|
69
69
|
default_config.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [14]
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
74
71
|
}
|
75
72
|
|
76
73
|
default_config
|
@@ -141,7 +138,7 @@ module Google
|
|
141
138
|
!@config.endpoint.split(".").first.include?("-")
|
142
139
|
credentials ||= Credentials.default scope: @config.scope,
|
143
140
|
enable_self_signed_jwt: enable_self_signed_jwt
|
144
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
141
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
145
142
|
credentials = Credentials.new credentials, scope: @config.scope
|
146
143
|
end
|
147
144
|
@quota_project_id = @config.quota_project
|
@@ -240,6 +237,10 @@ module Google
|
|
240
237
|
##
|
241
238
|
# Creates/updates the specified agent.
|
242
239
|
#
|
240
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
241
|
+
# [training
|
242
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
243
|
+
#
|
243
244
|
# @overload set_agent(request, options = nil)
|
244
245
|
# Pass arguments to `set_agent` via a request object, either of type
|
245
246
|
# {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash.
|
@@ -454,7 +455,10 @@ module Google
|
|
454
455
|
##
|
455
456
|
# Trains the specified agent.
|
456
457
|
#
|
457
|
-
#
|
458
|
+
#
|
459
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
460
|
+
# [training
|
461
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
458
462
|
#
|
459
463
|
# @overload train_agent(request, options = nil)
|
460
464
|
# Pass arguments to `train_agent` via a request object, either of type
|
@@ -524,8 +528,6 @@ module Google
|
|
524
528
|
##
|
525
529
|
# Exports the specified agent to a ZIP file.
|
526
530
|
#
|
527
|
-
# Operation <response: {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}>
|
528
|
-
#
|
529
531
|
# @overload export_agent(request, options = nil)
|
530
532
|
# Pass arguments to `export_agent` via a request object, either of type
|
531
533
|
# {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash.
|
@@ -607,10 +609,13 @@ module Google
|
|
607
609
|
# call {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the operation it returns in order to train
|
608
610
|
# explicitly.
|
609
611
|
#
|
610
|
-
# Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
|
611
612
|
# An operation which tracks when importing is complete. It only tracks
|
612
613
|
# when the draft agent is updated not when it is done training.
|
613
614
|
#
|
615
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
616
|
+
# [training
|
617
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
618
|
+
#
|
614
619
|
# @overload import_agent(request, options = nil)
|
615
620
|
# Pass arguments to `import_agent` via a request object, either of type
|
616
621
|
# {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash.
|
@@ -691,10 +696,13 @@ module Google
|
|
691
696
|
# completed yet. Please call {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the operation it
|
692
697
|
# returns in order to train explicitly.
|
693
698
|
#
|
694
|
-
# Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
|
695
699
|
# An operation which tracks when restoring is complete. It only tracks
|
696
700
|
# when the draft agent is updated not when it is done training.
|
697
701
|
#
|
702
|
+
# Note: You should always train an agent prior to sending it queries. See the
|
703
|
+
# [training
|
704
|
+
# documentation](https://cloud.google.com/dialogflow/es/docs/training).
|
705
|
+
#
|
698
706
|
# @overload restore_agent(request, options = nil)
|
699
707
|
# Pass arguments to `restore_agent` via a request object, either of type
|
700
708
|
# {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash.
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -396,9 +396,9 @@ module Google
|
|
396
396
|
end
|
397
397
|
|
398
398
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
399
|
+
# Waits until the specified long-running operation is done or reaches at most
|
400
|
+
# a specified timeout, returning the latest state. If the operation is
|
401
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
402
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
403
|
# timeout is used. If the server does not support this method, it returns
|
404
404
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -27,15 +27,54 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Create a fully-qualified Agent resource string.
|
29
29
|
#
|
30
|
+
# @overload agent_path(project:)
|
31
|
+
# The resource will be in the following format:
|
32
|
+
#
|
33
|
+
# `projects/{project}/agent`
|
34
|
+
#
|
35
|
+
# @param project [String]
|
36
|
+
#
|
37
|
+
# @overload agent_path(project:, location:)
|
38
|
+
# The resource will be in the following format:
|
39
|
+
#
|
40
|
+
# `projects/{project}/locations/{location}/agent`
|
41
|
+
#
|
42
|
+
# @param project [String]
|
43
|
+
# @param location [String]
|
44
|
+
#
|
45
|
+
# @return [::String]
|
46
|
+
def agent_path **args
|
47
|
+
resources = {
|
48
|
+
"project" => (proc do |project:|
|
49
|
+
"projects/#{project}/agent"
|
50
|
+
end),
|
51
|
+
"location:project" => (proc do |project:, location:|
|
52
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
53
|
+
|
54
|
+
"projects/#{project}/locations/#{location}/agent"
|
55
|
+
end)
|
56
|
+
}
|
57
|
+
|
58
|
+
resource = resources[args.keys.sort.join(":")]
|
59
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
60
|
+
resource.call(**args)
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# Create a fully-qualified Location resource string.
|
65
|
+
#
|
30
66
|
# The resource will be in the following format:
|
31
67
|
#
|
32
|
-
# `projects/{project}/
|
68
|
+
# `projects/{project}/locations/{location}`
|
33
69
|
#
|
34
70
|
# @param project [String]
|
71
|
+
# @param location [String]
|
35
72
|
#
|
36
73
|
# @return [::String]
|
37
|
-
def
|
38
|
-
"
|
74
|
+
def location_path project:, location:
|
75
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
76
|
+
|
77
|
+
"projects/#{project}/locations/#{location}"
|
39
78
|
end
|
40
79
|
|
41
80
|
##
|
@@ -24,8 +24,7 @@ module Google
|
|
24
24
|
module Dialogflow
|
25
25
|
module V2
|
26
26
|
module AnswerRecords
|
27
|
-
# Service for managing
|
28
|
-
# [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord].
|
27
|
+
# Service for managing [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord].
|
29
28
|
class Service
|
30
29
|
|
31
30
|
include GRPC::GenericService
|
@@ -31,8 +31,7 @@ module Google
|
|
31
31
|
module Dialogflow
|
32
32
|
module V2
|
33
33
|
##
|
34
|
-
# Service for managing
|
35
|
-
# {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}.
|
34
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}.
|
36
35
|
#
|
37
36
|
# To load this service and instantiate a client:
|
38
37
|
#
|
@@ -27,8 +27,7 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the AnswerRecords service.
|
29
29
|
#
|
30
|
-
# Service for managing
|
31
|
-
# {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}.
|
30
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}.
|
32
31
|
#
|
33
32
|
class Client
|
34
33
|
include Paths
|
@@ -68,10 +67,7 @@ module Google
|
|
68
67
|
|
69
68
|
default_config.timeout = 60.0
|
70
69
|
default_config.retry_policy = {
|
71
|
-
initial_delay: 0.1,
|
72
|
-
max_delay: 60.0,
|
73
|
-
multiplier: 1.3,
|
74
|
-
retry_codes: [14]
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
75
71
|
}
|
76
72
|
|
77
73
|
default_config
|
@@ -142,7 +138,7 @@ module Google
|
|
142
138
|
!@config.endpoint.split(".").first.include?("-")
|
143
139
|
credentials ||= Credentials.default scope: @config.scope,
|
144
140
|
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
141
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
142
|
credentials = Credentials.new credentials, scope: @config.scope
|
147
143
|
end
|
148
144
|
@quota_project_id = @config.quota_project
|
@@ -67,10 +67,7 @@ module Google
|
|
67
67
|
|
68
68
|
default_config.timeout = 60.0
|
69
69
|
default_config.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [14]
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
74
71
|
}
|
75
72
|
|
76
73
|
default_config
|
@@ -141,7 +138,7 @@ module Google
|
|
141
138
|
!@config.endpoint.split(".").first.include?("-")
|
142
139
|
credentials ||= Credentials.default scope: @config.scope,
|
143
140
|
enable_self_signed_jwt: enable_self_signed_jwt
|
144
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
141
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
145
142
|
credentials = Credentials.new credentials, scope: @config.scope
|
146
143
|
end
|
147
144
|
@quota_project_id = @config.quota_project
|
@@ -47,6 +47,28 @@ module Google
|
|
47
47
|
# @param session [String]
|
48
48
|
# @param context [String]
|
49
49
|
#
|
50
|
+
# @overload context_path(project:, location:, session:, context:)
|
51
|
+
# The resource will be in the following format:
|
52
|
+
#
|
53
|
+
# `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}`
|
54
|
+
#
|
55
|
+
# @param project [String]
|
56
|
+
# @param location [String]
|
57
|
+
# @param session [String]
|
58
|
+
# @param context [String]
|
59
|
+
#
|
60
|
+
# @overload context_path(project:, location:, environment:, user:, session:, context:)
|
61
|
+
# The resource will be in the following format:
|
62
|
+
#
|
63
|
+
# `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}`
|
64
|
+
#
|
65
|
+
# @param project [String]
|
66
|
+
# @param location [String]
|
67
|
+
# @param environment [String]
|
68
|
+
# @param user [String]
|
69
|
+
# @param session [String]
|
70
|
+
# @param context [String]
|
71
|
+
#
|
50
72
|
# @return [::String]
|
51
73
|
def context_path **args
|
52
74
|
resources = {
|
@@ -63,6 +85,22 @@ module Google
|
|
63
85
|
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
64
86
|
|
65
87
|
"projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
|
88
|
+
end),
|
89
|
+
"context:location:project:session" => (proc do |project:, location:, session:, context:|
|
90
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
91
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
92
|
+
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
93
|
+
|
94
|
+
"projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}"
|
95
|
+
end),
|
96
|
+
"context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:|
|
97
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
98
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
99
|
+
raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
|
100
|
+
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
101
|
+
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
102
|
+
|
103
|
+
"projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
|
66
104
|
end)
|
67
105
|
}
|
68
106
|
|
@@ -92,6 +130,26 @@ module Google
|
|
92
130
|
# @param user [String]
|
93
131
|
# @param session [String]
|
94
132
|
#
|
133
|
+
# @overload session_path(project:, location:, session:)
|
134
|
+
# The resource will be in the following format:
|
135
|
+
#
|
136
|
+
# `projects/{project}/locations/{location}/agent/sessions/{session}`
|
137
|
+
#
|
138
|
+
# @param project [String]
|
139
|
+
# @param location [String]
|
140
|
+
# @param session [String]
|
141
|
+
#
|
142
|
+
# @overload session_path(project:, location:, environment:, user:, session:)
|
143
|
+
# The resource will be in the following format:
|
144
|
+
#
|
145
|
+
# `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}`
|
146
|
+
#
|
147
|
+
# @param project [String]
|
148
|
+
# @param location [String]
|
149
|
+
# @param environment [String]
|
150
|
+
# @param user [String]
|
151
|
+
# @param session [String]
|
152
|
+
#
|
95
153
|
# @return [::String]
|
96
154
|
def session_path **args
|
97
155
|
resources = {
|
@@ -106,6 +164,20 @@ module Google
|
|
106
164
|
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
107
165
|
|
108
166
|
"projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
|
167
|
+
end),
|
168
|
+
"location:project:session" => (proc do |project:, location:, session:|
|
169
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
170
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
171
|
+
|
172
|
+
"projects/#{project}/locations/#{location}/agent/sessions/#{session}"
|
173
|
+
end),
|
174
|
+
"environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:|
|
175
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
176
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
177
|
+
raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
|
178
|
+
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
179
|
+
|
180
|
+
"projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
|
109
181
|
end)
|
110
182
|
}
|
111
183
|
|