google-cloud-dialogflow-v2 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +70 -2
  4. data/lib/google/cloud/dialogflow/v2.rb +11 -2
  5. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +24 -39
  6. data/lib/google/cloud/dialogflow/v2/agents.rb +1 -28
  7. data/lib/google/cloud/dialogflow/v2/agents/client.rb +41 -100
  8. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +98 -11
  9. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +49 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records.rb +50 -0
  12. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +479 -0
  13. data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
  14. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
  15. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
  16. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +7 -24
  17. data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
  18. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +24 -63
  19. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +2 -2
  20. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +205 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
  29. data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
  31. data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
  33. data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
  34. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
  35. data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
  40. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +11 -38
  41. data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
  42. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +28 -91
  43. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +98 -11
  44. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +2 -2
  45. data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
  46. data/lib/google/cloud/dialogflow/v2/environments/client.rb +19 -13
  47. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
  48. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
  49. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  50. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +8 -39
  51. data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
  52. data/lib/google/cloud/dialogflow/v2/intents/client.rb +25 -80
  53. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +98 -11
  54. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +1 -1
  55. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
  56. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
  57. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
  58. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
  59. data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
  60. data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
  61. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +172 -0
  62. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
  63. data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
  64. data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
  65. data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
  66. data/lib/google/cloud/dialogflow/v2/participants/paths.rb +258 -0
  67. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +6 -22
  68. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
  69. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +23 -53
  70. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +2 -2
  71. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  72. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +14 -6
  73. data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
  74. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +51 -15
  75. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +3 -3
  76. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  77. data/proto_docs/google/api/field_behavior.rb +6 -0
  78. data/proto_docs/google/api/resource.rb +50 -14
  79. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +9 -1
  80. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +259 -0
  81. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
  82. data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
  83. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
  84. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
  85. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +510 -0
  86. data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
  87. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
  88. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +18 -1
  89. data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
  90. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +20 -3
  91. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
  92. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +503 -0
  93. data/proto_docs/google/cloud/dialogflow/v2/session.rb +52 -7
  94. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
  95. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  96. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
  97. data/proto_docs/google/longrunning/operations.rb +17 -3
  98. data/proto_docs/google/protobuf/any.rb +5 -2
  99. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  100. data/proto_docs/google/type/latlng.rb +2 -2
  101. metadata +59 -10
  102. data/lib/google/cloud/common_resources_pb.rb +0 -15
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Dialogflow
24
+ module V2
25
+ module Participants
26
+ # Credentials for the Participants API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/dialogflow"
31
+ ]
32
+ self.env_vars = [
33
+ "DIALOGFLOW_CREDENTIALS",
34
+ "DIALOGFLOW_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "DIALOGFLOW_CREDENTIALS_JSON",
39
+ "DIALOGFLOW_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,258 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dialogflow
23
+ module V2
24
+ module Participants
25
+ # Path helper methods for the Participants API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Context resource string.
29
+ #
30
+ # @overload context_path(project:, session:, context:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/agent/sessions/{session}/contexts/{context}`
34
+ #
35
+ # @param project [String]
36
+ # @param session [String]
37
+ # @param context [String]
38
+ #
39
+ # @overload context_path(project:, environment:, user:, session:, context:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}`
43
+ #
44
+ # @param project [String]
45
+ # @param environment [String]
46
+ # @param user [String]
47
+ # @param session [String]
48
+ # @param context [String]
49
+ #
50
+ # @return [::String]
51
+ def context_path **args
52
+ resources = {
53
+ "context:project:session" => (proc do |project:, session:, context:|
54
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
55
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
56
+
57
+ "projects/#{project}/agent/sessions/#{session}/contexts/#{context}"
58
+ end),
59
+ "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:|
60
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
61
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
62
+ raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
63
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
64
+
65
+ "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
66
+ end)
67
+ }
68
+
69
+ resource = resources[args.keys.sort.join(":")]
70
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
71
+ resource.call(**args)
72
+ end
73
+
74
+ ##
75
+ # Create a fully-qualified Conversation resource string.
76
+ #
77
+ # @overload conversation_path(project:, conversation:)
78
+ # The resource will be in the following format:
79
+ #
80
+ # `projects/{project}/conversations/{conversation}`
81
+ #
82
+ # @param project [String]
83
+ # @param conversation [String]
84
+ #
85
+ # @overload conversation_path(project:, location:, conversation:)
86
+ # The resource will be in the following format:
87
+ #
88
+ # `projects/{project}/locations/{location}/conversations/{conversation}`
89
+ #
90
+ # @param project [String]
91
+ # @param location [String]
92
+ # @param conversation [String]
93
+ #
94
+ # @return [::String]
95
+ def conversation_path **args
96
+ resources = {
97
+ "conversation:project" => (proc do |project:, conversation:|
98
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
99
+
100
+ "projects/#{project}/conversations/#{conversation}"
101
+ end),
102
+ "conversation:location:project" => (proc do |project:, location:, conversation:|
103
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
104
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
105
+
106
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}"
107
+ end)
108
+ }
109
+
110
+ resource = resources[args.keys.sort.join(":")]
111
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
112
+ resource.call(**args)
113
+ end
114
+
115
+ ##
116
+ # Create a fully-qualified Message resource string.
117
+ #
118
+ # @overload message_path(project:, conversation:, message:)
119
+ # The resource will be in the following format:
120
+ #
121
+ # `projects/{project}/conversations/{conversation}/messages/{message}`
122
+ #
123
+ # @param project [String]
124
+ # @param conversation [String]
125
+ # @param message [String]
126
+ #
127
+ # @overload message_path(project:, location:, conversation:, message:)
128
+ # The resource will be in the following format:
129
+ #
130
+ # `projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}`
131
+ #
132
+ # @param project [String]
133
+ # @param location [String]
134
+ # @param conversation [String]
135
+ # @param message [String]
136
+ #
137
+ # @return [::String]
138
+ def message_path **args
139
+ resources = {
140
+ "conversation:message:project" => (proc do |project:, conversation:, message:|
141
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
142
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
143
+
144
+ "projects/#{project}/conversations/#{conversation}/messages/#{message}"
145
+ end),
146
+ "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:|
147
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
148
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
149
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
150
+
151
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}"
152
+ end)
153
+ }
154
+
155
+ resource = resources[args.keys.sort.join(":")]
156
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
157
+ resource.call(**args)
158
+ end
159
+
160
+ ##
161
+ # Create a fully-qualified Participant resource string.
162
+ #
163
+ # @overload participant_path(project:, conversation:, participant:)
164
+ # The resource will be in the following format:
165
+ #
166
+ # `projects/{project}/conversations/{conversation}/participants/{participant}`
167
+ #
168
+ # @param project [String]
169
+ # @param conversation [String]
170
+ # @param participant [String]
171
+ #
172
+ # @overload participant_path(project:, location:, conversation:, participant:)
173
+ # The resource will be in the following format:
174
+ #
175
+ # `projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}`
176
+ #
177
+ # @param project [String]
178
+ # @param location [String]
179
+ # @param conversation [String]
180
+ # @param participant [String]
181
+ #
182
+ # @return [::String]
183
+ def participant_path **args
184
+ resources = {
185
+ "conversation:participant:project" => (proc do |project:, conversation:, participant:|
186
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
187
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
188
+
189
+ "projects/#{project}/conversations/#{conversation}/participants/#{participant}"
190
+ end),
191
+ "conversation:location:participant:project" => (proc do |project:, location:, conversation:, participant:|
192
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
193
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
194
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
195
+
196
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}/participants/#{participant}"
197
+ end)
198
+ }
199
+
200
+ resource = resources[args.keys.sort.join(":")]
201
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
202
+ resource.call(**args)
203
+ end
204
+
205
+ ##
206
+ # Create a fully-qualified SessionEntityType resource string.
207
+ #
208
+ # @overload session_entity_type_path(project:, session:, entity_type:)
209
+ # The resource will be in the following format:
210
+ #
211
+ # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}`
212
+ #
213
+ # @param project [String]
214
+ # @param session [String]
215
+ # @param entity_type [String]
216
+ #
217
+ # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:)
218
+ # The resource will be in the following format:
219
+ #
220
+ # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}`
221
+ #
222
+ # @param project [String]
223
+ # @param environment [String]
224
+ # @param user [String]
225
+ # @param session [String]
226
+ # @param entity_type [String]
227
+ #
228
+ # @return [::String]
229
+ def session_entity_type_path **args
230
+ resources = {
231
+ "entity_type:project:session" => (proc do |project:, session:, entity_type:|
232
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
233
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
234
+
235
+ "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}"
236
+ end),
237
+ "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:|
238
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
239
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
240
+ raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
241
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
242
+
243
+ "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
244
+ end)
245
+ }
246
+
247
+ resource = resources[args.keys.sort.join(":")]
248
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
249
+ resource.call(**args)
250
+ end
251
+
252
+ extend self
253
+ end
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
@@ -24,23 +24,7 @@ module Google
24
24
  module Dialogflow
