google-cloud-dialogflow-cx-v3 0.13.0 → 0.15.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/cx/v3/agents/rest/client.rb +1032 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +586 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb +104 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +472 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +168 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +456 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +168 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +740 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +1028 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +585 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +821 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +467 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +1182 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +646 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +722 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +777 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +673 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +688 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +384 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +576 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +254 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb +58 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +1304 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +765 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +748 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +865 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +467 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +677 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3.rb +5 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +3 -0
- metadata +61 -5
@@ -0,0 +1,688 @@
|
|
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/cx/v3/session_entity_type_pb"
|
21
|
+
require "google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Dialogflow
|
27
|
+
module CX
|
28
|
+
module V3
|
29
|
+
module SessionEntityTypes
|
30
|
+
module Rest
|
31
|
+
##
|
32
|
+
# REST client for the SessionEntityTypes service.
|
33
|
+
#
|
34
|
+
# Service for managing
|
35
|
+
# {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}.
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
include Paths
|
39
|
+
|
40
|
+
# @private
|
41
|
+
attr_reader :session_entity_types_stub
|
42
|
+
|
43
|
+
##
|
44
|
+
# Configure the SessionEntityTypes Client class.
|
45
|
+
#
|
46
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client::Configuration}
|
47
|
+
# for a description of the configuration fields.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
#
|
51
|
+
# # Modify the configuration for all SessionEntityTypes clients
|
52
|
+
# ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.configure do |config|
|
53
|
+
# config.timeout = 10.0
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# @yield [config] Configure the Client client.
|
57
|
+
# @yieldparam config [Client::Configuration]
|
58
|
+
#
|
59
|
+
# @return [Client::Configuration]
|
60
|
+
#
|
61
|
+
def self.configure
|
62
|
+
@configure ||= begin
|
63
|
+
namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
|
64
|
+
parent_config = while namespace.any?
|
65
|
+
parent_name = namespace.join "::"
|
66
|
+
parent_const = const_get parent_name
|
67
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
68
|
+
namespace.pop
|
69
|
+
end
|
70
|
+
default_config = Client::Configuration.new parent_config
|
71
|
+
|
72
|
+
default_config.timeout = 60.0
|
73
|
+
default_config.retry_policy = {
|
74
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
75
|
+
}
|
76
|
+
|
77
|
+
default_config
|
78
|
+
end
|
79
|
+
yield @configure if block_given?
|
80
|
+
@configure
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Configure the SessionEntityTypes Client instance.
|
85
|
+
#
|
86
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
87
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
88
|
+
# should be made on {Client.configure}.
|
89
|
+
#
|
90
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client::Configuration}
|
91
|
+
# for a description of the configuration fields.
|
92
|
+
#
|
93
|
+
# @yield [config] Configure the Client client.
|
94
|
+
# @yieldparam config [Client::Configuration]
|
95
|
+
#
|
96
|
+
# @return [Client::Configuration]
|
97
|
+
#
|
98
|
+
def configure
|
99
|
+
yield @config if block_given?
|
100
|
+
@config
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# Create a new SessionEntityTypes REST client object.
|
105
|
+
#
|
106
|
+
# @example
|
107
|
+
#
|
108
|
+
# # Create a client using the default configuration
|
109
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new
|
110
|
+
#
|
111
|
+
# # Create a client using a custom configuration
|
112
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config|
|
113
|
+
# config.timeout = 10.0
|
114
|
+
# end
|
115
|
+
#
|
116
|
+
# @yield [config] Configure the SessionEntityTypes client.
|
117
|
+
# @yieldparam config [Client::Configuration]
|
118
|
+
#
|
119
|
+
def initialize
|
120
|
+
# Create the configuration object
|
121
|
+
@config = Configuration.new Client.configure
|
122
|
+
|
123
|
+
# Yield the configuration if needed
|
124
|
+
yield @config if block_given?
|
125
|
+
|
126
|
+
# Create credentials
|
127
|
+
credentials = @config.credentials
|
128
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
129
|
+
# but only if the default endpoint does not have a region prefix.
|
130
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
131
|
+
!@config.endpoint.split(".").first.include?("-")
|
132
|
+
credentials ||= Credentials.default scope: @config.scope,
|
133
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
134
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
135
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
136
|
+
end
|
137
|
+
|
138
|
+
@quota_project_id = @config.quota_project
|
139
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
140
|
+
|
141
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
142
|
+
config.credentials = credentials
|
143
|
+
config.quota_project = @quota_project_id
|
144
|
+
config.endpoint = @config.endpoint
|
145
|
+
config.bindings_override = @config.bindings_override
|
146
|
+
end
|
147
|
+
|
148
|
+
@session_entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
149
|
+
end
|
150
|
+
|
151
|
+
##
|
152
|
+
# Get the associated client for mix-in of the Locations.
|
153
|
+
#
|
154
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
155
|
+
#
|
156
|
+
attr_reader :location_client
|
157
|
+
|
158
|
+
# Service calls
|
159
|
+
|
160
|
+
##
|
161
|
+
# Returns the list of all session entity types in the specified session.
|
162
|
+
#
|
163
|
+
# @overload list_session_entity_types(request, options = nil)
|
164
|
+
# Pass arguments to `list_session_entity_types` via a request object, either of type
|
165
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash.
|
166
|
+
#
|
167
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest, ::Hash]
|
168
|
+
# A request object representing the call parameters. Required. To specify no
|
169
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
170
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
171
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
172
|
+
#
|
173
|
+
# @overload list_session_entity_types(parent: nil, page_size: nil, page_token: nil)
|
174
|
+
# Pass arguments to `list_session_entity_types` via keyword arguments. Note that at
|
175
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
176
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
177
|
+
#
|
178
|
+
# @param parent [::String]
|
179
|
+
# Required. The session to list all session entity types from.
|
180
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
181
|
+
# ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
|
182
|
+
# ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
|
183
|
+
# If `Environment ID` is not specified, we assume default 'draft'
|
184
|
+
# environment.
|
185
|
+
# @param page_size [::Integer]
|
186
|
+
# The maximum number of items to return in a single page. By default 100 and
|
187
|
+
# at most 1000.
|
188
|
+
# @param page_token [::String]
|
189
|
+
# The next_page_token value returned from a previous list request.
|
190
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
191
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>]
|
192
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
193
|
+
#
|
194
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>]
|
195
|
+
#
|
196
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
197
|
+
def list_session_entity_types request, options = nil
|
198
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
199
|
+
|
200
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest
|
201
|
+
|
202
|
+
# Converts hash and nil to an options object
|
203
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
204
|
+
|
205
|
+
# Customize the options with defaults
|
206
|
+
call_metadata = @config.rpcs.list_session_entity_types.metadata.to_h
|
207
|
+
|
208
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
209
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
210
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
211
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
212
|
+
transports_version_send: [:rest]
|
213
|
+
|
214
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
215
|
+
|
216
|
+
options.apply_defaults timeout: @config.rpcs.list_session_entity_types.timeout,
|
217
|
+
metadata: call_metadata,
|
218
|
+
retry_policy: @config.rpcs.list_session_entity_types.retry_policy
|
219
|
+
|
220
|
+
options.apply_defaults timeout: @config.timeout,
|
221
|
+
metadata: @config.metadata,
|
222
|
+
retry_policy: @config.retry_policy
|
223
|
+
|
224
|
+
@session_entity_types_stub.list_session_entity_types request, options do |result, operation|
|
225
|
+
result = ::Gapic::Rest::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, "session_entity_types", request, result, options
|
226
|
+
yield result, operation if block_given?
|
227
|
+
return result
|
228
|
+
end
|
229
|
+
rescue ::Gapic::Rest::Error => e
|
230
|
+
raise ::Google::Cloud::Error.from_error(e)
|
231
|
+
end
|
232
|
+
|
233
|
+
##
|
234
|
+
# Retrieves the specified session entity type.
|
235
|
+
#
|
236
|
+
# @overload get_session_entity_type(request, options = nil)
|
237
|
+
# Pass arguments to `get_session_entity_type` via a request object, either of type
|
238
|
+
# {::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash.
|
239
|
+
#
|
240
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest, ::Hash]
|
241
|
+
# A request object representing the call parameters. Required. To specify no
|
242
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
243
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
244
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
245
|
+
#
|
246
|
+
# @overload get_session_entity_type(name: nil)
|
247
|
+
# Pass arguments to `get_session_entity_type` via keyword arguments. Note that at
|
248
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
249
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
250
|
+
#
|
251
|
+
# @param name [::String]
|
252
|
+
# Required. The name of the session entity type.
|
253
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
254
|
+
# ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
|
255
|
+
# `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
256
|
+
# ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
|
257
|
+
# Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
|
258
|
+
# environment.
|
259
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
260
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
261
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
262
|
+
#
|
263
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
264
|
+
#
|
265
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
266
|
+
def get_session_entity_type request, options = nil
|
267
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
268
|
+
|
269
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest
|
270
|
+
|
271
|
+
# Converts hash and nil to an options object
|
272
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
273
|
+
|
274
|
+
# Customize the options with defaults
|
275
|
+
call_metadata = @config.rpcs.get_session_entity_type.metadata.to_h
|
276
|
+
|
277
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
278
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
279
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
280
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
281
|
+
transports_version_send: [:rest]
|
282
|
+
|
283
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
284
|
+
|
285
|
+
options.apply_defaults timeout: @config.rpcs.get_session_entity_type.timeout,
|
286
|
+
metadata: call_metadata,
|
287
|
+
retry_policy: @config.rpcs.get_session_entity_type.retry_policy
|
288
|
+
|
289
|
+
options.apply_defaults timeout: @config.timeout,
|
290
|
+
metadata: @config.metadata,
|
291
|
+
retry_policy: @config.retry_policy
|
292
|
+
|
293
|
+
@session_entity_types_stub.get_session_entity_type request, options do |result, operation|
|
294
|
+
yield result, operation if block_given?
|
295
|
+
return result
|
296
|
+
end
|
297
|
+
rescue ::Gapic::Rest::Error => e
|
298
|
+
raise ::Google::Cloud::Error.from_error(e)
|
299
|
+
end
|
300
|
+
|
301
|
+
##
|
302
|
+
# Creates a session entity type.
|
303
|
+
#
|
304
|
+
# @overload create_session_entity_type(request, options = nil)
|
305
|
+
# Pass arguments to `create_session_entity_type` via a request object, either of type
|
306
|
+
# {::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash.
|
307
|
+
#
|
308
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest, ::Hash]
|
309
|
+
# A request object representing the call parameters. Required. To specify no
|
310
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
311
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
312
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
313
|
+
#
|
314
|
+
# @overload create_session_entity_type(parent: nil, session_entity_type: nil)
|
315
|
+
# Pass arguments to `create_session_entity_type` via keyword arguments. Note that at
|
316
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
317
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
318
|
+
#
|
319
|
+
# @param parent [::String]
|
320
|
+
# Required. The session to create a session entity type for.
|
321
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
322
|
+
# ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
|
323
|
+
# ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
|
324
|
+
# If `Environment ID` is not specified, we assume default 'draft'
|
325
|
+
# environment.
|
326
|
+
# @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType, ::Hash]
|
327
|
+
# Required. The session entity type to create.
|
328
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
329
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
330
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
331
|
+
#
|
332
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
333
|
+
#
|
334
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
335
|
+
def create_session_entity_type request, options = nil
|
336
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
337
|
+
|
338
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest
|
339
|
+
|
340
|
+
# Converts hash and nil to an options object
|
341
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
342
|
+
|
343
|
+
# Customize the options with defaults
|
344
|
+
call_metadata = @config.rpcs.create_session_entity_type.metadata.to_h
|
345
|
+
|
346
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
347
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
348
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
349
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
350
|
+
transports_version_send: [:rest]
|
351
|
+
|
352
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
353
|
+
|
354
|
+
options.apply_defaults timeout: @config.rpcs.create_session_entity_type.timeout,
|
355
|
+
metadata: call_metadata,
|
356
|
+
retry_policy: @config.rpcs.create_session_entity_type.retry_policy
|
357
|
+
|
358
|
+
options.apply_defaults timeout: @config.timeout,
|
359
|
+
metadata: @config.metadata,
|
360
|
+
retry_policy: @config.retry_policy
|
361
|
+
|
362
|
+
@session_entity_types_stub.create_session_entity_type request, options do |result, operation|
|
363
|
+
yield result, operation if block_given?
|
364
|
+
return result
|
365
|
+
end
|
366
|
+
rescue ::Gapic::Rest::Error => e
|
367
|
+
raise ::Google::Cloud::Error.from_error(e)
|
368
|
+
end
|
369
|
+
|
370
|
+
##
|
371
|
+
# Updates the specified session entity type.
|
372
|
+
#
|
373
|
+
# @overload update_session_entity_type(request, options = nil)
|
374
|
+
# Pass arguments to `update_session_entity_type` via a request object, either of type
|
375
|
+
# {::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash.
|
376
|
+
#
|
377
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest, ::Hash]
|
378
|
+
# A request object representing the call parameters. Required. To specify no
|
379
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
380
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
381
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
382
|
+
#
|
383
|
+
# @overload update_session_entity_type(session_entity_type: nil, update_mask: nil)
|
384
|
+
# Pass arguments to `update_session_entity_type` via keyword arguments. Note that at
|
385
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
386
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
387
|
+
#
|
388
|
+
# @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType, ::Hash]
|
389
|
+
# Required. The session entity type to update.
|
390
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
391
|
+
# ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
|
392
|
+
# `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
393
|
+
# ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
|
394
|
+
# Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
|
395
|
+
# environment.
|
396
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
397
|
+
# The mask to control which fields get updated.
|
398
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
399
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
400
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
401
|
+
#
|
402
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
|
403
|
+
#
|
404
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
405
|
+
def update_session_entity_type request, options = nil
|
406
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
407
|
+
|
408
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest
|
409
|
+
|
410
|
+
# Converts hash and nil to an options object
|
411
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
412
|
+
|
413
|
+
# Customize the options with defaults
|
414
|
+
call_metadata = @config.rpcs.update_session_entity_type.metadata.to_h
|
415
|
+
|
416
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
417
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
418
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
419
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
420
|
+
transports_version_send: [:rest]
|
421
|
+
|
422
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
423
|
+
|
424
|
+
options.apply_defaults timeout: @config.rpcs.update_session_entity_type.timeout,
|
425
|
+
metadata: call_metadata,
|
426
|
+
retry_policy: @config.rpcs.update_session_entity_type.retry_policy
|
427
|
+
|
428
|
+
options.apply_defaults timeout: @config.timeout,
|
429
|
+
metadata: @config.metadata,
|
430
|
+
retry_policy: @config.retry_policy
|
431
|
+
|
432
|
+
@session_entity_types_stub.update_session_entity_type request, options do |result, operation|
|
433
|
+
yield result, operation if block_given?
|
434
|
+
return result
|
435
|
+
end
|
436
|
+
rescue ::Gapic::Rest::Error => e
|
437
|
+
raise ::Google::Cloud::Error.from_error(e)
|
438
|
+
end
|
439
|
+
|
440
|
+
##
|
441
|
+
# Deletes the specified session entity type.
|
442
|
+
#
|
443
|
+
# @overload delete_session_entity_type(request, options = nil)
|
444
|
+
# Pass arguments to `delete_session_entity_type` via a request object, either of type
|
445
|
+
# {::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash.
|
446
|
+
#
|
447
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest, ::Hash]
|
448
|
+
# A request object representing the call parameters. Required. To specify no
|
449
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
450
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
451
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
452
|
+
#
|
453
|
+
# @overload delete_session_entity_type(name: nil)
|
454
|
+
# Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at
|
455
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
456
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
457
|
+
#
|
458
|
+
# @param name [::String]
|
459
|
+
# Required. The name of the session entity type to delete.
|
460
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
461
|
+
# ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
|
462
|
+
# `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
463
|
+
# ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
|
464
|
+
# Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
|
465
|
+
# environment.
|
466
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
467
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
468
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
469
|
+
#
|
470
|
+
# @return [::Google::Protobuf::Empty]
|
471
|
+
#
|
472
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
473
|
+
def delete_session_entity_type request, options = nil
|
474
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
475
|
+
|
476
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest
|
477
|
+
|
478
|
+
# Converts hash and nil to an options object
|
479
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
480
|
+
|
481
|
+
# Customize the options with defaults
|
482
|
+
call_metadata = @config.rpcs.delete_session_entity_type.metadata.to_h
|
483
|
+
|
484
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
485
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
486
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
487
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
488
|
+
transports_version_send: [:rest]
|
489
|
+
|
490
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
491
|
+
|
492
|
+
options.apply_defaults timeout: @config.rpcs.delete_session_entity_type.timeout,
|
493
|
+
metadata: call_metadata,
|
494
|
+
retry_policy: @config.rpcs.delete_session_entity_type.retry_policy
|
495
|
+
|
496
|
+
options.apply_defaults timeout: @config.timeout,
|
497
|
+
metadata: @config.metadata,
|
498
|
+
retry_policy: @config.retry_policy
|
499
|
+
|
500
|
+
@session_entity_types_stub.delete_session_entity_type request, options do |result, operation|
|
501
|
+
yield result, operation if block_given?
|
502
|
+
return result
|
503
|
+
end
|
504
|
+
rescue ::Gapic::Rest::Error => e
|
505
|
+
raise ::Google::Cloud::Error.from_error(e)
|
506
|
+
end
|
507
|
+
|
508
|
+
##
|
509
|
+
# Configuration class for the SessionEntityTypes REST API.
|
510
|
+
#
|
511
|
+
# This class represents the configuration for SessionEntityTypes REST,
|
512
|
+
# providing control over timeouts, retry behavior, logging, transport
|
513
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
514
|
+
# applied individually to specific RPCs. See
|
515
|
+
# {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client::Configuration::Rpcs}
|
516
|
+
# for a list of RPCs that can be configured independently.
|
517
|
+
#
|
518
|
+
# Configuration can be applied globally to all clients, or to a single client
|
519
|
+
# on construction.
|
520
|
+
#
|
521
|
+
# @example
|
522
|
+
#
|
523
|
+
# # Modify the global config, setting the timeout for
|
524
|
+
# # list_session_entity_types to 20 seconds,
|
525
|
+
# # and all remaining timeouts to 10 seconds.
|
526
|
+
# ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.configure do |config|
|
527
|
+
# config.timeout = 10.0
|
528
|
+
# config.rpcs.list_session_entity_types.timeout = 20.0
|
529
|
+
# end
|
530
|
+
#
|
531
|
+
# # Apply the above configuration only to a new client.
|
532
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config|
|
533
|
+
# config.timeout = 10.0
|
534
|
+
# config.rpcs.list_session_entity_types.timeout = 20.0
|
535
|
+
# end
|
536
|
+
#
|
537
|
+
# @!attribute [rw] endpoint
|
538
|
+
# The hostname or hostname:port of the service endpoint.
|
539
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
540
|
+
# @return [::String]
|
541
|
+
# @!attribute [rw] credentials
|
542
|
+
# Credentials to send with calls. You may provide any of the following types:
|
543
|
+
# * (`String`) The path to a service account key file in JSON format
|
544
|
+
# * (`Hash`) A service account key as a Hash
|
545
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
546
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
547
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
548
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
549
|
+
# * (`nil`) indicating no credentials
|
550
|
+
# @return [::Object]
|
551
|
+
# @!attribute [rw] scope
|
552
|
+
# The OAuth scopes
|
553
|
+
# @return [::Array<::String>]
|
554
|
+
# @!attribute [rw] lib_name
|
555
|
+
# The library name as recorded in instrumentation and logging
|
556
|
+
# @return [::String]
|
557
|
+
# @!attribute [rw] lib_version
|
558
|
+
# The library version as recorded in instrumentation and logging
|
559
|
+
# @return [::String]
|
560
|
+
# @!attribute [rw] timeout
|
561
|
+
# The call timeout in seconds.
|
562
|
+
# @return [::Numeric]
|
563
|
+
# @!attribute [rw] metadata
|
564
|
+
# Additional headers to be sent with the call.
|
565
|
+
# @return [::Hash{::Symbol=>::String}]
|
566
|
+
# @!attribute [rw] retry_policy
|
567
|
+
# The retry policy. The value is a hash with the following keys:
|
568
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
569
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
570
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
571
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
572
|
+
# trigger a retry.
|
573
|
+
# @return [::Hash]
|
574
|
+
# @!attribute [rw] quota_project
|
575
|
+
# A separate project against which to charge quota.
|
576
|
+
# @return [::String]
|
577
|
+
#
|
578
|
+
class Configuration
|
579
|
+
extend ::Gapic::Config
|
580
|
+
|
581
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
582
|
+
config_attr :credentials, nil do |value|
|
583
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
584
|
+
allowed.any? { |klass| klass === value }
|
585
|
+
end
|
586
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
587
|
+
config_attr :lib_name, nil, ::String, nil
|
588
|
+
config_attr :lib_version, nil, ::String, nil
|
589
|
+
config_attr :timeout, nil, ::Numeric, nil
|
590
|
+
config_attr :metadata, nil, ::Hash, nil
|
591
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
592
|
+
config_attr :quota_project, nil, ::String, nil
|
593
|
+
|
594
|
+
# @private
|
595
|
+
# Overrides for http bindings for the RPCs of this service
|
596
|
+
# are only used when this service is used as mixin, and only
|
597
|
+
# by the host service.
|
598
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
599
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
600
|
+
|
601
|
+
# @private
|
602
|
+
def initialize parent_config = nil
|
603
|
+
@parent_config = parent_config unless parent_config.nil?
|
604
|
+
|
605
|
+
yield self if block_given?
|
606
|
+
end
|
607
|
+
|
608
|
+
##
|
609
|
+
# Configurations for individual RPCs
|
610
|
+
# @return [Rpcs]
|
611
|
+
#
|
612
|
+
def rpcs
|
613
|
+
@rpcs ||= begin
|
614
|
+
parent_rpcs = nil
|
615
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
616
|
+
Rpcs.new parent_rpcs
|
617
|
+
end
|
618
|
+
end
|
619
|
+
|
620
|
+
##
|
621
|
+
# Configuration RPC class for the SessionEntityTypes API.
|
622
|
+
#
|
623
|
+
# Includes fields providing the configuration for each RPC in this service.
|
624
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
625
|
+
# the following configuration fields:
|
626
|
+
#
|
627
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
628
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
629
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
630
|
+
# include the following keys:
|
631
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
632
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
633
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
634
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
635
|
+
# trigger a retry.
|
636
|
+
#
|
637
|
+
class Rpcs
|
638
|
+
##
|
639
|
+
# RPC-specific configuration for `list_session_entity_types`
|
640
|
+
# @return [::Gapic::Config::Method]
|
641
|
+
#
|
642
|
+
attr_reader :list_session_entity_types
|
643
|
+
##
|
644
|
+
# RPC-specific configuration for `get_session_entity_type`
|
645
|
+
# @return [::Gapic::Config::Method]
|
646
|
+
#
|
647
|
+
attr_reader :get_session_entity_type
|
648
|
+
##
|
649
|
+
# RPC-specific configuration for `create_session_entity_type`
|
650
|
+
# @return [::Gapic::Config::Method]
|
651
|
+
#
|
652
|
+
attr_reader :create_session_entity_type
|
653
|
+
##
|
654
|
+
# RPC-specific configuration for `update_session_entity_type`
|
655
|
+
# @return [::Gapic::Config::Method]
|
656
|
+
#
|
657
|
+
attr_reader :update_session_entity_type
|
658
|
+
##
|
659
|
+
# RPC-specific configuration for `delete_session_entity_type`
|
660
|
+
# @return [::Gapic::Config::Method]
|
661
|
+
#
|
662
|
+
attr_reader :delete_session_entity_type
|
663
|
+
|
664
|
+
# @private
|
665
|
+
def initialize parent_rpcs = nil
|
666
|
+
list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types
|
667
|
+
@list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config
|
668
|
+
get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type
|
669
|
+
@get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config
|
670
|
+
create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type
|
671
|
+
@create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config
|
672
|
+
update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type
|
673
|
+
@update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config
|
674
|
+
delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type
|
675
|
+
@delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config
|
676
|
+
|
677
|
+
yield self if block_given?
|
678
|
+
end
|
679
|
+
end
|
680
|
+
end
|
681
|
+
end
|
682
|
+
end
|
683
|
+
end
|
684
|
+
end
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
end
|