google-cloud-dialogflow-v2 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +2 -1
  3. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -1
  4. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +5 -1
  5. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +1 -1
  6. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  7. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +3 -0
  8. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +121 -23
  9. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +19 -0
  10. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +114 -23
  11. data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +60 -0
  12. data/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb +52 -0
  13. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb +567 -0
  14. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb +52 -0
  15. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb +809 -0
  16. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb +50 -0
  17. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb +535 -0
  18. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb +922 -0
  19. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb +188 -0
  20. data/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb +54 -0
  21. data/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb +56 -0
  22. data/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb +51 -0
  23. data/lib/google/cloud/dialogflow/v2/generator_pb.rb +71 -0
  24. data/lib/google/cloud/dialogflow/v2/generator_services_pb.rb +57 -0
  25. data/lib/google/cloud/dialogflow/v2/generators/client.rb +851 -0
  26. data/lib/google/cloud/dialogflow/v2/generators/credentials.rb +52 -0
  27. data/lib/google/cloud/dialogflow/v2/generators/paths.rb +66 -0
  28. data/lib/google/cloud/dialogflow/v2/generators/rest/client.rb +798 -0
  29. data/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb +381 -0
  30. data/lib/google/cloud/dialogflow/v2/generators/rest.rb +57 -0
  31. data/lib/google/cloud/dialogflow/v2/generators.rb +59 -0
  32. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +9 -1
  33. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +2 -0
  34. data/lib/google/cloud/dialogflow/v2/participants/client.rb +110 -0
  35. data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +103 -0
  36. data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +68 -0
  37. data/lib/google/cloud/dialogflow/v2/rest.rb +2 -0
  38. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  39. data/lib/google/cloud/dialogflow/v2.rb +2 -0
  40. data/proto_docs/google/api/client.rb +14 -10
  41. data/proto_docs/google/api/resource.rb +7 -2
  42. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +22 -0
  43. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +24 -0
  44. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +54 -26
  45. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +27 -2
  46. data/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb +81 -0
  47. data/proto_docs/google/cloud/dialogflow/v2/generator.rb +382 -0
  48. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +133 -0
  49. metadata +24 -2
