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