25
25
  module V2
26
26
  module SessionEntityTypes
27
- # Entities are extracted from user input and represent parameters that are
28
- # meaningful to your application. For example, a date range, a proper name
29
- # such as a geographic location or landmark, and so on. Entities represent
30
- # actionable data for your application.
31
- #
32
- # Session entity types are referred to as **User** entity types and are
33
- # entities that are built for an individual user such as
34
- # favorites, preferences, playlists, and so on. You can redefine a session
35
- # entity type at the session level.
36
- #
37
- # Session entity methods do not work with Google Assistant integration.
38
- # Contact Dialogflow support if you need to use session entities
39
- # with Google Assistant integration.
40
- #
41
- # For more information about entity types, see the
42
- # [Dialogflow
43
- # documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
27
+ # Service for managing [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType].
44
28
  class Service
45
29
 
46
30
  include GRPC::GenericService
@@ -54,13 +38,13 @@ module Google
54
38
  # This method doesn't work with Google Assistant integration.
55
39
  # Contact Dialogflow support if you need to use session entities
56
40
  # with Google Assistant integration.
57
- rpc :ListSessionEntityTypes, ListSessionEntityTypesRequest, ListSessionEntityTypesResponse
41
+ rpc :ListSessionEntityTypes, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse
58
42
  # Retrieves the specified session entity type.