@@ -0,0 +1,567 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/v2/encryption_spec_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Dialogflow
26
+ module V2
27
+ module EncryptionSpecService
28
+ ##
29
+ # Client for the EncryptionSpecService service.
30
+ #
31
+ # Manages encryption spec settings for Dialogflow and Agent Assist.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :encryption_spec_service_stub
44
+
45
+ ##
46
+ # Configure the EncryptionSpecService Client class.
47
+ #
48
+ # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all EncryptionSpecService clients
54
+ # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Dialogflow", "V2"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the EncryptionSpecService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @encryption_spec_service_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new EncryptionSpecService client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the EncryptionSpecService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/dialogflow/v2/encryption_spec_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
163
+ end
164
+
165
+ @encryption_spec_service_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool
174
+ )
175
+
176
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
177
+ config.credentials = credentials
178
+ config.quota_project = @quota_project_id
179
+ config.endpoint = @encryption_spec_service_stub.endpoint
180
+ config.universe_domain = @encryption_spec_service_stub.universe_domain
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for long-running operations.
186
+ #
187
+ # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations]
188
+ #
189
+ attr_reader :operations_client
190
+
191
+ ##
192
+ # Get the associated client for mix-in of the Locations.
193
+ #
194
+ # @return [Google::Cloud::Location::Locations::Client]
195
+ #
196
+ attr_reader :location_client
197
+
198
+ # Service calls
199
+
200
+ ##
201
+ # Gets location-level encryption key specification.
202
+ #
203
+ # @overload get_encryption_spec(request, options = nil)
204
+ # Pass arguments to `get_encryption_spec` via a request object, either of type
205
+ # {::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest} or an equivalent Hash.
206
+ #
207
+ # @param request [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Hash]
208
+ # A request object representing the call parameters. Required. To specify no
209
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
210
+ # @param options [::Gapic::CallOptions, ::Hash]
211
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
212
+ #
213
+ # @overload get_encryption_spec(name: nil)
214
+ # Pass arguments to `get_encryption_spec` via keyword arguments. Note that at
215
+ # least one keyword argument is required. To specify no parameters, or to keep all
216
+ # the default parameter values, pass an empty Hash as a request object (see above).
217
+ #
218
+ # @param name [::String]
219
+ # Required. The name of the encryption spec resource to get.
220
+ #
221
+ # @yield [response, operation] Access the result along with the RPC operation
222
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::EncryptionSpec]
223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
224
+ #
225
+ # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/dialogflow/v2"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new
237
+ #
238
+ # # Call the get_encryption_spec method.
239
+ # result = client.get_encryption_spec request
240
+ #
241
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec.
242
+ # p result
243
+ #
244
+ def get_encryption_spec request, options = nil
245
+ raise ::ArgumentError, "request must be provided" if request.nil?
246
+
247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest
248
+
249
+ # Converts hash and nil to an options object
250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
251
+
252
+ # Customize the options with defaults
253
+ metadata = @config.rpcs.get_encryption_spec.metadata.to_h
254
+
255
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
258
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
259
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
260
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ header_params = {}
263
+ if request.name
264
+ header_params["name"] = request.name
265
+ end
266
+
267
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
268
+ metadata[:"x-goog-request-params"] ||= request_params_header
269
+
270
+ options.apply_defaults timeout: @config.rpcs.get_encryption_spec.timeout,
271
+ metadata: metadata,
272
+ retry_policy: @config.rpcs.get_encryption_spec.retry_policy
273
+
274
+ options.apply_defaults timeout: @config.timeout,
275
+ metadata: @config.metadata,
276
+ retry_policy: @config.retry_policy
277
+
278
+ @encryption_spec_service_stub.call_rpc :get_encryption_spec, request, options: options do |response, operation|
279
+ yield response, operation if block_given?
280
+ return response
281
+ end
282
+ rescue ::GRPC::BadStatus => e
283
+ raise ::Google::Cloud::Error.from_error(e)
284
+ end
285
+
286
+ ##
287
+ # Initializes a location-level encryption key specification. An error will
288
+ # be thrown if the location has resources already created before the
289
+ # initialization. Once the encryption specification is initialized at a
290
+ # location, it is immutable and all newly created resources under the
291
+ # location will be encrypted with the existing specification.
292
+ #
293
+ # @overload initialize_encryption_spec(request, options = nil)
294
+ # Pass arguments to `initialize_encryption_spec` via a request object, either of type
295
+ # {::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest} or an equivalent Hash.
296
+ #
297
+ # @param request [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Hash]
298
+ # A request object representing the call parameters. Required. To specify no
299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
300
+ # @param options [::Gapic::CallOptions, ::Hash]
301
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
302
+ #
303
+ # @overload initialize_encryption_spec(encryption_spec: nil)
304
+ # Pass arguments to `initialize_encryption_spec` via keyword arguments. Note that at
305
+ # least one keyword argument is required. To specify no parameters, or to keep all
306
+ # the default parameter values, pass an empty Hash as a request object (see above).
307
+ #
308
+ # @param encryption_spec [::Google::Cloud::Dialogflow::V2::EncryptionSpec, ::Hash]
309
+ # Required. The encryption spec used for CMEK encryption. It is required that
310
+ # the kms key is in the same region as the endpoint. The same key will be
311
+ # used for all provisioned resources, if encryption is available. If the
312
+ # kms_key_name is left empty, no encryption will be enforced.
313
+ #
314
+ # @yield [response, operation] Access the result along with the RPC operation
315
+ # @yieldparam response [::Gapic::Operation]
316
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
317
+ #
318
+ # @return [::Gapic::Operation]
319
+ #
320
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
321
+ #
322
+ # @example Basic example
323
+ # require "google/cloud/dialogflow/v2"
324
+ #
325
+ # # Create a client object. The client can be reused for multiple calls.
326
+ # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new
327
+ #
328
+ # # Create a request. To set request fields, pass in keyword arguments.
329
+ # request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new
330
+ #
331
+ # # Call the initialize_encryption_spec method.
332
+ # result = client.initialize_encryption_spec request
333
+ #
334
+ # # The returned object is of type Gapic::Operation. You can use it to
335
+ # # check the status of an operation, cancel it, or wait for results.
336
+ # # Here is how to wait for a response.
337
+ # result.wait_until_done! timeout: 60
338
+ # if result.response?
339
+ # p result.response
340
+ # else
341
+ # puts "No response received."
342
+ # end
343
+ #
344
+ def initialize_encryption_spec request, options = nil
345
+ raise ::ArgumentError, "request must be provided" if request.nil?
346
+
347
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest
348
+
349
+ # Converts hash and nil to an options object
350
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
351
+
352
+ # Customize the options with defaults
353
+ metadata = @config.rpcs.initialize_encryption_spec.metadata.to_h
354
+
355
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
356
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
357
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
358
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
359
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
360
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
+
362
+ header_params = {}
363
+ if request.encryption_spec&.name
364
+ header_params["encryption_spec.name"] = request.encryption_spec.name
365
+ end
366
+
367
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
368
+ metadata[:"x-goog-request-params"] ||= request_params_header
369
+
370
+ options.apply_defaults timeout: @config.rpcs.initialize_encryption_spec.timeout,
371
+ metadata: metadata,
372
+ retry_policy: @config.rpcs.initialize_encryption_spec.retry_policy
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
376
+ retry_policy: @config.retry_policy
377
+
378
+ @encryption_spec_service_stub.call_rpc :initialize_encryption_spec, request, options: options do |response, operation|
379
+ response = ::Gapic::Operation.new response, @operations_client, options: options
380
+ yield response, operation if block_given?
381
+ return response
382
+ end
383
+ rescue ::GRPC::BadStatus => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Configuration class for the EncryptionSpecService API.
389
+ #
390
+ # This class represents the configuration for EncryptionSpecService,
391
+ # providing control over timeouts, retry behavior, logging, transport
392
+ # parameters, and other low-level controls. Certain parameters can also be
393
+ # applied individually to specific RPCs. See
394
+ # {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client::Configuration::Rpcs}
395
+ # for a list of RPCs that can be configured independently.
396
+ #
397
+ # Configuration can be applied globally to all clients, or to a single client
398
+ # on construction.
399
+ #
400
+ # @example
401
+ #
402
+ # # Modify the global config, setting the timeout for
403
+ # # get_encryption_spec to 20 seconds,
404
+ # # and all remaining timeouts to 10 seconds.
405
+ # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure do |config|
406
+ # config.timeout = 10.0
407
+ # config.rpcs.get_encryption_spec.timeout = 20.0
408
+ # end
409
+ #
410
+ # # Apply the above configuration only to a new client.
411
+ # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config|
412
+ # config.timeout = 10.0
413
+ # config.rpcs.get_encryption_spec.timeout = 20.0
414
+ # end
415
+ #
416
+ # @!attribute [rw] endpoint
417
+ # A custom service endpoint, as a hostname or hostname:port. The default is
418
+ # nil, indicating to use the default endpoint in the current universe domain.
419
+ # @return [::String,nil]
420
+ # @!attribute [rw] credentials
421
+ # Credentials to send with calls. You may provide any of the following types:
422
+ # * (`String`) The path to a service account key file in JSON format
423
+ # * (`Hash`) A service account key as a Hash
424
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
425
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
426
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
427
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
428
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
429
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
430
+ # * (`nil`) indicating no credentials
431
+ # @return [::Object]
432
+ # @!attribute [rw] scope
433
+ # The OAuth scopes
434
+ # @return [::Array<::String>]
435
+ # @!attribute [rw] lib_name
436
+ # The library name as recorded in instrumentation and logging
437
+ # @return [::String]
438
+ # @!attribute [rw] lib_version
439
+ # The library version as recorded in instrumentation and logging
440
+ # @return [::String]
441
+ # @!attribute [rw] channel_args
442
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
443
+ # `GRPC::Core::Channel` object is provided as the credential.
444
+ # @return [::Hash]
445
+ # @!attribute [rw] interceptors
446
+ # An array of interceptors that are run before calls are executed.
447
+ # @return [::Array<::GRPC::ClientInterceptor>]
448
+ # @!attribute [rw] timeout
449
+ # The call timeout in seconds.
450
+ # @return [::Numeric]
451
+ # @!attribute [rw] metadata
452
+ # Additional gRPC headers to be sent with the call.
453
+ # @return [::Hash{::Symbol=>::String}]
454
+ # @!attribute [rw] retry_policy
455
+ # The retry policy. The value is a hash with the following keys:
456
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
457
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
458
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
459
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
460
+ # trigger a retry.
461
+ # @return [::Hash]
462
+ # @!attribute [rw] quota_project
463
+ # A separate project against which to charge quota.
464
+ # @return [::String]
465
+ # @!attribute [rw] universe_domain
466
+ # The universe domain within which to make requests. This determines the
467
+ # default endpoint URL. The default value of nil uses the environment
468
+ # universe (usually the default "googleapis.com" universe).
469
+ # @return [::String,nil]
470
+ #
471
+ class Configuration
472
+ extend ::Gapic::Config
473
+
474
+ # @private
475
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
476
+ DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
477
+
478
+ config_attr :endpoint, nil, ::String, nil
479
+ config_attr :credentials, nil do |value|
480
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
481
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
482
+ allowed.any? { |klass| klass === value }
483
+ end
484
+ config_attr :scope, nil, ::String, ::Array, nil
485
+ config_attr :lib_name, nil, ::String, nil
486
+ config_attr :lib_version, nil, ::String, nil
487
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
488
+ config_attr :interceptors, nil, ::Array, nil
489
+ config_attr :timeout, nil, ::Numeric, nil
490
+ config_attr :metadata, nil, ::Hash, nil
491
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
492
+ config_attr :quota_project, nil, ::String, nil
493
+ config_attr :universe_domain, nil, ::String, nil
494
+
495
+ # @private
496
+ def initialize parent_config = nil
497
+ @parent_config = parent_config unless parent_config.nil?
498
+
499
+ yield self if block_given?
500
+ end
501
+
502
+ ##
503
+ # Configurations for individual RPCs
504
+ # @return [Rpcs]
505
+ #
506
+ def rpcs
507
+ @rpcs ||= begin
508
+ parent_rpcs = nil
509
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
510
+ Rpcs.new parent_rpcs
511
+ end
512
+ end
513
+
514
+ ##
515
+ # Configuration for the channel pool
516
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
517
+ #
518
+ def channel_pool
519
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
520
+ end
521
+
522
+ ##
523
+ # Configuration RPC class for the EncryptionSpecService API.
524
+ #
525
+ # Includes fields providing the configuration for each RPC in this service.
526
+ # Each configuration object is of type `Gapic::Config::Method` and includes
527
+ # the following configuration fields:
528
+ #
529
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
530
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
531
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
532
+ # include the following keys:
533
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
534
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
535
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
536
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
537
+ # trigger a retry.
538
+ #
539
+ class Rpcs
540
+ ##
541
+ # RPC-specific configuration for `get_encryption_spec`
542
+ # @return [::Gapic::Config::Method]
543
+ #
544
+ attr_reader :get_encryption_spec
545
+ ##
546
+ # RPC-specific configuration for `initialize_encryption_spec`
547
+ # @return [::Gapic::Config::Method]
548
+ #
549
+ attr_reader :initialize_encryption_spec
550
+
551
+ # @private
552
+ def initialize parent_rpcs = nil
553
+ get_encryption_spec_config = parent_rpcs.get_encryption_spec if parent_rpcs.respond_to? :get_encryption_spec
554
+ @get_encryption_spec = ::Gapic::Config::Method.new get_encryption_spec_config
555
+ initialize_encryption_spec_config = parent_rpcs.initialize_encryption_spec if parent_rpcs.respond_to? :initialize_encryption_spec
556
+ @initialize_encryption_spec = ::Gapic::Config::Method.new initialize_encryption_spec_config
557
+
558
+ yield self if block_given?
559
+ end
560
+ end
561
+ end
562
+ end
563
+ end
564
+ end
565
+ end
566
+ end
567
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 V2
25
+ module EncryptionSpecService
26
+ # Credentials for the EncryptionSpecService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/dialogflow"
31
+ ]
32
+ self.env_vars = [
33
+ "DIALOGFLOW_CREDENTIALS",
34
+ "DIALOGFLOW_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "DIALOGFLOW_CREDENTIALS_JSON",
39
+ "DIALOGFLOW_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end