google-cloud-dialogflow-cx-v3 0.1.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 +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +32 -0
- data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +122 -0
- data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +82 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +1051 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +666 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +151 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents.rb +52 -0
- data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +94 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +92 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +67 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +766 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +117 -0
- data/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +61 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +950 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +666 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +98 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments.rb +52 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +177 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +61 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +851 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb +102 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +145 -0
- data/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +88 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +1200 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +666 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb +184 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows.rb +52 -0
- data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +97 -0
- data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +67 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +750 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb +96 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +113 -0
- data/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +67 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +805 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb +165 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +77 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +89 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +696 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb +157 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +68 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +715 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb +137 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +209 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +71 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +654 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +225 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +53 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +302 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +73 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +1324 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +666 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb +249 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +53 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +67 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +67 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +766 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb +144 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +30 -0
- data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +88 -0
- data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +792 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +666 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb +79 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions.rb +52 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +172 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +704 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb +96 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +51 -0
- data/lib/google/cloud/dialogflow/cx/v3.rb +53 -0
- data/lib/google-cloud-dialogflow-cx-v3.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +57 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +301 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +322 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +306 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +279 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +438 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +438 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +126 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +318 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +478 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +220 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +222 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +798 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +184 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +757 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +195 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +121 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +182 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +496 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +326 -0
@@ -0,0 +1,766 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/dialogflow/cx/v3/entity_type_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module CX
|
26
|
+
module V3
|
27
|
+
module EntityTypes
|
28
|
+
##
|
29
|
+
# Client for the EntityTypes service.
|
30
|
+
#
|
31
|
+
# Service for managing {::Google::Cloud::Dialogflow::CX::V3::EntityType EntityTypes}.
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :entity_types_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the EntityTypes Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all EntityTypes clients
|
48
|
+
# ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 60.0
|
69
|
+
default_config.retry_policy = {
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
71
|
+
}
|
72
|
+
|
73
|
+
default_config
|
74
|
+
end
|
75
|
+
yield @configure if block_given?
|
76
|
+
@configure
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Configure the EntityTypes Client instance.
|
81
|
+
#
|
82
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
83
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
84
|
+
# should be made on {Client.configure}.
|
85
|
+
#
|
86
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client::Configuration}
|
87
|
+
# for a description of the configuration fields.
|
88
|
+
#
|
89
|
+
# @yield [config] Configure the Client client.
|
90
|
+
# @yieldparam config [Client::Configuration]
|
91
|
+
#
|
92
|
+
# @return [Client::Configuration]
|
93
|
+
#
|
94
|
+
def configure
|
95
|
+
yield @config if block_given?
|
96
|
+
@config
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Create a new EntityTypes client object.
|
101
|
+
#
|
102
|
+
# @example
|
103
|
+
#
|
104
|
+
# # Create a client using the default configuration
|
105
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new
|
106
|
+
#
|
107
|
+
# # Create a client using a custom configuration
|
108
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config|
|
109
|
+
# config.timeout = 10.0
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
# @yield [config] Configure the EntityTypes client.
|
113
|
+
# @yieldparam config [Client::Configuration]
|
114
|
+
#
|
115
|
+
def initialize
|
116
|
+
# These require statements are intentionally placed here to initialize
|
117
|
+
# the gRPC module only when it's required.
|
118
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
119
|
+
require "gapic/grpc"
|
120
|
+
require "google/cloud/dialogflow/cx/v3/entity_type_services_pb"
|
121
|
+
|
122
|
+
# Create the configuration object
|
123
|
+
@config = Configuration.new Client.configure
|
124
|
+
|
125
|
+
# Yield the configuration if needed
|
126
|
+
yield @config if block_given?
|
127
|
+
|
128
|
+
# Create credentials
|
129
|
+
credentials = @config.credentials
|
130
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
131
|
+
# but only if the default endpoint does not have a region prefix.
|
132
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
133
|
+
!@config.endpoint.split(".").first.include?("-")
|
134
|
+
credentials ||= Credentials.default scope: @config.scope,
|
135
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
136
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
137
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
138
|
+
end
|
139
|
+
@quota_project_id = @config.quota_project
|
140
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
141
|
+
|
142
|
+
@entity_types_stub = ::Gapic::ServiceStub.new(
|
143
|
+
::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Stub,
|
144
|
+
credentials: credentials,
|
145
|
+
endpoint: @config.endpoint,
|
146
|
+
channel_args: @config.channel_args,
|
147
|
+
interceptors: @config.interceptors
|
148
|
+
)
|
149
|
+
end
|
150
|
+
|
151
|
+
# Service calls
|
152
|
+
|
153
|
+
##
|
154
|
+
# Returns the list of all entity types in the specified agent.
|
155
|
+
#
|
156
|
+
# @overload list_entity_types(request, options = nil)
|
157
|
+
# Pass arguments to `list_entity_types` via a request object, either of type
|
158
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest} or an equivalent Hash.
|
159
|
+
#
|
160
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::Hash]
|
161
|
+
# A request object representing the call parameters. Required. To specify no
|
162
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
163
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
164
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
165
|
+
#
|
166
|
+
# @overload list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil)
|
167
|
+
# Pass arguments to `list_entity_types` via keyword arguments. Note that at
|
168
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
169
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
170
|
+
#
|
171
|
+
# @param parent [::String]
|
172
|
+
# Required. The agent to list all entity types for.
|
173
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
174
|
+
# @param language_code [::String]
|
175
|
+
# The language to list entity types for. The following fields are language
|
176
|
+
# dependent:
|
177
|
+
#
|
178
|
+
# * `EntityType.entities.value`
|
179
|
+
# * `EntityType.entities.synonyms`
|
180
|
+
# * `EntityType.excluded_phrases.value`
|
181
|
+
#
|
182
|
+
# If not specified, the agent's default language is used.
|
183
|
+
# [Many
|
184
|
+
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
185
|
+
# are supported.
|
186
|
+
# Note: languages must be enabled in the agent before they can be used.
|
187
|
+
# @param page_size [::Integer]
|
188
|
+
# The maximum number of items to return in a single page. By default 100 and
|
189
|
+
# at most 1000.
|
190
|
+
# @param page_token [::String]
|
191
|
+
# The next_page_token value returned from a previous list request.
|
192
|
+
#
|
193
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
194
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
195
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
196
|
+
#
|
197
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
198
|
+
#
|
199
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
200
|
+
#
|
201
|
+
def list_entity_types request, options = nil
|
202
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
203
|
+
|
204
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest
|
205
|
+
|
206
|
+
# Converts hash and nil to an options object
|
207
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
208
|
+
|
209
|
+
# Customize the options with defaults
|
210
|
+
metadata = @config.rpcs.list_entity_types.metadata.to_h
|
211
|
+
|
212
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
213
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
214
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
215
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
216
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
217
|
+
|
218
|
+
header_params = {
|
219
|
+
"parent" => request.parent
|
220
|
+
}
|
221
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
222
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
223
|
+
|
224
|
+
options.apply_defaults timeout: @config.rpcs.list_entity_types.timeout,
|
225
|
+
metadata: metadata,
|
226
|
+
retry_policy: @config.rpcs.list_entity_types.retry_policy
|
227
|
+
|
228
|
+
options.apply_defaults timeout: @config.timeout,
|
229
|
+
metadata: @config.metadata,
|
230
|
+
retry_policy: @config.retry_policy
|
231
|
+
|
232
|
+
@entity_types_stub.call_rpc :list_entity_types, request, options: options do |response, operation|
|
233
|
+
response = ::Gapic::PagedEnumerable.new @entity_types_stub, :list_entity_types, request, response, operation, options
|
234
|
+
yield response, operation if block_given?
|
235
|
+
return response
|
236
|
+
end
|
237
|
+
rescue ::GRPC::BadStatus => e
|
238
|
+
raise ::Google::Cloud::Error.from_error(e)
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Retrieves the specified entity type.
|
243
|
+
#
|
244
|
+
# @overload get_entity_type(request, options = nil)
|
245
|
+
# Pass arguments to `get_entity_type` via a request object, either of type
|
246
|
+
# {::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest} or an equivalent Hash.
|
247
|
+
#
|
248
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest, ::Hash]
|
249
|
+
# A request object representing the call parameters. Required. To specify no
|
250
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
251
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
252
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
253
|
+
#
|
254
|
+
# @overload get_entity_type(name: nil, language_code: nil)
|
255
|
+
# Pass arguments to `get_entity_type` via keyword arguments. Note that at
|
256
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
257
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
258
|
+
#
|
259
|
+
# @param name [::String]
|
260
|
+
# Required. The name of the entity type.
|
261
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
262
|
+
# ID>/entityTypes/<Entity Type ID>`.
|
263
|
+
# @param language_code [::String]
|
264
|
+
# The language to retrieve the entity type for. The following fields are
|
265
|
+
# language dependent:
|
266
|
+
#
|
267
|
+
# * `EntityType.entities.value`
|
268
|
+
# * `EntityType.entities.synonyms`
|
269
|
+
# * `EntityType.excluded_phrases.value`
|
270
|
+
#
|
271
|
+
# If not specified, the agent's default language is used.
|
272
|
+
# [Many
|
273
|
+
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
274
|
+
# are supported.
|
275
|
+
# Note: languages must be enabled in the agent before they can be used.
|
276
|
+
#
|
277
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
278
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
279
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
280
|
+
#
|
281
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
282
|
+
#
|
283
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
284
|
+
#
|
285
|
+
def get_entity_type request, options = nil
|
286
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
287
|
+
|
288
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest
|
289
|
+
|
290
|
+
# Converts hash and nil to an options object
|
291
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
292
|
+
|
293
|
+
# Customize the options with defaults
|
294
|
+
metadata = @config.rpcs.get_entity_type.metadata.to_h
|
295
|
+
|
296
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
297
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
298
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
299
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
300
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
301
|
+
|
302
|
+
header_params = {
|
303
|
+
"name" => request.name
|
304
|
+
}
|
305
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
306
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
307
|
+
|
308
|
+
options.apply_defaults timeout: @config.rpcs.get_entity_type.timeout,
|
309
|
+
metadata: metadata,
|
310
|
+
retry_policy: @config.rpcs.get_entity_type.retry_policy
|
311
|
+
|
312
|
+
options.apply_defaults timeout: @config.timeout,
|
313
|
+
metadata: @config.metadata,
|
314
|
+
retry_policy: @config.retry_policy
|
315
|
+
|
316
|
+
@entity_types_stub.call_rpc :get_entity_type, request, options: options do |response, operation|
|
317
|
+
yield response, operation if block_given?
|
318
|
+
return response
|
319
|
+
end
|
320
|
+
rescue ::GRPC::BadStatus => e
|
321
|
+
raise ::Google::Cloud::Error.from_error(e)
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# Creates an entity type in the specified agent.
|
326
|
+
#
|
327
|
+
# Note: You should always train a flow prior to sending it queries. See the
|
328
|
+
# [training
|
329
|
+
# documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
330
|
+
#
|
331
|
+
# @overload create_entity_type(request, options = nil)
|
332
|
+
# Pass arguments to `create_entity_type` via a request object, either of type
|
333
|
+
# {::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest} or an equivalent Hash.
|
334
|
+
#
|
335
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest, ::Hash]
|
336
|
+
# A request object representing the call parameters. Required. To specify no
|
337
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
338
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
339
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
340
|
+
#
|
341
|
+
# @overload create_entity_type(parent: nil, entity_type: nil, language_code: nil)
|
342
|
+
# Pass arguments to `create_entity_type` via keyword arguments. Note that at
|
343
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
344
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
345
|
+
#
|
346
|
+
# @param parent [::String]
|
347
|
+
# Required. The agent to create a entity type for.
|
348
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
349
|
+
# @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash]
|
350
|
+
# Required. The entity type to create.
|
351
|
+
# @param language_code [::String]
|
352
|
+
# The language of the following fields in `entity_type`:
|
353
|
+
#
|
354
|
+
# * `EntityType.entities.value`
|
355
|
+
# * `EntityType.entities.synonyms`
|
356
|
+
# * `EntityType.excluded_phrases.value`
|
357
|
+
#
|
358
|
+
# If not specified, the agent's default language is used.
|
359
|
+
# [Many
|
360
|
+
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
361
|
+
# are supported.
|
362
|
+
# Note: languages must be enabled in the agent before they can be used.
|
363
|
+
#
|
364
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
365
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
366
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
367
|
+
#
|
368
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
369
|
+
#
|
370
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
371
|
+
#
|
372
|
+
def create_entity_type request, options = nil
|
373
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
374
|
+
|
375
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest
|
376
|
+
|
377
|
+
# Converts hash and nil to an options object
|
378
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
379
|
+
|
380
|
+
# Customize the options with defaults
|
381
|
+
metadata = @config.rpcs.create_entity_type.metadata.to_h
|
382
|
+
|
383
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
384
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
385
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
386
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
387
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
388
|
+
|
389
|
+
header_params = {
|
390
|
+
"parent" => request.parent
|
391
|
+
}
|
392
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
393
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
394
|
+
|
395
|
+
options.apply_defaults timeout: @config.rpcs.create_entity_type.timeout,
|
396
|
+
metadata: metadata,
|
397
|
+
retry_policy: @config.rpcs.create_entity_type.retry_policy
|
398
|
+
|
399
|
+
options.apply_defaults timeout: @config.timeout,
|
400
|
+
metadata: @config.metadata,
|
401
|
+
retry_policy: @config.retry_policy
|
402
|
+
|
403
|
+
@entity_types_stub.call_rpc :create_entity_type, request, options: options do |response, operation|
|
404
|
+
yield response, operation if block_given?
|
405
|
+
return response
|
406
|
+
end
|
407
|
+
rescue ::GRPC::BadStatus => e
|
408
|
+
raise ::Google::Cloud::Error.from_error(e)
|
409
|
+
end
|
410
|
+
|
411
|
+
##
|
412
|
+
# Updates the specified entity type.
|
413
|
+
#
|
414
|
+
# Note: You should always train a flow prior to sending it queries. See the
|
415
|
+
# [training
|
416
|
+
# documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
417
|
+
#
|
418
|
+
# @overload update_entity_type(request, options = nil)
|
419
|
+
# Pass arguments to `update_entity_type` via a request object, either of type
|
420
|
+
# {::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest} or an equivalent Hash.
|
421
|
+
#
|
422
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest, ::Hash]
|
423
|
+
# A request object representing the call parameters. Required. To specify no
|
424
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
425
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
426
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
427
|
+
#
|
428
|
+
# @overload update_entity_type(entity_type: nil, language_code: nil, update_mask: nil)
|
429
|
+
# Pass arguments to `update_entity_type` via keyword arguments. Note that at
|
430
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
431
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
432
|
+
#
|
433
|
+
# @param entity_type [::Google::Cloud::Dialogflow::CX::V3::EntityType, ::Hash]
|
434
|
+
# Required. The entity type to update.
|
435
|
+
# @param language_code [::String]
|
436
|
+
# The language of the following fields in `entity_type`:
|
437
|
+
#
|
438
|
+
# * `EntityType.entities.value`
|
439
|
+
# * `EntityType.entities.synonyms`
|
440
|
+
# * `EntityType.excluded_phrases.value`
|
441
|
+
#
|
442
|
+
# If not specified, the agent's default language is used.
|
443
|
+
# [Many
|
444
|
+
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
445
|
+
# are supported.
|
446
|
+
# Note: languages must be enabled in the agent before they can be used.
|
447
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
448
|
+
# The mask to control which fields get updated.
|
449
|
+
#
|
450
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
451
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
452
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
453
|
+
#
|
454
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
455
|
+
#
|
456
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
457
|
+
#
|
458
|
+
def update_entity_type request, options = nil
|
459
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
460
|
+
|
461
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest
|
462
|
+
|
463
|
+
# Converts hash and nil to an options object
|
464
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
465
|
+
|
466
|
+
# Customize the options with defaults
|
467
|
+
metadata = @config.rpcs.update_entity_type.metadata.to_h
|
468
|
+
|
469
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
470
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
471
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
472
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
473
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
474
|
+
|
475
|
+
header_params = {
|
476
|
+
"entity_type.name" => request.entity_type.name
|
477
|
+
}
|
478
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
479
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
480
|
+
|
481
|
+
options.apply_defaults timeout: @config.rpcs.update_entity_type.timeout,
|
482
|
+
metadata: metadata,
|
483
|
+
retry_policy: @config.rpcs.update_entity_type.retry_policy
|
484
|
+
|
485
|
+
options.apply_defaults timeout: @config.timeout,
|
486
|
+
metadata: @config.metadata,
|
487
|
+
retry_policy: @config.retry_policy
|
488
|
+
|
489
|
+
@entity_types_stub.call_rpc :update_entity_type, request, options: options do |response, operation|
|
490
|
+
yield response, operation if block_given?
|
491
|
+
return response
|
492
|
+
end
|
493
|
+
rescue ::GRPC::BadStatus => e
|
494
|
+
raise ::Google::Cloud::Error.from_error(e)
|
495
|
+
end
|
496
|
+
|
497
|
+
##
|
498
|
+
# Deletes the specified entity type.
|
499
|
+
#
|
500
|
+
# Note: You should always train a flow prior to sending it queries. See the
|
501
|
+
# [training
|
502
|
+
# documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
503
|
+
#
|
504
|
+
# @overload delete_entity_type(request, options = nil)
|
505
|
+
# Pass arguments to `delete_entity_type` via a request object, either of type
|
506
|
+
# {::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest} or an equivalent Hash.
|
507
|
+
#
|
508
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest, ::Hash]
|
509
|
+
# A request object representing the call parameters. Required. To specify no
|
510
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
511
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
512
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
513
|
+
#
|
514
|
+
# @overload delete_entity_type(name: nil, force: nil)
|
515
|
+
# Pass arguments to `delete_entity_type` via keyword arguments. Note that at
|
516
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
517
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
518
|
+
#
|
519
|
+
# @param name [::String]
|
520
|
+
# Required. The name of the entity type to delete.
|
521
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
522
|
+
# ID>/entityTypes/<Entity Type ID>`.
|
523
|
+
# @param force [::Boolean]
|
524
|
+
# This field has no effect for entity type not being used.
|
525
|
+
# For entity types that are used by intents or pages:
|
526
|
+
#
|
527
|
+
# * If `force` is set to false, an error will be returned with message
|
528
|
+
# indicating the referencing resources.
|
529
|
+
# * If `force` is set to true, Dialogflow will remove the entity type, as
|
530
|
+
# well as any references to the entity type (i.e. Page
|
531
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Form::Parameter parameter} of the entity type will be changed to
|
532
|
+
# '@sys.any' and intent {::Google::Cloud::Dialogflow::CX::V3::Intent::Parameter parameter} of the entity type
|
533
|
+
# will be removed).
|
534
|
+
#
|
535
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
536
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
537
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
538
|
+
#
|
539
|
+
# @return [::Google::Protobuf::Empty]
|
540
|
+
#
|
541
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
542
|
+
#
|
543
|
+
def delete_entity_type request, options = nil
|
544
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
545
|
+
|
546
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest
|
547
|
+
|
548
|
+
# Converts hash and nil to an options object
|
549
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
550
|
+
|
551
|
+
# Customize the options with defaults
|
552
|
+
metadata = @config.rpcs.delete_entity_type.metadata.to_h
|
553
|
+
|
554
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
555
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
556
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
557
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
558
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
559
|
+
|
560
|
+
header_params = {
|
561
|
+
"name" => request.name
|
562
|
+
}
|
563
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
564
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
565
|
+
|
566
|
+
options.apply_defaults timeout: @config.rpcs.delete_entity_type.timeout,
|
567
|
+
metadata: metadata,
|
568
|
+
retry_policy: @config.rpcs.delete_entity_type.retry_policy
|
569
|
+
|
570
|
+
options.apply_defaults timeout: @config.timeout,
|
571
|
+
metadata: @config.metadata,
|
572
|
+
retry_policy: @config.retry_policy
|
573
|
+
|
574
|
+
@entity_types_stub.call_rpc :delete_entity_type, request, options: options do |response, operation|
|
575
|
+
yield response, operation if block_given?
|
576
|
+
return response
|
577
|
+
end
|
578
|
+
rescue ::GRPC::BadStatus => e
|
579
|
+
raise ::Google::Cloud::Error.from_error(e)
|
580
|
+
end
|
581
|
+
|
582
|
+
##
|
583
|
+
# Configuration class for the EntityTypes API.
|
584
|
+
#
|
585
|
+
# This class represents the configuration for EntityTypes,
|
586
|
+
# providing control over timeouts, retry behavior, logging, transport
|
587
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
588
|
+
# applied individually to specific RPCs. See
|
589
|
+
# {::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client::Configuration::Rpcs}
|
590
|
+
# for a list of RPCs that can be configured independently.
|
591
|
+
#
|
592
|
+
# Configuration can be applied globally to all clients, or to a single client
|
593
|
+
# on construction.
|
594
|
+
#
|
595
|
+
# @example
|
596
|
+
#
|
597
|
+
# # Modify the global config, setting the timeout for
|
598
|
+
# # list_entity_types to 20 seconds,
|
599
|
+
# # and all remaining timeouts to 10 seconds.
|
600
|
+
# ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.configure do |config|
|
601
|
+
# config.timeout = 10.0
|
602
|
+
# config.rpcs.list_entity_types.timeout = 20.0
|
603
|
+
# end
|
604
|
+
#
|
605
|
+
# # Apply the above configuration only to a new client.
|
606
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config|
|
607
|
+
# config.timeout = 10.0
|
608
|
+
# config.rpcs.list_entity_types.timeout = 20.0
|
609
|
+
# end
|
610
|
+
#
|
611
|
+
# @!attribute [rw] endpoint
|
612
|
+
# The hostname or hostname:port of the service endpoint.
|
613
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
614
|
+
# @return [::String]
|
615
|
+
# @!attribute [rw] credentials
|
616
|
+
# Credentials to send with calls. You may provide any of the following types:
|
617
|
+
# * (`String`) The path to a service account key file in JSON format
|
618
|
+
# * (`Hash`) A service account key as a Hash
|
619
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
620
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
621
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
622
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
623
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
624
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
625
|
+
# * (`nil`) indicating no credentials
|
626
|
+
# @return [::Object]
|
627
|
+
# @!attribute [rw] scope
|
628
|
+
# The OAuth scopes
|
629
|
+
# @return [::Array<::String>]
|
630
|
+
# @!attribute [rw] lib_name
|
631
|
+
# The library name as recorded in instrumentation and logging
|
632
|
+
# @return [::String]
|
633
|
+
# @!attribute [rw] lib_version
|
634
|
+
# The library version as recorded in instrumentation and logging
|
635
|
+
# @return [::String]
|
636
|
+
# @!attribute [rw] channel_args
|
637
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
638
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
639
|
+
# @return [::Hash]
|
640
|
+
# @!attribute [rw] interceptors
|
641
|
+
# An array of interceptors that are run before calls are executed.
|
642
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
643
|
+
# @!attribute [rw] timeout
|
644
|
+
# The call timeout in seconds.
|
645
|
+
# @return [::Numeric]
|
646
|
+
# @!attribute [rw] metadata
|
647
|
+
# Additional gRPC headers to be sent with the call.
|
648
|
+
# @return [::Hash{::Symbol=>::String}]
|
649
|
+
# @!attribute [rw] retry_policy
|
650
|
+
# The retry policy. The value is a hash with the following keys:
|
651
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
652
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
653
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
654
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
655
|
+
# trigger a retry.
|
656
|
+
# @return [::Hash]
|
657
|
+
# @!attribute [rw] quota_project
|
658
|
+
# A separate project against which to charge quota.
|
659
|
+
# @return [::String]
|
660
|
+
#
|
661
|
+
class Configuration
|
662
|
+
extend ::Gapic::Config
|
663
|
+
|
664
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
665
|
+
config_attr :credentials, nil do |value|
|
666
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
667
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
668
|
+
allowed.any? { |klass| klass === value }
|
669
|
+
end
|
670
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
671
|
+
config_attr :lib_name, nil, ::String, nil
|
672
|
+
config_attr :lib_version, nil, ::String, nil
|
673
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
674
|
+
config_attr :interceptors, nil, ::Array, nil
|
675
|
+
config_attr :timeout, nil, ::Numeric, nil
|
676
|
+
config_attr :metadata, nil, ::Hash, nil
|
677
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
678
|
+
config_attr :quota_project, nil, ::String, nil
|
679
|
+
|
680
|
+
# @private
|
681
|
+
def initialize parent_config = nil
|
682
|
+
@parent_config = parent_config unless parent_config.nil?
|
683
|
+
|
684
|
+
yield self if block_given?
|
685
|
+
end
|
686
|
+
|
687
|
+
##
|
688
|
+
# Configurations for individual RPCs
|
689
|
+
# @return [Rpcs]
|
690
|
+
#
|
691
|
+
def rpcs
|
692
|
+
@rpcs ||= begin
|
693
|
+
parent_rpcs = nil
|
694
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
695
|
+
Rpcs.new parent_rpcs
|
696
|
+
end
|
697
|
+
end
|
698
|
+
|
699
|
+
##
|
700
|
+
# Configuration RPC class for the EntityTypes API.
|
701
|
+
#
|
702
|
+
# Includes fields providing the configuration for each RPC in this service.
|
703
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
704
|
+
# the following configuration fields:
|
705
|
+
#
|
706
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
707
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
708
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
709
|
+
# include the following keys:
|
710
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
711
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
712
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
713
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
714
|
+
# trigger a retry.
|
715
|
+
#
|
716
|
+
class Rpcs
|
717
|
+
##
|
718
|
+
# RPC-specific configuration for `list_entity_types`
|
719
|
+
# @return [::Gapic::Config::Method]
|
720
|
+
#
|
721
|
+
attr_reader :list_entity_types
|
722
|
+
##
|
723
|
+
# RPC-specific configuration for `get_entity_type`
|
724
|
+
# @return [::Gapic::Config::Method]
|
725
|
+
#
|
726
|
+
attr_reader :get_entity_type
|
727
|
+
##
|
728
|
+
# RPC-specific configuration for `create_entity_type`
|
729
|
+
# @return [::Gapic::Config::Method]
|
730
|
+
#
|
731
|
+
attr_reader :create_entity_type
|
732
|
+
##
|
733
|
+
# RPC-specific configuration for `update_entity_type`
|
734
|
+
# @return [::Gapic::Config::Method]
|
735
|
+
#
|
736
|
+
attr_reader :update_entity_type
|
737
|
+
##
|
738
|
+
# RPC-specific configuration for `delete_entity_type`
|
739
|
+
# @return [::Gapic::Config::Method]
|
740
|
+
#
|
741
|
+
attr_reader :delete_entity_type
|
742
|
+
|
743
|
+
# @private
|
744
|
+
def initialize parent_rpcs = nil
|
745
|
+
list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
|
746
|
+
@list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
|
747
|
+
get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type
|
748
|
+
@get_entity_type = ::Gapic::Config::Method.new get_entity_type_config
|
749
|
+
create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type
|
750
|
+
@create_entity_type = ::Gapic::Config::Method.new create_entity_type_config
|
751
|
+
update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type
|
752
|
+
@update_entity_type = ::Gapic::Config::Method.new update_entity_type_config
|
753
|
+
delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type
|
754
|
+
@delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config
|
755
|
+
|
756
|
+
yield self if block_given?
|
757
|
+
end
|
758
|
+
end
|
759
|
+
end
|
760
|
+
end
|
761
|
+
end
|
762
|
+
end
|
763
|
+
end
|
764
|
+
end
|
765
|
+
end
|
766
|
+
end
|