google-cloud-dialogflow-cx-v3 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,792 @@
|
|
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/version_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module CX
|
26
|
+
module V3
|
27
|
+
module Versions
|
28
|
+
##
|
29
|
+
# Client for the Versions service.
|
30
|
+
#
|
31
|
+
# Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}.
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :versions_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the Versions Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::Versions::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all Versions clients
|
48
|
+
# ::Google::Cloud::Dialogflow::CX::V3::Versions::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 Versions 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::Versions::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 Versions client object.
|
101
|
+
#
|
102
|
+
# @example
|
103
|
+
#
|
104
|
+
# # Create a client using the default configuration
|
105
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
|
106
|
+
#
|
107
|
+
# # Create a client using a custom configuration
|
108
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config|
|
109
|
+
# config.timeout = 10.0
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
# @yield [config] Configure the Versions 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/version_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
|
+
@operations_client = Operations.new do |config|
|
143
|
+
config.credentials = credentials
|
144
|
+
config.endpoint = @config.endpoint
|
145
|
+
end
|
146
|
+
|
147
|
+
@versions_stub = ::Gapic::ServiceStub.new(
|
148
|
+
::Google::Cloud::Dialogflow::CX::V3::Versions::Stub,
|
149
|
+
credentials: credentials,
|
150
|
+
endpoint: @config.endpoint,
|
151
|
+
channel_args: @config.channel_args,
|
152
|
+
interceptors: @config.interceptors
|
153
|
+
)
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Get the associated client for long-running operations.
|
158
|
+
#
|
159
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Versions::Operations]
|
160
|
+
#
|
161
|
+
attr_reader :operations_client
|
162
|
+
|
163
|
+
# Service calls
|
164
|
+
|
165
|
+
##
|
166
|
+
# Returns the list of all versions in the specified {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}.
|
167
|
+
#
|
168
|
+
# @overload list_versions(request, options = nil)
|
169
|
+
# Pass arguments to `list_versions` via a request object, either of type
|
170
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest} or an equivalent Hash.
|
171
|
+
#
|
172
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest, ::Hash]
|
173
|
+
# A request object representing the call parameters. Required. To specify no
|
174
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
175
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
176
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
177
|
+
#
|
178
|
+
# @overload list_versions(parent: nil, page_size: nil, page_token: nil)
|
179
|
+
# Pass arguments to `list_versions` via keyword arguments. Note that at
|
180
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
181
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
182
|
+
#
|
183
|
+
# @param parent [::String]
|
184
|
+
# Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to list all versions for.
|
185
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
186
|
+
# ID>/flows/<Flow ID>`.
|
187
|
+
# @param page_size [::Integer]
|
188
|
+
# The maximum number of items to return in a single page. By default 20 and
|
189
|
+
# at most 100.
|
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::Version>]
|
195
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
196
|
+
#
|
197
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>]
|
198
|
+
#
|
199
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
200
|
+
#
|
201
|
+
def list_versions 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::ListVersionsRequest
|
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_versions.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_versions.timeout,
|
225
|
+
metadata: metadata,
|
226
|
+
retry_policy: @config.rpcs.list_versions.retry_policy
|
227
|
+
|
228
|
+
options.apply_defaults timeout: @config.timeout,
|
229
|
+
metadata: @config.metadata,
|
230
|
+
retry_policy: @config.retry_policy
|
231
|
+
|
232
|
+
@versions_stub.call_rpc :list_versions, request, options: options do |response, operation|
|
233
|
+
response = ::Gapic::PagedEnumerable.new @versions_stub, :list_versions, 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}.
|
243
|
+
#
|
244
|
+
# @overload get_version(request, options = nil)
|
245
|
+
# Pass arguments to `get_version` via a request object, either of type
|
246
|
+
# {::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest} or an equivalent Hash.
|
247
|
+
#
|
248
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest, ::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_version(name: nil)
|
255
|
+
# Pass arguments to `get_version` 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 {::Google::Cloud::Dialogflow::CX::V3::Version Version}.
|
261
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
262
|
+
# ID>/flows/<Flow ID>/versions/<Version ID>`.
|
263
|
+
#
|
264
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
265
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version]
|
266
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
267
|
+
#
|
268
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Version]
|
269
|
+
#
|
270
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
271
|
+
#
|
272
|
+
def get_version request, options = nil
|
273
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
274
|
+
|
275
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetVersionRequest
|
276
|
+
|
277
|
+
# Converts hash and nil to an options object
|
278
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
279
|
+
|
280
|
+
# Customize the options with defaults
|
281
|
+
metadata = @config.rpcs.get_version.metadata.to_h
|
282
|
+
|
283
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
284
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
285
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
286
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
287
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
288
|
+
|
289
|
+
header_params = {
|
290
|
+
"name" => request.name
|
291
|
+
}
|
292
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
293
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
294
|
+
|
295
|
+
options.apply_defaults timeout: @config.rpcs.get_version.timeout,
|
296
|
+
metadata: metadata,
|
297
|
+
retry_policy: @config.rpcs.get_version.retry_policy
|
298
|
+
|
299
|
+
options.apply_defaults timeout: @config.timeout,
|
300
|
+
metadata: @config.metadata,
|
301
|
+
retry_policy: @config.retry_policy
|
302
|
+
|
303
|
+
@versions_stub.call_rpc :get_version, request, options: options do |response, operation|
|
304
|
+
yield response, operation if block_given?
|
305
|
+
return response
|
306
|
+
end
|
307
|
+
rescue ::GRPC::BadStatus => e
|
308
|
+
raise ::Google::Cloud::Error.from_error(e)
|
309
|
+
end
|
310
|
+
|
311
|
+
##
|
312
|
+
# Creates a {::Google::Cloud::Dialogflow::CX::V3::Version Version} in the specified {::Google::Cloud::Dialogflow::CX::V3::Flow Flow}.
|
313
|
+
#
|
314
|
+
# @overload create_version(request, options = nil)
|
315
|
+
# Pass arguments to `create_version` via a request object, either of type
|
316
|
+
# {::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest} or an equivalent Hash.
|
317
|
+
#
|
318
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest, ::Hash]
|
319
|
+
# A request object representing the call parameters. Required. To specify no
|
320
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
321
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
322
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
323
|
+
#
|
324
|
+
# @overload create_version(parent: nil, version: nil)
|
325
|
+
# Pass arguments to `create_version` via keyword arguments. Note that at
|
326
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
327
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
328
|
+
#
|
329
|
+
# @param parent [::String]
|
330
|
+
# Required. The {::Google::Cloud::Dialogflow::CX::V3::Flow Flow} to create an {::Google::Cloud::Dialogflow::CX::V3::Version Version} for.
|
331
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
332
|
+
# ID>/flows/<Flow ID>`.
|
333
|
+
# @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash]
|
334
|
+
# Required. The version to create.
|
335
|
+
#
|
336
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
337
|
+
# @yieldparam response [::Gapic::Operation]
|
338
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
339
|
+
#
|
340
|
+
# @return [::Gapic::Operation]
|
341
|
+
#
|
342
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
343
|
+
#
|
344
|
+
def create_version request, options = nil
|
345
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
346
|
+
|
347
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest
|
348
|
+
|
349
|
+
# Converts hash and nil to an options object
|
350
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
351
|
+
|
352
|
+
# Customize the options with defaults
|
353
|
+
metadata = @config.rpcs.create_version.metadata.to_h
|
354
|
+
|
355
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
356
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
357
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
358
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
359
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
360
|
+
|
361
|
+
header_params = {
|
362
|
+
"parent" => request.parent
|
363
|
+
}
|
364
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
365
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
366
|
+
|
367
|
+
options.apply_defaults timeout: @config.rpcs.create_version.timeout,
|
368
|
+
metadata: metadata,
|
369
|
+
retry_policy: @config.rpcs.create_version.retry_policy
|
370
|
+
|
371
|
+
options.apply_defaults timeout: @config.timeout,
|
372
|
+
metadata: @config.metadata,
|
373
|
+
retry_policy: @config.retry_policy
|
374
|
+
|
375
|
+
@versions_stub.call_rpc :create_version, request, options: options do |response, operation|
|
376
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
377
|
+
yield response, operation if block_given?
|
378
|
+
return response
|
379
|
+
end
|
380
|
+
rescue ::GRPC::BadStatus => e
|
381
|
+
raise ::Google::Cloud::Error.from_error(e)
|
382
|
+
end
|
383
|
+
|
384
|
+
##
|
385
|
+
# Updates the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}.
|
386
|
+
#
|
387
|
+
# @overload update_version(request, options = nil)
|
388
|
+
# Pass arguments to `update_version` via a request object, either of type
|
389
|
+
# {::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest} or an equivalent Hash.
|
390
|
+
#
|
391
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest, ::Hash]
|
392
|
+
# A request object representing the call parameters. Required. To specify no
|
393
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
394
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
395
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
396
|
+
#
|
397
|
+
# @overload update_version(version: nil, update_mask: nil)
|
398
|
+
# Pass arguments to `update_version` via keyword arguments. Note that at
|
399
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
400
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
401
|
+
#
|
402
|
+
# @param version [::Google::Cloud::Dialogflow::CX::V3::Version, ::Hash]
|
403
|
+
# Required. The version to update.
|
404
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
405
|
+
# Required. The mask to control which fields get updated. Currently only `description`
|
406
|
+
# and `display_name` can be updated.
|
407
|
+
#
|
408
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
409
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Version]
|
410
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
411
|
+
#
|
412
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Version]
|
413
|
+
#
|
414
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
415
|
+
#
|
416
|
+
def update_version request, options = nil
|
417
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
418
|
+
|
419
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest
|
420
|
+
|
421
|
+
# Converts hash and nil to an options object
|
422
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
423
|
+
|
424
|
+
# Customize the options with defaults
|
425
|
+
metadata = @config.rpcs.update_version.metadata.to_h
|
426
|
+
|
427
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
428
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
429
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
430
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
431
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
432
|
+
|
433
|
+
header_params = {
|
434
|
+
"version.name" => request.version.name
|
435
|
+
}
|
436
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
437
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
438
|
+
|
439
|
+
options.apply_defaults timeout: @config.rpcs.update_version.timeout,
|
440
|
+
metadata: metadata,
|
441
|
+
retry_policy: @config.rpcs.update_version.retry_policy
|
442
|
+
|
443
|
+
options.apply_defaults timeout: @config.timeout,
|
444
|
+
metadata: @config.metadata,
|
445
|
+
retry_policy: @config.retry_policy
|
446
|
+
|
447
|
+
@versions_stub.call_rpc :update_version, request, options: options do |response, operation|
|
448
|
+
yield response, operation if block_given?
|
449
|
+
return response
|
450
|
+
end
|
451
|
+
rescue ::GRPC::BadStatus => e
|
452
|
+
raise ::Google::Cloud::Error.from_error(e)
|
453
|
+
end
|
454
|
+
|
455
|
+
##
|
456
|
+
# Deletes the specified {::Google::Cloud::Dialogflow::CX::V3::Version Version}.
|
457
|
+
#
|
458
|
+
# @overload delete_version(request, options = nil)
|
459
|
+
# Pass arguments to `delete_version` via a request object, either of type
|
460
|
+
# {::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest} or an equivalent Hash.
|
461
|
+
#
|
462
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest, ::Hash]
|
463
|
+
# A request object representing the call parameters. Required. To specify no
|
464
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
465
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
466
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
467
|
+
#
|
468
|
+
# @overload delete_version(name: nil)
|
469
|
+
# Pass arguments to `delete_version` via keyword arguments. Note that at
|
470
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
471
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
472
|
+
#
|
473
|
+
# @param name [::String]
|
474
|
+
# Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Version Version} to delete.
|
475
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
476
|
+
# ID>/flows/<Flow ID>/versions/<Version ID>`.
|
477
|
+
#
|
478
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
479
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
480
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
481
|
+
#
|
482
|
+
# @return [::Google::Protobuf::Empty]
|
483
|
+
#
|
484
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
485
|
+
#
|
486
|
+
def delete_version request, options = nil
|
487
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
488
|
+
|
489
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest
|
490
|
+
|
491
|
+
# Converts hash and nil to an options object
|
492
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
493
|
+
|
494
|
+
# Customize the options with defaults
|
495
|
+
metadata = @config.rpcs.delete_version.metadata.to_h
|
496
|
+
|
497
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
498
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
499
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
500
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
501
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
502
|
+
|
503
|
+
header_params = {
|
504
|
+
"name" => request.name
|
505
|
+
}
|
506
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
507
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
508
|
+
|
509
|
+
options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
|
510
|
+
metadata: metadata,
|
511
|
+
retry_policy: @config.rpcs.delete_version.retry_policy
|
512
|
+
|
513
|
+
options.apply_defaults timeout: @config.timeout,
|
514
|
+
metadata: @config.metadata,
|
515
|
+
retry_policy: @config.retry_policy
|
516
|
+
|
517
|
+
@versions_stub.call_rpc :delete_version, request, options: options do |response, operation|
|
518
|
+
yield response, operation if block_given?
|
519
|
+
return response
|
520
|
+
end
|
521
|
+
rescue ::GRPC::BadStatus => e
|
522
|
+
raise ::Google::Cloud::Error.from_error(e)
|
523
|
+
end
|
524
|
+
|
525
|
+
##
|
526
|
+
# Loads resources in the specified version to the draft flow.
|
527
|
+
#
|
528
|
+
# @overload load_version(request, options = nil)
|
529
|
+
# Pass arguments to `load_version` via a request object, either of type
|
530
|
+
# {::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest} or an equivalent Hash.
|
531
|
+
#
|
532
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Hash]
|
533
|
+
# A request object representing the call parameters. Required. To specify no
|
534
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
535
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
536
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
537
|
+
#
|
538
|
+
# @overload load_version(name: nil, allow_override_agent_resources: nil)
|
539
|
+
# Pass arguments to `load_version` via keyword arguments. Note that at
|
540
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
541
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
542
|
+
#
|
543
|
+
# @param name [::String]
|
544
|
+
# Required. The {::Google::Cloud::Dialogflow::CX::V3::Version Version} to be loaded to draft flow.
|
545
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
546
|
+
# ID>/flows/<Flow ID>/versions/<Version ID>`.
|
547
|
+
# @param allow_override_agent_resources [::Boolean]
|
548
|
+
# This field is used to prevent accidental overwrite of other agent
|
549
|
+
# resources, which can potentially impact other flow's behavior. If
|
550
|
+
# `allow_override_agent_resources` is false, conflicted agent-level resources
|
551
|
+
# will not be overridden (i.e. intents, entities, webhooks).
|
552
|
+
#
|
553
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
554
|
+
# @yieldparam response [::Gapic::Operation]
|
555
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
556
|
+
#
|
557
|
+
# @return [::Gapic::Operation]
|
558
|
+
#
|
559
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
560
|
+
#
|
561
|
+
def load_version request, options = nil
|
562
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
563
|
+
|
564
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest
|
565
|
+
|
566
|
+
# Converts hash and nil to an options object
|
567
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
568
|
+
|
569
|
+
# Customize the options with defaults
|
570
|
+
metadata = @config.rpcs.load_version.metadata.to_h
|
571
|
+
|
572
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
573
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
574
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
575
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
|
576
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
577
|
+
|
578
|
+
header_params = {
|
579
|
+
"name" => request.name
|
580
|
+
}
|
581
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
582
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
583
|
+
|
584
|
+
options.apply_defaults timeout: @config.rpcs.load_version.timeout,
|
585
|
+
metadata: metadata,
|
586
|
+
retry_policy: @config.rpcs.load_version.retry_policy
|
587
|
+
|
588
|
+
options.apply_defaults timeout: @config.timeout,
|
589
|
+
metadata: @config.metadata,
|
590
|
+
retry_policy: @config.retry_policy
|
591
|
+
|
592
|
+
@versions_stub.call_rpc :load_version, request, options: options do |response, operation|
|
593
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
594
|
+
yield response, operation if block_given?
|
595
|
+
return response
|
596
|
+
end
|
597
|
+
rescue ::GRPC::BadStatus => e
|
598
|
+
raise ::Google::Cloud::Error.from_error(e)
|
599
|
+
end
|
600
|
+
|
601
|
+
##
|
602
|
+
# Configuration class for the Versions API.
|
603
|
+
#
|
604
|
+
# This class represents the configuration for Versions,
|
605
|
+
# providing control over timeouts, retry behavior, logging, transport
|
606
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
607
|
+
# applied individually to specific RPCs. See
|
608
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Versions::Client::Configuration::Rpcs}
|
609
|
+
# for a list of RPCs that can be configured independently.
|
610
|
+
#
|
611
|
+
# Configuration can be applied globally to all clients, or to a single client
|
612
|
+
# on construction.
|
613
|
+
#
|
614
|
+
# @example
|
615
|
+
#
|
616
|
+
# # Modify the global config, setting the timeout for
|
617
|
+
# # list_versions to 20 seconds,
|
618
|
+
# # and all remaining timeouts to 10 seconds.
|
619
|
+
# ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.configure do |config|
|
620
|
+
# config.timeout = 10.0
|
621
|
+
# config.rpcs.list_versions.timeout = 20.0
|
622
|
+
# end
|
623
|
+
#
|
624
|
+
# # Apply the above configuration only to a new client.
|
625
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config|
|
626
|
+
# config.timeout = 10.0
|
627
|
+
# config.rpcs.list_versions.timeout = 20.0
|
628
|
+
# end
|
629
|
+
#
|
630
|
+
# @!attribute [rw] endpoint
|
631
|
+
# The hostname or hostname:port of the service endpoint.
|
632
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
633
|
+
# @return [::String]
|
634
|
+
# @!attribute [rw] credentials
|
635
|
+
# Credentials to send with calls. You may provide any of the following types:
|
636
|
+
# * (`String`) The path to a service account key file in JSON format
|
637
|
+
# * (`Hash`) A service account key as a Hash
|
638
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
639
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
640
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
641
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
642
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
643
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
644
|
+
# * (`nil`) indicating no credentials
|
645
|
+
# @return [::Object]
|
646
|
+
# @!attribute [rw] scope
|
647
|
+
# The OAuth scopes
|
648
|
+
# @return [::Array<::String>]
|
649
|
+
# @!attribute [rw] lib_name
|
650
|
+
# The library name as recorded in instrumentation and logging
|
651
|
+
# @return [::String]
|
652
|
+
# @!attribute [rw] lib_version
|
653
|
+
# The library version as recorded in instrumentation and logging
|
654
|
+
# @return [::String]
|
655
|
+
# @!attribute [rw] channel_args
|
656
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
657
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
658
|
+
# @return [::Hash]
|
659
|
+
# @!attribute [rw] interceptors
|
660
|
+
# An array of interceptors that are run before calls are executed.
|
661
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
662
|
+
# @!attribute [rw] timeout
|
663
|
+
# The call timeout in seconds.
|
664
|
+
# @return [::Numeric]
|
665
|
+
# @!attribute [rw] metadata
|
666
|
+
# Additional gRPC headers to be sent with the call.
|
667
|
+
# @return [::Hash{::Symbol=>::String}]
|
668
|
+
# @!attribute [rw] retry_policy
|
669
|
+
# The retry policy. The value is a hash with the following keys:
|
670
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
671
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
672
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
673
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
674
|
+
# trigger a retry.
|
675
|
+
# @return [::Hash]
|
676
|
+
# @!attribute [rw] quota_project
|
677
|
+
# A separate project against which to charge quota.
|
678
|
+
# @return [::String]
|
679
|
+
#
|
680
|
+
class Configuration
|
681
|
+
extend ::Gapic::Config
|
682
|
+
|
683
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
684
|
+
config_attr :credentials, nil do |value|
|
685
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
686
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
687
|
+
allowed.any? { |klass| klass === value }
|
688
|
+
end
|
689
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
690
|
+
config_attr :lib_name, nil, ::String, nil
|
691
|
+
config_attr :lib_version, nil, ::String, nil
|
692
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
693
|
+
config_attr :interceptors, nil, ::Array, nil
|
694
|
+
config_attr :timeout, nil, ::Numeric, nil
|
695
|
+
config_attr :metadata, nil, ::Hash, nil
|
696
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
697
|
+
config_attr :quota_project, nil, ::String, nil
|
698
|
+
|
699
|
+
# @private
|
700
|
+
def initialize parent_config = nil
|
701
|
+
@parent_config = parent_config unless parent_config.nil?
|
702
|
+
|
703
|
+
yield self if block_given?
|
704
|
+
end
|
705
|
+
|
706
|
+
##
|
707
|
+
# Configurations for individual RPCs
|
708
|
+
# @return [Rpcs]
|
709
|
+
#
|
710
|
+
def rpcs
|
711
|
+
@rpcs ||= begin
|
712
|
+
parent_rpcs = nil
|
713
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
714
|
+
Rpcs.new parent_rpcs
|
715
|
+
end
|
716
|
+
end
|
717
|
+
|
718
|
+
##
|
719
|
+
# Configuration RPC class for the Versions API.
|
720
|
+
#
|
721
|
+
# Includes fields providing the configuration for each RPC in this service.
|
722
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
723
|
+
# the following configuration fields:
|
724
|
+
#
|
725
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
726
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
727
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
728
|
+
# include the following keys:
|
729
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
730
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
731
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
732
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
733
|
+
# trigger a retry.
|
734
|
+
#
|
735
|
+
class Rpcs
|
736
|
+
##
|
737
|
+
# RPC-specific configuration for `list_versions`
|
738
|
+
# @return [::Gapic::Config::Method]
|
739
|
+
#
|
740
|
+
attr_reader :list_versions
|
741
|
+
##
|
742
|
+
# RPC-specific configuration for `get_version`
|
743
|
+
# @return [::Gapic::Config::Method]
|
744
|
+
#
|
745
|
+
attr_reader :get_version
|
746
|
+
##
|
747
|
+
# RPC-specific configuration for `create_version`
|
748
|
+
# @return [::Gapic::Config::Method]
|
749
|
+
#
|
750
|
+
attr_reader :create_version
|
751
|
+
##
|
752
|
+
# RPC-specific configuration for `update_version`
|
753
|
+
# @return [::Gapic::Config::Method]
|
754
|
+
#
|
755
|
+
attr_reader :update_version
|
756
|
+
##
|
757
|
+
# RPC-specific configuration for `delete_version`
|
758
|
+
# @return [::Gapic::Config::Method]
|
759
|
+
#
|
760
|
+
attr_reader :delete_version
|
761
|
+
##
|
762
|
+
# RPC-specific configuration for `load_version`
|
763
|
+
# @return [::Gapic::Config::Method]
|
764
|
+
#
|
765
|
+
attr_reader :load_version
|
766
|
+
|
767
|
+
# @private
|
768
|
+
def initialize parent_rpcs = nil
|
769
|
+
list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
|
770
|
+
@list_versions = ::Gapic::Config::Method.new list_versions_config
|
771
|
+
get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
|
772
|
+
@get_version = ::Gapic::Config::Method.new get_version_config
|
773
|
+
create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version
|
774
|
+
@create_version = ::Gapic::Config::Method.new create_version_config
|
775
|
+
update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version
|
776
|
+
@update_version = ::Gapic::Config::Method.new update_version_config
|
777
|
+
delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
|
778
|
+
@delete_version = ::Gapic::Config::Method.new delete_version_config
|
779
|
+
load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version
|
780
|
+
@load_version = ::Gapic::Config::Method.new load_version_config
|
781
|
+
|
782
|
+
yield self if block_given?
|
783
|
+
end
|
784
|
+
end
|
785
|
+
end
|
786
|
+
end
|
787
|
+
end
|
788
|
+
end
|
789
|
+
end
|
790
|
+
end
|
791
|
+
end
|
792
|
+
end
|