59
43
  #
60
44
  # This method doesn't work with Google Assistant integration.
61
45
  # Contact Dialogflow support if you need to use session entities
62
46
  # with Google Assistant integration.
63
- rpc :GetSessionEntityType, GetSessionEntityTypeRequest, SessionEntityType
47
+ rpc :GetSessionEntityType, ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType
64
48
  # Creates a session entity type.
65
49
  #
66
50
  # If the specified session entity type already exists, overrides the session
@@ -69,19 +53,19 @@ module Google
69
53
  # This method doesn't work with Google Assistant integration.
70
54
  # Contact Dialogflow support if you need to use session entities
71
55
  # with Google Assistant integration.
72
- rpc :CreateSessionEntityType, CreateSessionEntityTypeRequest, SessionEntityType
56
+ rpc :CreateSessionEntityType, ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType
73
57
  # Updates the specified session entity type.
74
58
  #
75
59
  # This method doesn't work with Google Assistant integration.
76
60
  # Contact Dialogflow support if you need to use session entities
77
61
  # with Google Assistant integration.
78
- rpc :UpdateSessionEntityType, UpdateSessionEntityTypeRequest, SessionEntityType
62
+ rpc :UpdateSessionEntityType, ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType
79
63
  # Deletes the specified session entity type.
80
64
  #
81
65
  # This method doesn't work with Google Assistant integration.
82
66
  # Contact Dialogflow support if you need to use session entities
83
67
  # with Google Assistant integration.
84
- rpc :DeleteSessionEntityType, DeleteSessionEntityTypeRequest, Google::Protobuf::Empty
68
+ rpc :DeleteSessionEntityType, ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Google::Protobuf::Empty
85
69
  end
86
70
 
87
71
  Stub = Service.rpc_stub_class
@@ -31,23 +31,7 @@ module Google
31
31
  module Dialogflow
32
32
  module V2
33
33
  ##
34
- # Entities are extracted from user input and represent parameters that are
35
- # meaningful to your application. For example, a date range, a proper name
36
- # such as a geographic location or landmark, and so on. Entities represent
37
- # actionable data for your application.
38
- #
39
- # Session entity types are referred to as **User** entity types and are
40
- # entities that are built for an individual user such as
41
- # favorites, preferences, playlists, and so on. You can redefine a session
42
- # entity type at the session level.
43
- #
44
- # Session entity methods do not work with Google Assistant integration.
45
- # Contact Dialogflow support if you need to use session entities
46
- # with Google Assistant integration.
47
- #
48
- # For more information about entity types, see the
49
- # [Dialogflow
50
- # documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
34
+ # Service for managing {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}.
51
35
  #
52
36
  # To load this service and instantiate a client:
53
37
  #
@@ -27,23 +27,7 @@ module Google
27
27
  ##
28
28
  # Client for the SessionEntityTypes service.
29
29
  #
30
- # Entities are extracted from user input and represent parameters that are
31
- # meaningful to your application. For example, a date range, a proper name
32
- # such as a geographic location or landmark, and so on. Entities represent
33
- # actionable data for your application.
34
- #
35
- # Session entity types are referred to as **User** entity types and are
36
- # entities that are built for an individual user such as
37
- # favorites, preferences, playlists, and so on. You can redefine a session
38
- # entity type at the session level.
39
- #
40
- # Session entity methods do not work with Google Assistant integration.
41
- # Contact Dialogflow support if you need to use session entities
42
- # with Google Assistant integration.
43
- #
44
- # For more information about entity types, see the
45
- # [Dialogflow
46
- # documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
30
+ # Service for managing {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}.
47
31
  #
