google-cloud-dialogflow-cx-v3 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +2 -2
  3. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -2
  4. data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +10 -1
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +9 -0
  6. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +2 -2
  7. data/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb +63 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb +49 -0
  9. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +462 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb +54 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb +79 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/deployments.rb +51 -0
  13. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +2 -2
  14. data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +1 -1
  15. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +23 -2
  16. data/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +33 -1
  17. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +112 -0
  18. data/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +21 -0
  19. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +2 -2
  20. data/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +1 -1
  21. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +2 -2
  22. data/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +26 -1
  23. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +25 -0
  24. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +2 -2
  25. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +2 -2
  26. data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +1 -1
  27. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +2 -2
  28. data/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +1 -1
  29. data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +2 -2
  30. data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +2 -2
  31. data/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +1 -1
  32. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +2 -2
  33. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +1 -1
  34. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +3 -2
  35. data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +1 -1
  36. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +2 -2
  37. data/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +23 -1
  38. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +22 -0
  39. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +2 -2
  40. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +1 -1
  41. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +2 -2
  42. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  43. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +2 -2
  44. data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +17 -1
  45. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +16 -0
  46. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +2 -2
  47. data/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +1 -1
  48. data/lib/google/cloud/dialogflow/cx/v3.rb +1 -0
  49. data/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +135 -0
  50. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +62 -0
  51. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +4 -1
  52. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +4 -0
  53. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +1 -0
  54. metadata +9 -2
