google-cloud-dialogflow-cx-v3 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +1032 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +586 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb +104 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +472 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +168 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/changelogs.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +456 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +168 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/deployments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +740 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +1028 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +585 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/environments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +821 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +467 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +1182 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +646 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/flows.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +722 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/intents.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +777 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/pages.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +673 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +688 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +384 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +3 -1
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +576 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +254 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb +58 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +1304 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +765 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +748 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +865 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +815 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +467 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb +56 -0
- data/lib/google/cloud/dialogflow/cx/v3/versions.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +677 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +6 -0
- data/lib/google/cloud/dialogflow/cx/v3.rb +5 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +3 -0
- metadata +61 -5
@@ -0,0 +1,456 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/dialogflow/cx/v3/deployment_pb"
|
21
|
+
require "google/cloud/dialogflow/cx/v3/deployments/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Dialogflow
|
27
|
+
module CX
|
28
|
+
module V3
|
29
|
+
module Deployments
|
30
|
+
module Rest
|
31
|
+
##
|
32
|
+
# REST client for the Deployments service.
|
33
|
+
#
|
34
|
+
# Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}.
|
35
|
+
#
|
36
|
+
class Client
|
37
|
+
include Paths
|
38
|
+
|
39
|
+
# @private
|
40
|
+
attr_reader :deployments_stub
|
41
|
+
|
42
|
+
##
|
43
|
+
# Configure the Deployments Client class.
|
44
|
+
#
|
45
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client::Configuration}
|
46
|
+
# for a description of the configuration fields.
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
#
|
50
|
+
# # Modify the configuration for all Deployments clients
|
51
|
+
# ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.configure do |config|
|
52
|
+
# config.timeout = 10.0
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# @yield [config] Configure the Client client.
|
56
|
+
# @yieldparam config [Client::Configuration]
|
57
|
+
#
|
58
|
+
# @return [Client::Configuration]
|
59
|
+
#
|
60
|
+
def self.configure
|
61
|
+
@configure ||= begin
|
62
|
+
namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
|
63
|
+
parent_config = while namespace.any?
|
64
|
+
parent_name = namespace.join "::"
|
65
|
+
parent_const = const_get parent_name
|
66
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
67
|
+
namespace.pop
|
68
|
+
end
|
69
|
+
default_config = Client::Configuration.new parent_config
|
70
|
+
|
71
|
+
default_config.timeout = 60.0
|
72
|
+
default_config.retry_policy = {
|
73
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
74
|
+
}
|
75
|
+
|
76
|
+
default_config
|
77
|
+
end
|
78
|
+
yield @configure if block_given?
|
79
|
+
@configure
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Configure the Deployments Client instance.
|
84
|
+
#
|
85
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
86
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
87
|
+
# should be made on {Client.configure}.
|
88
|
+
#
|
89
|
+
# See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client::Configuration}
|
90
|
+
# for a description of the configuration fields.
|
91
|
+
#
|
92
|
+
# @yield [config] Configure the Client client.
|
93
|
+
# @yieldparam config [Client::Configuration]
|
94
|
+
#
|
95
|
+
# @return [Client::Configuration]
|
96
|
+
#
|
97
|
+
def configure
|
98
|
+
yield @config if block_given?
|
99
|
+
@config
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# Create a new Deployments REST client object.
|
104
|
+
#
|
105
|
+
# @example
|
106
|
+
#
|
107
|
+
# # Create a client using the default configuration
|
108
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new
|
109
|
+
#
|
110
|
+
# # Create a client using a custom configuration
|
111
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config|
|
112
|
+
# config.timeout = 10.0
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# @yield [config] Configure the Deployments client.
|
116
|
+
# @yieldparam config [Client::Configuration]
|
117
|
+
#
|
118
|
+
def initialize
|
119
|
+
# Create the configuration object
|
120
|
+
@config = Configuration.new Client.configure
|
121
|
+
|
122
|
+
# Yield the configuration if needed
|
123
|
+
yield @config if block_given?
|
124
|
+
|
125
|
+
# Create credentials
|
126
|
+
credentials = @config.credentials
|
127
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
128
|
+
# but only if the default endpoint does not have a region prefix.
|
129
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
130
|
+
!@config.endpoint.split(".").first.include?("-")
|
131
|
+
credentials ||= Credentials.default scope: @config.scope,
|
132
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
133
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
134
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
135
|
+
end
|
136
|
+
|
137
|
+
@quota_project_id = @config.quota_project
|
138
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
139
|
+
|
140
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
141
|
+
config.credentials = credentials
|
142
|
+
config.quota_project = @quota_project_id
|
143
|
+
config.endpoint = @config.endpoint
|
144
|
+
config.bindings_override = @config.bindings_override
|
145
|
+
end
|
146
|
+
|
147
|
+
@deployments_stub = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Get the associated client for mix-in of the Locations.
|
152
|
+
#
|
153
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
154
|
+
#
|
155
|
+
attr_reader :location_client
|
156
|
+
|
157
|
+
# Service calls
|
158
|
+
|
159
|
+
##
|
160
|
+
# Returns the list of all deployments in the specified
|
161
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}.
|
162
|
+
#
|
163
|
+
# @overload list_deployments(request, options = nil)
|
164
|
+
# Pass arguments to `list_deployments` via a request object, either of type
|
165
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash.
|
166
|
+
#
|
167
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash]
|
168
|
+
# A request object representing the call parameters. Required. To specify no
|
169
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
170
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
171
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
172
|
+
#
|
173
|
+
# @overload list_deployments(parent: nil, page_size: nil, page_token: nil)
|
174
|
+
# Pass arguments to `list_deployments` via keyword arguments. Note that at
|
175
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
176
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
177
|
+
#
|
178
|
+
# @param parent [::String]
|
179
|
+
# Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to
|
180
|
+
# list all environments for. Format: `projects/<Project
|
181
|
+
# ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment
|
182
|
+
# ID>`.
|
183
|
+
# @param page_size [::Integer]
|
184
|
+
# The maximum number of items to return in a single page. By default 20 and
|
185
|
+
# at most 100.
|
186
|
+
# @param page_token [::String]
|
187
|
+
# The next_page_token value returned from a previous list request.
|
188
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
189
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>]
|
190
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
191
|
+
#
|
192
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>]
|
193
|
+
#
|
194
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
195
|
+
def list_deployments request, options = nil
|
196
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
197
|
+
|
198
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest
|
199
|
+
|
200
|
+
# Converts hash and nil to an options object
|
201
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
202
|
+
|
203
|
+
# Customize the options with defaults
|
204
|
+
call_metadata = @config.rpcs.list_deployments.metadata.to_h
|
205
|
+
|
206
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
207
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
208
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
209
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
210
|
+
transports_version_send: [:rest]
|
211
|
+
|
212
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
213
|
+
|
214
|
+
options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
|
215
|
+
metadata: call_metadata,
|
216
|
+
retry_policy: @config.rpcs.list_deployments.retry_policy
|
217
|
+
|
218
|
+
options.apply_defaults timeout: @config.timeout,
|
219
|
+
metadata: @config.metadata,
|
220
|
+
retry_policy: @config.retry_policy
|
221
|
+
|
222
|
+
@deployments_stub.list_deployments request, options do |result, operation|
|
223
|
+
result = ::Gapic::Rest::PagedEnumerable.new @deployments_stub, :list_deployments, "deployments", request, result, options
|
224
|
+
yield result, operation if block_given?
|
225
|
+
return result
|
226
|
+
end
|
227
|
+
rescue ::Gapic::Rest::Error => e
|
228
|
+
raise ::Google::Cloud::Error.from_error(e)
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Retrieves the specified
|
233
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}.
|
234
|
+
#
|
235
|
+
# @overload get_deployment(request, options = nil)
|
236
|
+
# Pass arguments to `get_deployment` via a request object, either of type
|
237
|
+
# {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash.
|
238
|
+
#
|
239
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash]
|
240
|
+
# A request object representing the call parameters. Required. To specify no
|
241
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
242
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
243
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
244
|
+
#
|
245
|
+
# @overload get_deployment(name: nil)
|
246
|
+
# Pass arguments to `get_deployment` via keyword arguments. Note that at
|
247
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
248
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
249
|
+
#
|
250
|
+
# @param name [::String]
|
251
|
+
# Required. The name of the
|
252
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}. Format:
|
253
|
+
# `projects/<Project ID>/locations/<Location ID>/agents/<Agent
|
254
|
+
# ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
|
255
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
256
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Deployment]
|
257
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
258
|
+
#
|
259
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Deployment]
|
260
|
+
#
|
261
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
262
|
+
def get_deployment request, options = nil
|
263
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
264
|
+
|
265
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest
|
266
|
+
|
267
|
+
# Converts hash and nil to an options object
|
268
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
269
|
+
|
270
|
+
# Customize the options with defaults
|
271
|
+
call_metadata = @config.rpcs.get_deployment.metadata.to_h
|
272
|
+
|
273
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
274
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
275
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
276
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
277
|
+
transports_version_send: [:rest]
|
278
|
+
|
279
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
280
|
+
|
281
|
+
options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
|
282
|
+
metadata: call_metadata,
|
283
|
+
retry_policy: @config.rpcs.get_deployment.retry_policy
|
284
|
+
|
285
|
+
options.apply_defaults timeout: @config.timeout,
|
286
|
+
metadata: @config.metadata,
|
287
|
+
retry_policy: @config.retry_policy
|
288
|
+
|
289
|
+
@deployments_stub.get_deployment request, options do |result, operation|
|
290
|
+
yield result, operation if block_given?
|
291
|
+
return result
|
292
|
+
end
|
293
|
+
rescue ::Gapic::Rest::Error => e
|
294
|
+
raise ::Google::Cloud::Error.from_error(e)
|
295
|
+
end
|
296
|
+
|
297
|
+
##
|
298
|
+
# Configuration class for the Deployments REST API.
|
299
|
+
#
|
300
|
+
# This class represents the configuration for Deployments REST,
|
301
|
+
# providing control over timeouts, retry behavior, logging, transport
|
302
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
303
|
+
# applied individually to specific RPCs. See
|
304
|
+
# {::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client::Configuration::Rpcs}
|
305
|
+
# for a list of RPCs that can be configured independently.
|
306
|
+
#
|
307
|
+
# Configuration can be applied globally to all clients, or to a single client
|
308
|
+
# on construction.
|
309
|
+
#
|
310
|
+
# @example
|
311
|
+
#
|
312
|
+
# # Modify the global config, setting the timeout for
|
313
|
+
# # list_deployments to 20 seconds,
|
314
|
+
# # and all remaining timeouts to 10 seconds.
|
315
|
+
# ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.configure do |config|
|
316
|
+
# config.timeout = 10.0
|
317
|
+
# config.rpcs.list_deployments.timeout = 20.0
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
# # Apply the above configuration only to a new client.
|
321
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config|
|
322
|
+
# config.timeout = 10.0
|
323
|
+
# config.rpcs.list_deployments.timeout = 20.0
|
324
|
+
# end
|
325
|
+
#
|
326
|
+
# @!attribute [rw] endpoint
|
327
|
+
# The hostname or hostname:port of the service endpoint.
|
328
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
329
|
+
# @return [::String]
|
330
|
+
# @!attribute [rw] credentials
|
331
|
+
# Credentials to send with calls. You may provide any of the following types:
|
332
|
+
# * (`String`) The path to a service account key file in JSON format
|
333
|
+
# * (`Hash`) A service account key as a Hash
|
334
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
335
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
336
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
337
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
338
|
+
# * (`nil`) indicating no credentials
|
339
|
+
# @return [::Object]
|
340
|
+
# @!attribute [rw] scope
|
341
|
+
# The OAuth scopes
|
342
|
+
# @return [::Array<::String>]
|
343
|
+
# @!attribute [rw] lib_name
|
344
|
+
# The library name as recorded in instrumentation and logging
|
345
|
+
# @return [::String]
|
346
|
+
# @!attribute [rw] lib_version
|
347
|
+
# The library version as recorded in instrumentation and logging
|
348
|
+
# @return [::String]
|
349
|
+
# @!attribute [rw] timeout
|
350
|
+
# The call timeout in seconds.
|
351
|
+
# @return [::Numeric]
|
352
|
+
# @!attribute [rw] metadata
|
353
|
+
# Additional headers to be sent with the call.
|
354
|
+
# @return [::Hash{::Symbol=>::String}]
|
355
|
+
# @!attribute [rw] retry_policy
|
356
|
+
# The retry policy. The value is a hash with the following keys:
|
357
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
358
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
359
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
360
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
361
|
+
# trigger a retry.
|
362
|
+
# @return [::Hash]
|
363
|
+
# @!attribute [rw] quota_project
|
364
|
+
# A separate project against which to charge quota.
|
365
|
+
# @return [::String]
|
366
|
+
#
|
367
|
+
class Configuration
|
368
|
+
extend ::Gapic::Config
|
369
|
+
|
370
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
371
|
+
config_attr :credentials, nil do |value|
|
372
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
373
|
+
allowed.any? { |klass| klass === value }
|
374
|
+
end
|
375
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
376
|
+
config_attr :lib_name, nil, ::String, nil
|
377
|
+
config_attr :lib_version, nil, ::String, nil
|
378
|
+
config_attr :timeout, nil, ::Numeric, nil
|
379
|
+
config_attr :metadata, nil, ::Hash, nil
|
380
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
381
|
+
config_attr :quota_project, nil, ::String, nil
|
382
|
+
|
383
|
+
# @private
|
384
|
+
# Overrides for http bindings for the RPCs of this service
|
385
|
+
# are only used when this service is used as mixin, and only
|
386
|
+
# by the host service.
|
387
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
388
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
389
|
+
|
390
|
+
# @private
|
391
|
+
def initialize parent_config = nil
|
392
|
+
@parent_config = parent_config unless parent_config.nil?
|
393
|
+
|
394
|
+
yield self if block_given?
|
395
|
+
end
|
396
|
+
|
397
|
+
##
|
398
|
+
# Configurations for individual RPCs
|
399
|
+
# @return [Rpcs]
|
400
|
+
#
|
401
|
+
def rpcs
|
402
|
+
@rpcs ||= begin
|
403
|
+
parent_rpcs = nil
|
404
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
405
|
+
Rpcs.new parent_rpcs
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
409
|
+
##
|
410
|
+
# Configuration RPC class for the Deployments API.
|
411
|
+
#
|
412
|
+
# Includes fields providing the configuration for each RPC in this service.
|
413
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
414
|
+
# the following configuration fields:
|
415
|
+
#
|
416
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
417
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
418
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
419
|
+
# include the following keys:
|
420
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
421
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
422
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
423
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
424
|
+
# trigger a retry.
|
425
|
+
#
|
426
|
+
class Rpcs
|
427
|
+
##
|
428
|
+
# RPC-specific configuration for `list_deployments`
|
429
|
+
# @return [::Gapic::Config::Method]
|
430
|
+
#
|
431
|
+
attr_reader :list_deployments
|
432
|
+
##
|
433
|
+
# RPC-specific configuration for `get_deployment`
|
434
|
+
# @return [::Gapic::Config::Method]
|
435
|
+
#
|
436
|
+
attr_reader :get_deployment
|
437
|
+
|
438
|
+
# @private
|
439
|
+
def initialize parent_rpcs = nil
|
440
|
+
list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
|
441
|
+
@list_deployments = ::Gapic::Config::Method.new list_deployments_config
|
442
|
+
get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
|
443
|
+
@get_deployment = ::Gapic::Config::Method.new get_deployment_config
|
444
|
+
|
445
|
+
yield self if block_given?
|
446
|
+
end
|
447
|
+
end
|
448
|
+
end
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
456
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/dialogflow/cx/v3/deployment_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Dialogflow
|
24
|
+
module CX
|
25
|
+
module V3
|
26
|
+
module Deployments
|
27
|
+
module Rest
|
28
|
+
##
|
29
|
+
# REST service stub for the Deployments service.
|
30
|
+
# Service stub contains baseline method implementations
|
31
|
+
# including transcoding, making the REST call, and deserialing the response.
|
32
|
+
#
|
33
|
+
class ServiceStub
|
34
|
+
def initialize endpoint:, credentials:
|
35
|
+
# These require statements are intentionally placed here to initialize
|
36
|
+
# the REST modules only when it's required.
|
37
|
+
require "gapic/rest"
|
38
|
+
|
39
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
40
|
+
numeric_enums: true,
|
41
|
+
raise_faraday_errors: false
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Baseline implementation for the list_deployments REST call
|
46
|
+
#
|
47
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest]
|
48
|
+
# A request object representing the call parameters. Required.
|
49
|
+
# @param options [::Gapic::CallOptions]
|
50
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
51
|
+
#
|
52
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
53
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse]
|
54
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
55
|
+
#
|
56
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse]
|
57
|
+
# A result object deserialized from the server's reply
|
58
|
+
def list_deployments request_pb, options = nil
|
59
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
60
|
+
|
61
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_deployments_request request_pb
|
62
|
+
query_string_params = if query_string_params.any?
|
63
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
64
|
+
else
|
65
|
+
{}
|
66
|
+
end
|
67
|
+
|
68
|
+
response = @client_stub.make_http_request(
|
69
|
+
verb,
|
70
|
+
uri: uri,
|
71
|
+
body: body || "",
|
72
|
+
params: query_string_params,
|
73
|
+
options: options
|
74
|
+
)
|
75
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
76
|
+
result = ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true
|
77
|
+
|
78
|
+
yield result, operation if block_given?
|
79
|
+
result
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Baseline implementation for the get_deployment REST call
|
84
|
+
#
|
85
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest]
|
86
|
+
# A request object representing the call parameters. Required.
|
87
|
+
# @param options [::Gapic::CallOptions]
|
88
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
89
|
+
#
|
90
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
91
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Deployment]
|
92
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
93
|
+
#
|
94
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::Deployment]
|
95
|
+
# A result object deserialized from the server's reply
|
96
|
+
def get_deployment request_pb, options = nil
|
97
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
98
|
+
|
99
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_request request_pb
|
100
|
+
query_string_params = if query_string_params.any?
|
101
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
102
|
+
else
|
103
|
+
{}
|
104
|
+
end
|
105
|
+
|
106
|
+
response = @client_stub.make_http_request(
|
107
|
+
verb,
|
108
|
+
uri: uri,
|
109
|
+
body: body || "",
|
110
|
+
params: query_string_params,
|
111
|
+
options: options
|
112
|
+
)
|
113
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
114
|
+
result = ::Google::Cloud::Dialogflow::CX::V3::Deployment.decode_json response.body, ignore_unknown_fields: true
|
115
|
+
|
116
|
+
yield result, operation if block_given?
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# @private
|
122
|
+
#
|
123
|
+
# GRPC transcoding helper method for the list_deployments REST call
|
124
|
+
#
|
125
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest]
|
126
|
+
# A request object representing the call parameters. Required.
|
127
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
128
|
+
# Uri, Body, Query string parameters
|
129
|
+
def self.transcode_list_deployments_request request_pb
|
130
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
131
|
+
.with_bindings(
|
132
|
+
uri_method: :get,
|
133
|
+
uri_template: "/v3/{parent}/deployments",
|
134
|
+
matches: [
|
135
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/?$}, false]
|
136
|
+
]
|
137
|
+
)
|
138
|
+
transcoder.transcode request_pb
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# @private
|
143
|
+
#
|
144
|
+
# GRPC transcoding helper method for the get_deployment REST call
|
145
|
+
#
|
146
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest]
|
147
|
+
# A request object representing the call parameters. Required.
|
148
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
149
|
+
# Uri, Body, Query string parameters
|
150
|
+
def self.transcode_get_deployment_request request_pb
|
151
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
152
|
+
.with_bindings(
|
153
|
+
uri_method: :get,
|
154
|
+
uri_template: "/v3/{name}",
|
155
|
+
matches: [
|
156
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/environments/[^/]+/deployments/[^/]+/?$}, false]
|
157
|
+
]
|
158
|
+
)
|
159
|
+
transcoder.transcode request_pb
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/dialogflow/cx/v3/version"
|
24
|
+
require "google/cloud/dialogflow/cx/v3/bindings_override"
|
25
|
+
|
26
|
+
require "google/cloud/dialogflow/cx/v3/deployments/credentials"
|
27
|
+
require "google/cloud/dialogflow/cx/v3/deployments/paths"
|
28
|
+
require "google/cloud/dialogflow/cx/v3/deployments/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module Dialogflow
|
33
|
+
module CX
|
34
|
+
module V3
|
35
|
+
##
|
36
|
+
# Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}.
|
37
|
+
#
|
38
|
+
# To load this service and instantiate a REST client:
|
39
|
+
#
|
40
|
+
# require "google/cloud/dialogflow/cx/v3/deployments/rest"
|
41
|
+
# client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new
|
42
|
+
#
|
43
|
+
module Deployments
|
44
|
+
# Client for the REST transport
|
45
|
+
module Rest
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
55
|
+
require "google/cloud/dialogflow/cx/v3/deployments/rest/helpers" if ::File.file? helper_path
|