48
32
  class Client
49
33
  include Paths
@@ -76,37 +60,17 @@ module Google
76
60
  parent_config = while namespace.any?
77
61
  parent_name = namespace.join "::"
78
62
  parent_const = const_get parent_name
79
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
80
64
  namespace.pop
81
65
  end
82
66
  default_config = Client::Configuration.new parent_config
83
67
 
84
- default_config.rpcs.list_session_entity_types.timeout = 60.0
85
- default_config.rpcs.list_session_entity_types.retry_policy = {
86
- initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
90
- }
91
-
92
- default_config.rpcs.get_session_entity_type.timeout = 60.0
93
- default_config.rpcs.get_session_entity_type.retry_policy = {
94
- initial_delay: 0.1,
95
- max_delay: 60.0,
96
- multiplier: 1.3,
97
- retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
98
- }
99
-
100
- default_config.rpcs.create_session_entity_type.timeout = 60.0
101
-
102
- default_config.rpcs.update_session_entity_type.timeout = 60.0
103
-
104
- default_config.rpcs.delete_session_entity_type.timeout = 60.0
105
- default_config.rpcs.delete_session_entity_type.retry_policy = {
68
+ default_config.timeout = 60.0
69
+ default_config.retry_policy = {
106
70
  initial_delay: 0.1,
107
- max_delay: 60.0,
108
- multiplier: 1.3,
109
- retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [14]
110
74
  }
111
75
 
112
76
  default_config
@@ -170,7 +134,13 @@ module Google
170
134
 
171
135
  # Create credentials
172
136
  credentials = @config.credentials
173
- credentials ||= Credentials.default scope: @config.scope
137
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
+ @config.endpoint == Client.configure.endpoint &&
141
+ !@config.endpoint.split(".").first.include?("-")
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
174
144
  if credentials.is_a?(String) || credentials.is_a?(Hash)
175
145
  credentials = Credentials.new credentials, scope: @config.scope
176
146
  end
@@ -658,14 +628,14 @@ module Google
658
628
 
659
629
  config_attr :endpoint, "dialogflow.googleapis.com", ::String
660
630
  config_attr :credentials, nil do |value|
661
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
631
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
662
632
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
663
633
  allowed.any? { |klass| klass === value }
664
634
  end
665
635
  config_attr :scope, nil, ::String, ::Array, nil
666
636
  config_attr :lib_name, nil, ::String, nil
667
637
  config_attr :lib_version, nil, ::String, nil
668
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
638
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
669
639
  config_attr :interceptors, nil, ::Array, nil
670
640
  config_attr :timeout, nil, ::Numeric, nil
671
641
  config_attr :metadata, nil, ::Hash, nil
@@ -686,7 +656,7 @@ module Google
686
656
  def rpcs
687
657
  @rpcs ||= begin
688
658
  parent_rpcs = nil
689
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
659
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
690
660
  Rpcs.new parent_rpcs
691
661
  end
692
662
  end
@@ -698,7 +668,7 @@ module Google
698
668
  # Each configuration object is of type `Gapic::Config::Method` and includes
699
669
  # the following configuration fields:
700
670
  #
701
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
671
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
702
672
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
703
673
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
704
674
  # include the following keys:
@@ -737,15 +707,15 @@ module Google
737
707
 
738
708
  # @private
739
709
  def initialize parent_rpcs = nil
740
- list_session_entity_types_config = parent_rpcs&.list_session_entity_types if parent_rpcs&.respond_to? :list_session_entity_types
710
+ list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types
741
711
  @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config
742
- get_session_entity_type_config = parent_rpcs&.get_session_entity_type if parent_rpcs&.respond_to? :get_session_entity_type
712
+ get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type
743
713
  @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config
744
- create_session_entity_type_config = parent_rpcs&.create_session_entity_type if parent_rpcs&.respond_to? :create_session_entity_type
714
+ create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type
745
715
  @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config
746
- update_session_entity_type_config = parent_rpcs&.update_session_entity_type if parent_rpcs&.respond_to? :update_session_entity_type
716
+ update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type
747
717
  @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config
748
- delete_session_entity_type_config = parent_rpcs&.delete_session_entity_type if parent_rpcs&.respond_to? :delete_session_entity_type
718
+ delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type
749
719
  @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config
750
720
 
751
721
  yield self if block_given?