@@ -0,0 +1,462 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/dialogflow/cx/v3/deployment_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Deployments
28
+ ##
29
+ # Client for the Deployments service.
30
+ #
31
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :deployments_stub
38
+
39
+ ##
40
+ # Configure the Deployments Client class.
41
+ #
42
+ # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all Deployments clients
48
+ # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.timeout = 60.0
69
+ default_config.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
71
+ }
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the Deployments Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # Create a new Deployments client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Deployments client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the gRPC module only when it's required.
118
+ # See https://github.com/googleapis/toolkit/issues/446
119
+ require "gapic/grpc"
120
+ require "google/cloud/dialogflow/cx/v3/deployment_services_pb"
121
+
122
+ # Create the configuration object
123
+ @config = Configuration.new Client.configure
124
+
125
+ # Yield the configuration if needed
126
+ yield @config if block_given?
127
+
128
+ # Create credentials
129
+ credentials = @config.credentials
130
+ # Use self-signed JWT if the endpoint is unchanged from default,
131
+ # but only if the default endpoint does not have a region prefix.
132
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
133
+ !@config.endpoint.split(".").first.include?("-")
134
+ credentials ||= Credentials.default scope: @config.scope,
135
+ enable_self_signed_jwt: enable_self_signed_jwt
136
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
+ credentials = Credentials.new credentials, scope: @config.scope
138
+ end
139
+ @quota_project_id = @config.quota_project
140
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
141
+
142
+ @deployments_stub = ::Gapic::ServiceStub.new(
143
+ ::Google::Cloud::Dialogflow::CX::V3::Deployments::Stub,
144
+ credentials: credentials,
145
+ endpoint: @config.endpoint,
146
+ channel_args: @config.channel_args,
147
+ interceptors: @config.interceptors
148
+ )
149
+ end
150
+
151
+ # Service calls
152
+
153
+ ##
154
+ # Returns the list of all deployments in the specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}.
155
+ #
156
+ # @overload list_deployments(request, options = nil)
157
+ # Pass arguments to `list_deployments` via a request object, either of type
158
+ # {::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest} or an equivalent Hash.
159
+ #
160
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest, ::Hash]
161
+ # A request object representing the call parameters. Required. To specify no
162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
163
+ # @param options [::Gapic::CallOptions, ::Hash]
164
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
165
+ #
166
+ # @overload list_deployments(parent: nil, page_size: nil, page_token: nil)
167
+ # Pass arguments to `list_deployments` via keyword arguments. Note that at
168
+ # least one keyword argument is required. To specify no parameters, or to keep all
169
+ # the default parameter values, pass an empty Hash as a request object (see above).
170
+ #
171
+ # @param parent [::String]
172
+ # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to list all environments for.
173
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
174
+ # ID>/environments/<Environment ID>`.
175
+ # @param page_size [::Integer]
176
+ # The maximum number of items to return in a single page. By default 20 and
177
+ # at most 100.
178
+ # @param page_token [::String]
179
+ # The next_page_token value returned from a previous list request.
180
+ #
181
+ # @yield [response, operation] Access the result along with the RPC operation
182
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>]
183
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
184
+ #
185
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>]
186
+ #
187
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
188
+ #
189
+ def list_deployments request, options = nil
190
+ raise ::ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ metadata = @config.rpcs.list_deployments.metadata.to_h
199
+
200
+ # Set x-goog-api-client and x-goog-user-project headers
201
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
204
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
205
+
206
+ header_params = {
207
+ "parent" => request.parent
208
+ }
209
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
210
+ metadata[:"x-goog-request-params"] ||= request_params_header
211
+
212
+ options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
213
+ metadata: metadata,
214
+ retry_policy: @config.rpcs.list_deployments.retry_policy
215
+
216
+ options.apply_defaults timeout: @config.timeout,
217
+ metadata: @config.metadata,
218
+ retry_policy: @config.retry_policy
219
+
220
+ @deployments_stub.call_rpc :list_deployments, request, options: options do |response, operation|
221
+ response = ::Gapic::PagedEnumerable.new @deployments_stub, :list_deployments, request, response, operation, options
222
+ yield response, operation if block_given?
223
+ return response
224
+ end
225
+ rescue ::GRPC::BadStatus => e
226
+ raise ::Google::Cloud::Error.from_error(e)
227
+ end
228
+
229
+ ##
230
+ # Retrieves the specified {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}.
231
+ #
232
+ # @overload get_deployment(request, options = nil)
233
+ # Pass arguments to `get_deployment` via a request object, either of type
234
+ # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash.
235
+ #
236
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash]
237
+ # A request object representing the call parameters. Required. To specify no
238
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
239
+ # @param options [::Gapic::CallOptions, ::Hash]
240
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
241
+ #
242
+ # @overload get_deployment(name: nil)
243
+ # Pass arguments to `get_deployment` via keyword arguments. Note that at
244
+ # least one keyword argument is required. To specify no parameters, or to keep all
245
+ # the default parameter values, pass an empty Hash as a request object (see above).
246
+ #
247
+ # @param name [::String]
248
+ # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}.
249
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
250
+ # ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
251
+ #
252
+ # @yield [response, operation] Access the result along with the RPC operation
253
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Deployment]
254
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
255
+ #
256
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment]
257
+ #
258
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
259
+ #
260
+ def get_deployment request, options = nil
261
+ raise ::ArgumentError, "request must be provided" if request.nil?
262
+
263
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest
264
+
265
+ # Converts hash and nil to an options object
266
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
267
+
268
+ # Customize the options with defaults
269
+ metadata = @config.rpcs.get_deployment.metadata.to_h
270
+
271
+ # Set x-goog-api-client and x-goog-user-project headers
272
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
273
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
274
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
275
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
276
+
277
+ header_params = {
278
+ "name" => request.name
279
+ }
280
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
281
+ metadata[:"x-goog-request-params"] ||= request_params_header
282
+
283
+ options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
284
+ metadata: metadata,
285
+ retry_policy: @config.rpcs.get_deployment.retry_policy
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
289
+ retry_policy: @config.retry_policy
290
+
291
+ @deployments_stub.call_rpc :get_deployment, request, options: options do |response, operation|
292
+ yield response, operation if block_given?
293
+ return response
294
+ end
295
+ rescue ::GRPC::BadStatus => e
296
+ raise ::Google::Cloud::Error.from_error(e)
297
+ end
298
+
299
+ ##
300
+ # Configuration class for the Deployments API.
301
+ #
302
+ # This class represents the configuration for Deployments,
303
+ # providing control over timeouts, retry behavior, logging, transport
304
+ # parameters, and other low-level controls. Certain parameters can also be
305
+ # applied individually to specific RPCs. See
306
+ # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration::Rpcs}
307
+ # for a list of RPCs that can be configured independently.
308
+ #
309
+ # Configuration can be applied globally to all clients, or to a single client
310
+ # on construction.
311
+ #
312
+ # @example
313
+ #
314
+ # # Modify the global config, setting the timeout for
315
+ # # list_deployments to 20 seconds,
316
+ # # and all remaining timeouts to 10 seconds.
317
+ # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.configure do |config|
318
+ # config.timeout = 10.0
319
+ # config.rpcs.list_deployments.timeout = 20.0
320
+ # end
321
+ #
322
+ # # Apply the above configuration only to a new client.
323
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config|
324
+ # config.timeout = 10.0
325
+ # config.rpcs.list_deployments.timeout = 20.0
326
+ # end
327
+ #
328
+ # @!attribute [rw] endpoint
329
+ # The hostname or hostname:port of the service endpoint.
330
+ # Defaults to `"dialogflow.googleapis.com"`.
331
+ # @return [::String]
332
+ # @!attribute [rw] credentials
333
+ # Credentials to send with calls. You may provide any of the following types:
334
+ # * (`String`) The path to a service account key file in JSON format
335
+ # * (`Hash`) A service account key as a Hash
336
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
337
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
338
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
339
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
340
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
341
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
342
+ # * (`nil`) indicating no credentials
343
+ # @return [::Object]
344
+ # @!attribute [rw] scope
345
+ # The OAuth scopes
346
+ # @return [::Array<::String>]
347
+ # @!attribute [rw] lib_name
348
+ # The library name as recorded in instrumentation and logging
349
+ # @return [::String]
350
+ # @!attribute [rw] lib_version
351
+ # The library version as recorded in instrumentation and logging
352
+ # @return [::String]
353
+ # @!attribute [rw] channel_args
354
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
355
+ # `GRPC::Core::Channel` object is provided as the credential.
356
+ # @return [::Hash]
357
+ # @!attribute [rw] interceptors
358
+ # An array of interceptors that are run before calls are executed.
359
+ # @return [::Array<::GRPC::ClientInterceptor>]
360
+ # @!attribute [rw] timeout
361
+ # The call timeout in seconds.
362
+ # @return [::Numeric]
363
+ # @!attribute [rw] metadata
364
+ # Additional gRPC headers to be sent with the call.
365
+ # @return [::Hash{::Symbol=>::String}]
366
+ # @!attribute [rw] retry_policy
367
+ # The retry policy. The value is a hash with the following keys:
368
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
369
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
370
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
371
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
372
+ # trigger a retry.
373
+ # @return [::Hash]
374
+ # @!attribute [rw] quota_project
375
+ # A separate project against which to charge quota.
376
+ # @return [::String]
377
+ #
378
+ class Configuration
379
+ extend ::Gapic::Config
380
+
381
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
382
+ config_attr :credentials, nil do |value|
383
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
384
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
385
+ allowed.any? { |klass| klass === value }
386
+ end
387
+ config_attr :scope, nil, ::String, ::Array, nil
388
+ config_attr :lib_name, nil, ::String, nil
389
+ config_attr :lib_version, nil, ::String, nil
390
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
391
+ config_attr :interceptors, nil, ::Array, nil
392
+ config_attr :timeout, nil, ::Numeric, nil
393
+ config_attr :metadata, nil, ::Hash, nil
394
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
395
+ config_attr :quota_project, nil, ::String, nil
396
+
397
+ # @private
398
+ def initialize parent_config = nil
399
+ @parent_config = parent_config unless parent_config.nil?
400
+
401
+ yield self if block_given?
402
+ end
403
+
404
+ ##
405
+ # Configurations for individual RPCs
406
+ # @return [Rpcs]
407
+ #
408
+ def rpcs
409
+ @rpcs ||= begin
410
+ parent_rpcs = nil
411
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
412
+ Rpcs.new parent_rpcs
413
+ end
414
+ end
415
+
416
+ ##
417
+ # Configuration RPC class for the Deployments API.
418
+ #
419
+ # Includes fields providing the configuration for each RPC in this service.
420
+ # Each configuration object is of type `Gapic::Config::Method` and includes
421
+ # the following configuration fields:
422
+ #
423
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
424
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
425
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
426
+ # include the following keys:
427
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
428
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
429
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
430
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
431
+ # trigger a retry.
432
+ #
433
+ class Rpcs
434
+ ##
435
+ # RPC-specific configuration for `list_deployments`
436
+ # @return [::Gapic::Config::Method]
437
+ #
438
+ attr_reader :list_deployments
439
+ ##
440
+ # RPC-specific configuration for `get_deployment`
441
+ # @return [::Gapic::Config::Method]
442
+ #
443
+ attr_reader :get_deployment
444
+
445
+ # @private
446
+ def initialize parent_rpcs = nil
447
+ list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
448
+ @list_deployments = ::Gapic::Config::Method.new list_deployments_config
449
+ get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
450
+ @get_deployment = ::Gapic::Config::Method.new get_deployment_config
451
+
452
+ yield self if block_given?
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
460
+ end
461
+ end
462
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Dialogflow
24
+ module CX
25
+ module V3
26
+ module Deployments
27
+ # Credentials for the Deployments API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/cloud-platform",
31
+ "https://www.googleapis.com/auth/dialogflow"
32
+ ]
33
+ self.env_vars = [
34
+ "DIALOGFLOW_CREDENTIALS",
35
+ "DIALOGFLOW_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS",
37
+ "GOOGLE_CLOUD_KEYFILE",
38
+ "GCLOUD_KEYFILE",
39
+ "DIALOGFLOW_CREDENTIALS_JSON",
40
+ "DIALOGFLOW_KEYFILE_JSON",
41
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
42
+ "GOOGLE_CLOUD_KEYFILE_JSON",
43
+ "GCLOUD_KEYFILE_JSON"
44
+ ]
45
+ self.paths = [
46
+ "~/.config/google_cloud/application_default_credentials.json"
47
+ ]
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dialogflow
23
+ module CX
24
+ module V3
25
+ module Deployments
26
+ # Path helper methods for the Deployments API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Deployment resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param agent [String]
38
+ # @param environment [String]
39
+ # @param deployment [String]
40
+ #
41
+ # @return [::String]
42
+ def deployment_path project:, location:, agent:, environment:, deployment:
43
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
44
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
45
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
46
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
47
+
48
+ "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/deployments/#{deployment}"
49
+ end
50
+
51
+ ##
52
+ # Create a fully-qualified Environment resource string.
53
+ #
54
+ # The resource will be in the following format:
55
+ #
56
+ # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}`
57
+ #
58
+ # @param project [String]
59
+ # @param location [String]
60
+ # @param agent [String]
61
+ # @param environment [String]
62
+ #
63
+ # @return [::String]
64
+ def environment_path project:, location:, agent:, environment:
65
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
66
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
67
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
68
+
69
+ "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}"
70
+ end
71
+
72
+ extend self
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/cx/v3/version"
24
+
25
+ require "google/cloud/dialogflow/cx/v3/deployments/credentials"
26
+ require "google/cloud/dialogflow/cx/v3/deployments/paths"
27
+ require "google/cloud/dialogflow/cx/v3/deployments/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Dialogflow
32
+ module CX
33
+ module V3
34
+ ##
35
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployments}.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/dialogflow/cx/v3/deployments"
40
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new
41
+ #
42
+ module Deployments
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "deployments", "helpers.rb"
51
+ require "google/cloud/dialogflow/cx/v3/deployments/helpers" if ::File.file? helper_path
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dialogflow/cx/v3/entity_type.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
9
7
  require 'google/api/resource_pb'
10
8
  require 'google/protobuf/empty_pb'
11
9
  require 'google/protobuf/field_mask_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/dialogflow/cx/v3/entity_type.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.dialogflow.cx.v3.EntityType" do
@@ -28,7 +28,7 @@ module Google
28
28
  # Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode