google-cloud-dialogflow-v2 0.22.0 → 0.23.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/README.md +1 -1
- data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +1078 -0
- data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +652 -0
- data/lib/google/cloud/dialogflow/v2/agents/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/agents.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +463 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +182 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/answer_records.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/bindings_override.rb +102 -0
- data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +753 -0
- data/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +536 -0
- data/lib/google/cloud/dialogflow/v2/contexts/rest.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/contexts.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +714 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +367 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb +57 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +1010 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +642 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +868 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +518 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +819 -0
- data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +450 -0
- data/lib/google/cloud/dialogflow/v2/conversations/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/conversations.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +1013 -0
- data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +631 -0
- data/lib/google/cloud/dialogflow/v2/documents/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/documents.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +1178 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +722 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +779 -0
- data/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +448 -0
- data/lib/google/cloud/dialogflow/v2/environments/rest.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/environments.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +444 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +182 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +914 -0
- data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +813 -0
- data/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +532 -0
- data/lib/google/cloud/dialogflow/v2/intents/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/intents.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +696 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +419 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +955 -0
- data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +588 -0
- data/lib/google/cloud/dialogflow/v2/participants/rest.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/participants.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +703 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +456 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb +54 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +437 -0
- data/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +132 -0
- data/lib/google/cloud/dialogflow/v2/sessions/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/v2/sessions.rb +6 -0
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +686 -0
- data/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +382 -0
- data/lib/google/cloud/dialogflow/v2/versions/rest.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/versions.rb +6 -0
- data/lib/google/cloud/dialogflow/v2.rb +5 -0
- metadata +66 -5
@@ -0,0 +1,1010 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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 "google/cloud/errors"
|
20
|
+
require "google/cloud/dialogflow/v2/conversation_model_pb"
|
21
|
+
require "google/cloud/dialogflow/v2/conversation_models/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Dialogflow
|
27
|
+
module V2
|
28
|
+
module ConversationModels
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the ConversationModels service.
|
32
|
+
#
|
33
|
+
# Manages a collection of models for human agent assistant.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
include Paths
|
37
|
+
|
38
|
+
# @private
|
39
|
+
attr_reader :conversation_models_stub
|
40
|
+
|
41
|
+
##
|
42
|
+
# Configure the ConversationModels Client class.
|
43
|
+
#
|
44
|
+
# See {::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client::Configuration}
|
45
|
+
# for a description of the configuration fields.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
#
|
49
|
+
# # Modify the configuration for all ConversationModels clients
|
50
|
+
# ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# @yield [config] Configure the Client client.
|
55
|
+
# @yieldparam config [Client::Configuration]
|
56
|
+
#
|
57
|
+
# @return [Client::Configuration]
|
58
|
+
#
|
59
|
+
def self.configure
|
60
|
+
@configure ||= begin
|
61
|
+
namespace = ["Google", "Cloud", "Dialogflow", "V2"]
|
62
|
+
parent_config = while namespace.any?
|
63
|
+
parent_name = namespace.join "::"
|
64
|
+
parent_const = const_get parent_name
|
65
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
66
|
+
namespace.pop
|
67
|
+
end
|
68
|
+
default_config = Client::Configuration.new parent_config
|
69
|
+
|
70
|
+
default_config.timeout = 60.0
|
71
|
+
default_config.retry_policy = {
|
72
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
73
|
+
}
|
74
|
+
|
75
|
+
default_config
|
76
|
+
end
|
77
|
+
yield @configure if block_given?
|
78
|
+
@configure
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Configure the ConversationModels Client instance.
|
83
|
+
#
|
84
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
85
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
86
|
+
# should be made on {Client.configure}.
|
87
|
+
#
|
88
|
+
# See {::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client::Configuration}
|
89
|
+
# for a description of the configuration fields.
|
90
|
+
#
|
91
|
+
# @yield [config] Configure the Client client.
|
92
|
+
# @yieldparam config [Client::Configuration]
|
93
|
+
#
|
94
|
+
# @return [Client::Configuration]
|
95
|
+
#
|
96
|
+
def configure
|
97
|
+
yield @config if block_given?
|
98
|
+
@config
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Create a new ConversationModels REST client object.
|
103
|
+
#
|
104
|
+
# @example
|
105
|
+
#
|
106
|
+
# # Create a client using the default configuration
|
107
|
+
# client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new
|
108
|
+
#
|
109
|
+
# # Create a client using a custom configuration
|
110
|
+
# client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config|
|
111
|
+
# config.timeout = 10.0
|
112
|
+
# end
|
113
|
+
#
|
114
|
+
# @yield [config] Configure the ConversationModels client.
|
115
|
+
# @yieldparam config [Client::Configuration]
|
116
|
+
#
|
117
|
+
def initialize
|
118
|
+
# Create the configuration object
|
119
|
+
@config = Configuration.new Client.configure
|
120
|
+
|
121
|
+
# Yield the configuration if needed
|
122
|
+
yield @config if block_given?
|
123
|
+
|
124
|
+
# Create credentials
|
125
|
+
credentials = @config.credentials
|
126
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
|
+
# but only if the default endpoint does not have a region prefix.
|
128
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
129
|
+
!@config.endpoint.split(".").first.include?("-")
|
130
|
+
credentials ||= Credentials.default scope: @config.scope,
|
131
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
132
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
133
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
134
|
+
end
|
135
|
+
|
136
|
+
@quota_project_id = @config.quota_project
|
137
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
138
|
+
|
139
|
+
@operations_client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Operations.new do |config|
|
140
|
+
config.credentials = credentials
|
141
|
+
config.quota_project = @quota_project_id
|
142
|
+
config.endpoint = @config.endpoint
|
143
|
+
end
|
144
|
+
|
145
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
146
|
+
config.credentials = credentials
|
147
|
+
config.quota_project = @quota_project_id
|
148
|
+
config.endpoint = @config.endpoint
|
149
|
+
config.bindings_override = @config.bindings_override
|
150
|
+
end
|
151
|
+
|
152
|
+
@conversation_models_stub = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# Get the associated client for long-running operations.
|
157
|
+
#
|
158
|
+
# @return [::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Operations]
|
159
|
+
#
|
160
|
+
attr_reader :operations_client
|
161
|
+
|
162
|
+
##
|
163
|
+
# Get the associated client for mix-in of the Locations.
|
164
|
+
#
|
165
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
166
|
+
#
|
167
|
+
attr_reader :location_client
|
168
|
+
|
169
|
+
# Service calls
|
170
|
+
|
171
|
+
##
|
172
|
+
# Creates a model.
|
173
|
+
#
|
174
|
+
# This method is a [long-running
|
175
|
+
# operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
|
176
|
+
# The returned `Operation` type has the following method-specific fields:
|
177
|
+
#
|
178
|
+
# - `metadata`:
|
179
|
+
# {::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata CreateConversationModelOperationMetadata}
|
180
|
+
# - `response`:
|
181
|
+
# {::Google::Cloud::Dialogflow::V2::ConversationModel ConversationModel}
|
182
|
+
#
|
183
|
+
# @overload create_conversation_model(request, options = nil)
|
184
|
+
# Pass arguments to `create_conversation_model` via a request object, either of type
|
185
|
+
# {::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest} or an equivalent Hash.
|
186
|
+
#
|
187
|
+
# @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash]
|
188
|
+
# A request object representing the call parameters. Required. To specify no
|
189
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
190
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
191
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
192
|
+
#
|
193
|
+
# @overload create_conversation_model(parent: nil, conversation_model: nil)
|
194
|
+
# Pass arguments to `create_conversation_model` via keyword arguments. Note that at
|
195
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
196
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
197
|
+
#
|
198
|
+
# @param parent [::String]
|
199
|
+
# The project to create conversation model for. Format:
|
200
|
+
# `projects/<Project ID>`
|
201
|
+
# @param conversation_model [::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash]
|
202
|
+
# Required. The conversation model to create.
|
203
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
204
|
+
# @yieldparam result [::Gapic::Operation]
|
205
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
206
|
+
#
|
207
|
+
# @return [::Gapic::Operation]
|
208
|
+
#
|
209
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
210
|
+
def create_conversation_model request, options = nil
|
211
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
212
|
+
|
213
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest
|
214
|
+
|
215
|
+
# Converts hash and nil to an options object
|
216
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
217
|
+
|
218
|
+
# Customize the options with defaults
|
219
|
+
call_metadata = @config.rpcs.create_conversation_model.metadata.to_h
|
220
|
+
|
221
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
222
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
223
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
224
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
225
|
+
transports_version_send: [:rest]
|
226
|
+
|
227
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
228
|
+
|
229
|
+
options.apply_defaults timeout: @config.rpcs.create_conversation_model.timeout,
|
230
|
+
metadata: call_metadata,
|
231
|
+
retry_policy: @config.rpcs.create_conversation_model.retry_policy
|
232
|
+
|
233
|
+
options.apply_defaults timeout: @config.timeout,
|
234
|
+
metadata: @config.metadata,
|
235
|
+
retry_policy: @config.retry_policy
|
236
|
+
|
237
|
+
@conversation_models_stub.create_conversation_model request, options do |result, operation|
|
238
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
239
|
+
yield result, operation if block_given?
|
240
|
+
return result
|
241
|
+
end
|
242
|
+
rescue ::Gapic::Rest::Error => e
|
243
|
+
raise ::Google::Cloud::Error.from_error(e)
|
244
|
+
end
|
245
|
+
|
246
|
+
##
|
247
|
+
# Gets conversation model.
|
248
|
+
#
|
249
|
+
# @overload get_conversation_model(request, options = nil)
|
250
|
+
# Pass arguments to `get_conversation_model` via a request object, either of type
|
251
|
+
# {::Google::Cloud::Dialogflow::V2::GetConversationModelRequest} or an equivalent Hash.
|
252
|
+
#
|
253
|
+
# @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash]
|
254
|
+
# A request object representing the call parameters. Required. To specify no
|
255
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
256
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
257
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
258
|
+
#
|
259
|
+
# @overload get_conversation_model(name: nil)
|
260
|
+
# Pass arguments to `get_conversation_model` via keyword arguments. Note that at
|
261
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
262
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
263
|
+
#
|
264
|
+
# @param name [::String]
|
265
|
+
# Required. The conversation model to retrieve. Format:
|
266
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model ID>`
|
267
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
268
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModel]
|
269
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
270
|
+
#
|
271
|
+
# @return [::Google::Cloud::Dialogflow::V2::ConversationModel]
|
272
|
+
#
|
273
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
274
|
+
def get_conversation_model request, options = nil
|
275
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
276
|
+
|
277
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest
|
278
|
+
|
279
|
+
# Converts hash and nil to an options object
|
280
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
281
|
+
|
282
|
+
# Customize the options with defaults
|
283
|
+
call_metadata = @config.rpcs.get_conversation_model.metadata.to_h
|
284
|
+
|
285
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
286
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
287
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
288
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
289
|
+
transports_version_send: [:rest]
|
290
|
+
|
291
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
292
|
+
|
293
|
+
options.apply_defaults timeout: @config.rpcs.get_conversation_model.timeout,
|
294
|
+
metadata: call_metadata,
|
295
|
+
retry_policy: @config.rpcs.get_conversation_model.retry_policy
|
296
|
+
|
297
|
+
options.apply_defaults timeout: @config.timeout,
|
298
|
+
metadata: @config.metadata,
|
299
|
+
retry_policy: @config.retry_policy
|
300
|
+
|
301
|
+
@conversation_models_stub.get_conversation_model request, options do |result, operation|
|
302
|
+
yield result, operation if block_given?
|
303
|
+
return result
|
304
|
+
end
|
305
|
+
rescue ::Gapic::Rest::Error => e
|
306
|
+
raise ::Google::Cloud::Error.from_error(e)
|
307
|
+
end
|
308
|
+
|
309
|
+
##
|
310
|
+
# Lists conversation models.
|
311
|
+
#
|
312
|
+
# @overload list_conversation_models(request, options = nil)
|
313
|
+
# Pass arguments to `list_conversation_models` via a request object, either of type
|
314
|
+
# {::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest} or an equivalent Hash.
|
315
|
+
#
|
316
|
+
# @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash]
|
317
|
+
# A request object representing the call parameters. Required. To specify no
|
318
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
319
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
320
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
321
|
+
#
|
322
|
+
# @overload list_conversation_models(parent: nil, page_size: nil, page_token: nil)
|
323
|
+
# Pass arguments to `list_conversation_models` via keyword arguments. Note that at
|
324
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
325
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
326
|
+
#
|
327
|
+
# @param parent [::String]
|
328
|
+
# Required. The project to list all conversation models for.
|
329
|
+
# Format: `projects/<Project ID>`
|
330
|
+
# @param page_size [::Integer]
|
331
|
+
# Optional. Maximum number of conversation models to return in a single
|
332
|
+
# page. By default 100 and at most 1000.
|
333
|
+
# @param page_token [::String]
|
334
|
+
# Optional. The next_page_token value returned from a previous list request.
|
335
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
336
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>]
|
337
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
338
|
+
#
|
339
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>]
|
340
|
+
#
|
341
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
342
|
+
def list_conversation_models request, options = nil
|
343
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
344
|
+
|
345
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest
|
346
|
+
|
347
|
+
# Converts hash and nil to an options object
|
348
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
349
|
+
|
350
|
+
# Customize the options with defaults
|
351
|
+
call_metadata = @config.rpcs.list_conversation_models.metadata.to_h
|
352
|
+
|
353
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
354
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
355
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
356
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
357
|
+
transports_version_send: [:rest]
|
358
|
+
|
359
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
360
|
+
|
361
|
+
options.apply_defaults timeout: @config.rpcs.list_conversation_models.timeout,
|
362
|
+
metadata: call_metadata,
|
363
|
+
retry_policy: @config.rpcs.list_conversation_models.retry_policy
|
364
|
+
|
365
|
+
options.apply_defaults timeout: @config.timeout,
|
366
|
+
metadata: @config.metadata,
|
367
|
+
retry_policy: @config.retry_policy
|
368
|
+
|
369
|
+
@conversation_models_stub.list_conversation_models request, options do |result, operation|
|
370
|
+
result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_models, "conversation_models", request, result, options
|
371
|
+
yield result, operation if block_given?
|
372
|
+
return result
|
373
|
+
end
|
374
|
+
rescue ::Gapic::Rest::Error => e
|
375
|
+
raise ::Google::Cloud::Error.from_error(e)
|
376
|
+
end
|
377
|
+
|
378
|
+
##
|
379
|
+
# Deletes a model.
|
380
|
+
#
|
381
|
+
# This method is a [long-running
|
382
|
+
# operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
|
383
|
+
# The returned `Operation` type has the following method-specific fields:
|
384
|
+
#
|
385
|
+
# - `metadata`:
|
386
|
+
# {::Google::Cloud::Dialogflow::V2::DeleteConversationModelOperationMetadata DeleteConversationModelOperationMetadata}
|
387
|
+
# - `response`: An [Empty
|
388
|
+
# message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
|
389
|
+
#
|
390
|
+
# @overload delete_conversation_model(request, options = nil)
|
391
|
+
# Pass arguments to `delete_conversation_model` via a request object, either of type
|
392
|
+
# {::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest} or an equivalent Hash.
|
393
|
+
#
|
394
|
+
# @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash]
|
395
|
+
# A request object representing the call parameters. Required. To specify no
|
396
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
397
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
398
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
399
|
+
#
|
400
|
+
# @overload delete_conversation_model(name: nil)
|
401
|
+
# Pass arguments to `delete_conversation_model` via keyword arguments. Note that at
|
402
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
403
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
404
|
+
#
|
405
|
+
# @param name [::String]
|
406
|
+
# Required. The conversation model to delete. Format:
|
407
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model ID>`
|
408
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
409
|
+
# @yieldparam result [::Gapic::Operation]
|
410
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
411
|
+
#
|
412
|
+
# @return [::Gapic::Operation]
|
413
|
+
#
|
414
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
415
|
+
def delete_conversation_model request, options = nil
|
416
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
417
|
+
|
418
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest
|
419
|
+
|
420
|
+
# Converts hash and nil to an options object
|
421
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
422
|
+
|
423
|
+
# Customize the options with defaults
|
424
|
+
call_metadata = @config.rpcs.delete_conversation_model.metadata.to_h
|
425
|
+
|
426
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
427
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
428
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
429
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
430
|
+
transports_version_send: [:rest]
|
431
|
+
|
432
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
433
|
+
|
434
|
+
options.apply_defaults timeout: @config.rpcs.delete_conversation_model.timeout,
|
435
|
+
metadata: call_metadata,
|
436
|
+
retry_policy: @config.rpcs.delete_conversation_model.retry_policy
|
437
|
+
|
438
|
+
options.apply_defaults timeout: @config.timeout,
|
439
|
+
metadata: @config.metadata,
|
440
|
+
retry_policy: @config.retry_policy
|
441
|
+
|
442
|
+
@conversation_models_stub.delete_conversation_model request, options do |result, operation|
|
443
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
444
|
+
yield result, operation if block_given?
|
445
|
+
return result
|
446
|
+
end
|
447
|
+
rescue ::Gapic::Rest::Error => e
|
448
|
+
raise ::Google::Cloud::Error.from_error(e)
|
449
|
+
end
|
450
|
+
|
451
|
+
##
|
452
|
+
# Deploys a model. If a model is already deployed, deploying it
|
453
|
+
# has no effect. A model can only serve prediction requests after it gets
|
454
|
+
# deployed. For article suggestion, custom model will not be used unless
|
455
|
+
# it is deployed.
|
456
|
+
#
|
457
|
+
# This method is a [long-running
|
458
|
+
# operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
|
459
|
+
# The returned `Operation` type has the following method-specific fields:
|
460
|
+
#
|
461
|
+
# - `metadata`:
|
462
|
+
# {::Google::Cloud::Dialogflow::V2::DeployConversationModelOperationMetadata DeployConversationModelOperationMetadata}
|
463
|
+
# - `response`: An [Empty
|
464
|
+
# message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
|
465
|
+
#
|
466
|
+
# @overload deploy_conversation_model(request, options = nil)
|
467
|
+
# Pass arguments to `deploy_conversation_model` via a request object, either of type
|
468
|
+
# {::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest} or an equivalent Hash.
|
469
|
+
#
|
470
|
+
# @param request [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash]
|
471
|
+
# A request object representing the call parameters. Required. To specify no
|
472
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
473
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
474
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
475
|
+
#
|
476
|
+
# @overload deploy_conversation_model(name: nil)
|
477
|
+
# Pass arguments to `deploy_conversation_model` via keyword arguments. Note that at
|
478
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
479
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
480
|
+
#
|
481
|
+
# @param name [::String]
|
482
|
+
# Required. The conversation model to deploy. Format:
|
483
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model ID>`
|
484
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
485
|
+
# @yieldparam result [::Gapic::Operation]
|
486
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
487
|
+
#
|
488
|
+
# @return [::Gapic::Operation]
|
489
|
+
#
|
490
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
491
|
+
def deploy_conversation_model request, options = nil
|
492
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
493
|
+
|
494
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest
|
495
|
+
|
496
|
+
# Converts hash and nil to an options object
|
497
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
498
|
+
|
499
|
+
# Customize the options with defaults
|
500
|
+
call_metadata = @config.rpcs.deploy_conversation_model.metadata.to_h
|
501
|
+
|
502
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
503
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
504
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
505
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
506
|
+
transports_version_send: [:rest]
|
507
|
+
|
508
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
509
|
+
|
510
|
+
options.apply_defaults timeout: @config.rpcs.deploy_conversation_model.timeout,
|
511
|
+
metadata: call_metadata,
|
512
|
+
retry_policy: @config.rpcs.deploy_conversation_model.retry_policy
|
513
|
+
|
514
|
+
options.apply_defaults timeout: @config.timeout,
|
515
|
+
metadata: @config.metadata,
|
516
|
+
retry_policy: @config.retry_policy
|
517
|
+
|
518
|
+
@conversation_models_stub.deploy_conversation_model request, options do |result, operation|
|
519
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
520
|
+
yield result, operation if block_given?
|
521
|
+
return result
|
522
|
+
end
|
523
|
+
rescue ::Gapic::Rest::Error => e
|
524
|
+
raise ::Google::Cloud::Error.from_error(e)
|
525
|
+
end
|
526
|
+
|
527
|
+
##
|
528
|
+
# Undeploys a model. If the model is not deployed this method has no effect.
|
529
|
+
# If the model is currently being used:
|
530
|
+
# - For article suggestion, article suggestion will fallback to the default
|
531
|
+
# model if model is undeployed.
|
532
|
+
#
|
533
|
+
# This method is a [long-running
|
534
|
+
# operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
|
535
|
+
# The returned `Operation` type has the following method-specific fields:
|
536
|
+
#
|
537
|
+
# - `metadata`:
|
538
|
+
# {::Google::Cloud::Dialogflow::V2::UndeployConversationModelOperationMetadata UndeployConversationModelOperationMetadata}
|
539
|
+
# - `response`: An [Empty
|
540
|
+
# message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
|
541
|
+
#
|
542
|
+
# @overload undeploy_conversation_model(request, options = nil)
|
543
|
+
# Pass arguments to `undeploy_conversation_model` via a request object, either of type
|
544
|
+
# {::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest} or an equivalent Hash.
|
545
|
+
#
|
546
|
+
# @param request [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash]
|
547
|
+
# A request object representing the call parameters. Required. To specify no
|
548
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
549
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
550
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
551
|
+
#
|
552
|
+
# @overload undeploy_conversation_model(name: nil)
|
553
|
+
# Pass arguments to `undeploy_conversation_model` via keyword arguments. Note that at
|
554
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
555
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
556
|
+
#
|
557
|
+
# @param name [::String]
|
558
|
+
# Required. The conversation model to undeploy. Format:
|
559
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model ID>`
|
560
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
561
|
+
# @yieldparam result [::Gapic::Operation]
|
562
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
563
|
+
#
|
564
|
+
# @return [::Gapic::Operation]
|
565
|
+
#
|
566
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
567
|
+
def undeploy_conversation_model request, options = nil
|
568
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
569
|
+
|
570
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest
|
571
|
+
|
572
|
+
# Converts hash and nil to an options object
|
573
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
574
|
+
|
575
|
+
# Customize the options with defaults
|
576
|
+
call_metadata = @config.rpcs.undeploy_conversation_model.metadata.to_h
|
577
|
+
|
578
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
579
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
580
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
581
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
582
|
+
transports_version_send: [:rest]
|
583
|
+
|
584
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
585
|
+
|
586
|
+
options.apply_defaults timeout: @config.rpcs.undeploy_conversation_model.timeout,
|
587
|
+
metadata: call_metadata,
|
588
|
+
retry_policy: @config.rpcs.undeploy_conversation_model.retry_policy
|
589
|
+
|
590
|
+
options.apply_defaults timeout: @config.timeout,
|
591
|
+
metadata: @config.metadata,
|
592
|
+
retry_policy: @config.retry_policy
|
593
|
+
|
594
|
+
@conversation_models_stub.undeploy_conversation_model request, options do |result, operation|
|
595
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
596
|
+
yield result, operation if block_given?
|
597
|
+
return result
|
598
|
+
end
|
599
|
+
rescue ::Gapic::Rest::Error => e
|
600
|
+
raise ::Google::Cloud::Error.from_error(e)
|
601
|
+
end
|
602
|
+
|
603
|
+
##
|
604
|
+
# Gets an evaluation of conversation model.
|
605
|
+
#
|
606
|
+
# @overload get_conversation_model_evaluation(request, options = nil)
|
607
|
+
# Pass arguments to `get_conversation_model_evaluation` via a request object, either of type
|
608
|
+
# {::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest} or an equivalent Hash.
|
609
|
+
#
|
610
|
+
# @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash]
|
611
|
+
# A request object representing the call parameters. Required. To specify no
|
612
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
613
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
614
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
615
|
+
#
|
616
|
+
# @overload get_conversation_model_evaluation(name: nil)
|
617
|
+
# Pass arguments to `get_conversation_model_evaluation` via keyword arguments. Note that at
|
618
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
619
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
620
|
+
#
|
621
|
+
# @param name [::String]
|
622
|
+
# Required. The conversation model evaluation resource name. Format:
|
623
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model
|
624
|
+
# ID>/evaluations/<Evaluation ID>`
|
625
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
626
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation]
|
627
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
628
|
+
#
|
629
|
+
# @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation]
|
630
|
+
#
|
631
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
632
|
+
def get_conversation_model_evaluation request, options = nil
|
633
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
634
|
+
|
635
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest
|
636
|
+
|
637
|
+
# Converts hash and nil to an options object
|
638
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
639
|
+
|
640
|
+
# Customize the options with defaults
|
641
|
+
call_metadata = @config.rpcs.get_conversation_model_evaluation.metadata.to_h
|
642
|
+
|
643
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
644
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
645
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
646
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
647
|
+
transports_version_send: [:rest]
|
648
|
+
|
649
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
650
|
+
|
651
|
+
options.apply_defaults timeout: @config.rpcs.get_conversation_model_evaluation.timeout,
|
652
|
+
metadata: call_metadata,
|
653
|
+
retry_policy: @config.rpcs.get_conversation_model_evaluation.retry_policy
|
654
|
+
|
655
|
+
options.apply_defaults timeout: @config.timeout,
|
656
|
+
metadata: @config.metadata,
|
657
|
+
retry_policy: @config.retry_policy
|
658
|
+
|
659
|
+
@conversation_models_stub.get_conversation_model_evaluation request, options do |result, operation|
|
660
|
+
yield result, operation if block_given?
|
661
|
+
return result
|
662
|
+
end
|
663
|
+
rescue ::Gapic::Rest::Error => e
|
664
|
+
raise ::Google::Cloud::Error.from_error(e)
|
665
|
+
end
|
666
|
+
|
667
|
+
##
|
668
|
+
# Lists evaluations of a conversation model.
|
669
|
+
#
|
670
|
+
# @overload list_conversation_model_evaluations(request, options = nil)
|
671
|
+
# Pass arguments to `list_conversation_model_evaluations` via a request object, either of type
|
672
|
+
# {::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest} or an equivalent Hash.
|
673
|
+
#
|
674
|
+
# @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash]
|
675
|
+
# A request object representing the call parameters. Required. To specify no
|
676
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
677
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
678
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
679
|
+
#
|
680
|
+
# @overload list_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil)
|
681
|
+
# Pass arguments to `list_conversation_model_evaluations` via keyword arguments. Note that at
|
682
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
683
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
684
|
+
#
|
685
|
+
# @param parent [::String]
|
686
|
+
# Required. The conversation model resource name. Format:
|
687
|
+
# `projects/<Project ID>/conversationModels/<Conversation Model ID>`
|
688
|
+
# @param page_size [::Integer]
|
689
|
+
# Optional. Maximum number of evaluations to return in a
|
690
|
+
# single page. By default 100 and at most 1000.
|
691
|
+
# @param page_token [::String]
|
692
|
+
# Optional. The next_page_token value returned from a previous list request.
|
693
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
694
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>]
|
695
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
696
|
+
#
|
697
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>]
|
698
|
+
#
|
699
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
700
|
+
def list_conversation_model_evaluations request, options = nil
|
701
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
702
|
+
|
703
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest
|
704
|
+
|
705
|
+
# Converts hash and nil to an options object
|
706
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
707
|
+
|
708
|
+
# Customize the options with defaults
|
709
|
+
call_metadata = @config.rpcs.list_conversation_model_evaluations.metadata.to_h
|
710
|
+
|
711
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
712
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
713
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
714
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
715
|
+
transports_version_send: [:rest]
|
716
|
+
|
717
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
718
|
+
|
719
|
+
options.apply_defaults timeout: @config.rpcs.list_conversation_model_evaluations.timeout,
|
720
|
+
metadata: call_metadata,
|
721
|
+
retry_policy: @config.rpcs.list_conversation_model_evaluations.retry_policy
|
722
|
+
|
723
|
+
options.apply_defaults timeout: @config.timeout,
|
724
|
+
metadata: @config.metadata,
|
725
|
+
retry_policy: @config.retry_policy
|
726
|
+
|
727
|
+
@conversation_models_stub.list_conversation_model_evaluations request, options do |result, operation|
|
728
|
+
result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_model_evaluations, "conversation_model_evaluations", request, result, options
|
729
|
+
yield result, operation if block_given?
|
730
|
+
return result
|
731
|
+
end
|
732
|
+
rescue ::Gapic::Rest::Error => e
|
733
|
+
raise ::Google::Cloud::Error.from_error(e)
|
734
|
+
end
|
735
|
+
|
736
|
+
##
|
737
|
+
# Creates evaluation of a conversation model.
|
738
|
+
#
|
739
|
+
# @overload create_conversation_model_evaluation(request, options = nil)
|
740
|
+
# Pass arguments to `create_conversation_model_evaluation` via a request object, either of type
|
741
|
+
# {::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest} or an equivalent Hash.
|
742
|
+
#
|
743
|
+
# @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash]
|
744
|
+
# A request object representing the call parameters. Required. To specify no
|
745
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
746
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
747
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
748
|
+
#
|
749
|
+
# @overload create_conversation_model_evaluation(parent: nil, conversation_model_evaluation: nil)
|
750
|
+
# Pass arguments to `create_conversation_model_evaluation` via keyword arguments. Note that at
|
751
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
752
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
753
|
+
#
|
754
|
+
# @param parent [::String]
|
755
|
+
# Required. The conversation model resource name. Format:
|
756
|
+
# `projects/<Project ID>/locations/<Location
|
757
|
+
# ID>/conversationModels/<Conversation Model ID>`
|
758
|
+
# @param conversation_model_evaluation [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash]
|
759
|
+
# Required. The conversation model evaluation to be created.
|
760
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
761
|
+
# @yieldparam result [::Gapic::Operation]
|
762
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
763
|
+
#
|
764
|
+
# @return [::Gapic::Operation]
|
765
|
+
#
|
766
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
767
|
+
def create_conversation_model_evaluation request, options = nil
|
768
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
769
|
+
|
770
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest
|
771
|
+
|
772
|
+
# Converts hash and nil to an options object
|
773
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
774
|
+
|
775
|
+
# Customize the options with defaults
|
776
|
+
call_metadata = @config.rpcs.create_conversation_model_evaluation.metadata.to_h
|
777
|
+
|
778
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
779
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
780
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
781
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
|
782
|
+
transports_version_send: [:rest]
|
783
|
+
|
784
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
785
|
+
|
786
|
+
options.apply_defaults timeout: @config.rpcs.create_conversation_model_evaluation.timeout,
|
787
|
+
metadata: call_metadata,
|
788
|
+
retry_policy: @config.rpcs.create_conversation_model_evaluation.retry_policy
|
789
|
+
|
790
|
+
options.apply_defaults timeout: @config.timeout,
|
791
|
+
metadata: @config.metadata,
|
792
|
+
retry_policy: @config.retry_policy
|
793
|
+
|
794
|
+
@conversation_models_stub.create_conversation_model_evaluation request, options do |result, operation|
|
795
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
796
|
+
yield result, operation if block_given?
|
797
|
+
return result
|
798
|
+
end
|
799
|
+
rescue ::Gapic::Rest::Error => e
|
800
|
+
raise ::Google::Cloud::Error.from_error(e)
|
801
|
+
end
|
802
|
+
|
803
|
+
##
|
804
|
+
# Configuration class for the ConversationModels REST API.
|
805
|
+
#
|
806
|
+
# This class represents the configuration for ConversationModels REST,
|
807
|
+
# providing control over timeouts, retry behavior, logging, transport
|
808
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
809
|
+
# applied individually to specific RPCs. See
|
810
|
+
# {::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client::Configuration::Rpcs}
|
811
|
+
# for a list of RPCs that can be configured independently.
|
812
|
+
#
|
813
|
+
# Configuration can be applied globally to all clients, or to a single client
|
814
|
+
# on construction.
|
815
|
+
#
|
816
|
+
# @example
|
817
|
+
#
|
818
|
+
# # Modify the global config, setting the timeout for
|
819
|
+
# # create_conversation_model to 20 seconds,
|
820
|
+
# # and all remaining timeouts to 10 seconds.
|
821
|
+
# ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.configure do |config|
|
822
|
+
# config.timeout = 10.0
|
823
|
+
# config.rpcs.create_conversation_model.timeout = 20.0
|
824
|
+
# end
|
825
|
+
#
|
826
|
+
# # Apply the above configuration only to a new client.
|
827
|
+
# client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config|
|
828
|
+
# config.timeout = 10.0
|
829
|
+
# config.rpcs.create_conversation_model.timeout = 20.0
|
830
|
+
# end
|
831
|
+
#
|
832
|
+
# @!attribute [rw] endpoint
|
833
|
+
# The hostname or hostname:port of the service endpoint.
|
834
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
835
|
+
# @return [::String]
|
836
|
+
# @!attribute [rw] credentials
|
837
|
+
# Credentials to send with calls. You may provide any of the following types:
|
838
|
+
# * (`String`) The path to a service account key file in JSON format
|
839
|
+
# * (`Hash`) A service account key as a Hash
|
840
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
841
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
842
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
843
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
844
|
+
# * (`nil`) indicating no credentials
|
845
|
+
# @return [::Object]
|
846
|
+
# @!attribute [rw] scope
|
847
|
+
# The OAuth scopes
|
848
|
+
# @return [::Array<::String>]
|
849
|
+
# @!attribute [rw] lib_name
|
850
|
+
# The library name as recorded in instrumentation and logging
|
851
|
+
# @return [::String]
|
852
|
+
# @!attribute [rw] lib_version
|
853
|
+
# The library version as recorded in instrumentation and logging
|
854
|
+
# @return [::String]
|
855
|
+
# @!attribute [rw] timeout
|
856
|
+
# The call timeout in seconds.
|
857
|
+
# @return [::Numeric]
|
858
|
+
# @!attribute [rw] metadata
|
859
|
+
# Additional headers to be sent with the call.
|
860
|
+
# @return [::Hash{::Symbol=>::String}]
|
861
|
+
# @!attribute [rw] retry_policy
|
862
|
+
# The retry policy. The value is a hash with the following keys:
|
863
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
864
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
865
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
866
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
867
|
+
# trigger a retry.
|
868
|
+
# @return [::Hash]
|
869
|
+
# @!attribute [rw] quota_project
|
870
|
+
# A separate project against which to charge quota.
|
871
|
+
# @return [::String]
|
872
|
+
#
|
873
|
+
class Configuration
|
874
|
+
extend ::Gapic::Config
|
875
|
+
|
876
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
877
|
+
config_attr :credentials, nil do |value|
|
878
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
879
|
+
allowed.any? { |klass| klass === value }
|
880
|
+
end
|
881
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
882
|
+
config_attr :lib_name, nil, ::String, nil
|
883
|
+
config_attr :lib_version, nil, ::String, nil
|
884
|
+
config_attr :timeout, nil, ::Numeric, nil
|
885
|
+
config_attr :metadata, nil, ::Hash, nil
|
886
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
887
|
+
config_attr :quota_project, nil, ::String, nil
|
888
|
+
|
889
|
+
# @private
|
890
|
+
# Overrides for http bindings for the RPCs of this service
|
891
|
+
# are only used when this service is used as mixin, and only
|
892
|
+
# by the host service.
|
893
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
894
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
895
|
+
|
896
|
+
# @private
|
897
|
+
def initialize parent_config = nil
|
898
|
+
@parent_config = parent_config unless parent_config.nil?
|
899
|
+
|
900
|
+
yield self if block_given?
|
901
|
+
end
|
902
|
+
|
903
|
+
##
|
904
|
+
# Configurations for individual RPCs
|
905
|
+
# @return [Rpcs]
|
906
|
+
#
|
907
|
+
def rpcs
|
908
|
+
@rpcs ||= begin
|
909
|
+
parent_rpcs = nil
|
910
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
911
|
+
Rpcs.new parent_rpcs
|
912
|
+
end
|
913
|
+
end
|
914
|
+
|
915
|
+
##
|
916
|
+
# Configuration RPC class for the ConversationModels API.
|
917
|
+
#
|
918
|
+
# Includes fields providing the configuration for each RPC in this service.
|
919
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
920
|
+
# the following configuration fields:
|
921
|
+
#
|
922
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
923
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
924
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
925
|
+
# include the following keys:
|
926
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
927
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
928
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
929
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
930
|
+
# trigger a retry.
|
931
|
+
#
|
932
|
+
class Rpcs
|
933
|
+
##
|
934
|
+
# RPC-specific configuration for `create_conversation_model`
|
935
|
+
# @return [::Gapic::Config::Method]
|
936
|
+
#
|
937
|
+
attr_reader :create_conversation_model
|
938
|
+
##
|
939
|
+
# RPC-specific configuration for `get_conversation_model`
|
940
|
+
# @return [::Gapic::Config::Method]
|
941
|
+
#
|
942
|
+
attr_reader :get_conversation_model
|
943
|
+
##
|
944
|
+
# RPC-specific configuration for `list_conversation_models`
|
945
|
+
# @return [::Gapic::Config::Method]
|
946
|
+
#
|
947
|
+
attr_reader :list_conversation_models
|
948
|
+
##
|
949
|
+
# RPC-specific configuration for `delete_conversation_model`
|
950
|
+
# @return [::Gapic::Config::Method]
|
951
|
+
#
|
952
|
+
attr_reader :delete_conversation_model
|
953
|
+
##
|
954
|
+
# RPC-specific configuration for `deploy_conversation_model`
|
955
|
+
# @return [::Gapic::Config::Method]
|
956
|
+
#
|
957
|
+
attr_reader :deploy_conversation_model
|
958
|
+
##
|
959
|
+
# RPC-specific configuration for `undeploy_conversation_model`
|
960
|
+
# @return [::Gapic::Config::Method]
|
961
|
+
#
|
962
|
+
attr_reader :undeploy_conversation_model
|
963
|
+
##
|
964
|
+
# RPC-specific configuration for `get_conversation_model_evaluation`
|
965
|
+
# @return [::Gapic::Config::Method]
|
966
|
+
#
|
967
|
+
attr_reader :get_conversation_model_evaluation
|
968
|
+
##
|
969
|
+
# RPC-specific configuration for `list_conversation_model_evaluations`
|
970
|
+
# @return [::Gapic::Config::Method]
|
971
|
+
#
|
972
|
+
attr_reader :list_conversation_model_evaluations
|
973
|
+
##
|
974
|
+
# RPC-specific configuration for `create_conversation_model_evaluation`
|
975
|
+
# @return [::Gapic::Config::Method]
|
976
|
+
#
|
977
|
+
attr_reader :create_conversation_model_evaluation
|
978
|
+
|
979
|
+
# @private
|
980
|
+
def initialize parent_rpcs = nil
|
981
|
+
create_conversation_model_config = parent_rpcs.create_conversation_model if parent_rpcs.respond_to? :create_conversation_model
|
982
|
+
@create_conversation_model = ::Gapic::Config::Method.new create_conversation_model_config
|
983
|
+
get_conversation_model_config = parent_rpcs.get_conversation_model if parent_rpcs.respond_to? :get_conversation_model
|
984
|
+
@get_conversation_model = ::Gapic::Config::Method.new get_conversation_model_config
|
985
|
+
list_conversation_models_config = parent_rpcs.list_conversation_models if parent_rpcs.respond_to? :list_conversation_models
|
986
|
+
@list_conversation_models = ::Gapic::Config::Method.new list_conversation_models_config
|
987
|
+
delete_conversation_model_config = parent_rpcs.delete_conversation_model if parent_rpcs.respond_to? :delete_conversation_model
|
988
|
+
@delete_conversation_model = ::Gapic::Config::Method.new delete_conversation_model_config
|
989
|
+
deploy_conversation_model_config = parent_rpcs.deploy_conversation_model if parent_rpcs.respond_to? :deploy_conversation_model
|
990
|
+
@deploy_conversation_model = ::Gapic::Config::Method.new deploy_conversation_model_config
|
991
|
+
undeploy_conversation_model_config = parent_rpcs.undeploy_conversation_model if parent_rpcs.respond_to? :undeploy_conversation_model
|
992
|
+
@undeploy_conversation_model = ::Gapic::Config::Method.new undeploy_conversation_model_config
|
993
|
+
get_conversation_model_evaluation_config = parent_rpcs.get_conversation_model_evaluation if parent_rpcs.respond_to? :get_conversation_model_evaluation
|
994
|
+
@get_conversation_model_evaluation = ::Gapic::Config::Method.new get_conversation_model_evaluation_config
|
995
|
+
list_conversation_model_evaluations_config = parent_rpcs.list_conversation_model_evaluations if parent_rpcs.respond_to? :list_conversation_model_evaluations
|
996
|
+
@list_conversation_model_evaluations = ::Gapic::Config::Method.new list_conversation_model_evaluations_config
|
997
|
+
create_conversation_model_evaluation_config = parent_rpcs.create_conversation_model_evaluation if parent_rpcs.respond_to? :create_conversation_model_evaluation
|
998
|
+
@create_conversation_model_evaluation = ::Gapic::Config::Method.new create_conversation_model_evaluation_config
|
999
|
+
|
1000
|
+
yield self if block_given?
|
1001
|
+
end
|
1002
|
+
end
|
1003
|
+
end
|
1004
|
+
end
|
1005
|
+
end
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
end
|
1010
|
+
end
|