google-cloud-dialogflow-cx-v3 0.1.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +2 -2
  4. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -2
  5. data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +17 -1
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +216 -27
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +115 -12
  8. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +3 -2
  9. data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +52 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb +49 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +522 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb +54 -0
  13. data/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb +75 -0
  14. data/lib/google/cloud/dialogflow/cx/v3/changelogs.rb +51 -0
  15. data/lib/google/cloud/dialogflow/cx/v3/deployment_pb.rb +63 -0
  16. data/lib/google/cloud/dialogflow/cx/v3/deployment_services_pb.rb +49 -0
  17. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +502 -0
  18. data/lib/google/cloud/dialogflow/cx/v3/deployments/credentials.rb +54 -0
  19. data/lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb +79 -0
  20. data/lib/google/cloud/dialogflow/cx/v3/deployments.rb +51 -0
  21. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +2 -2
  22. data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +1 -1
  23. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +106 -15
  24. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +23 -2
  25. data/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +33 -1
  26. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +335 -24
  27. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +115 -12
  28. data/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +21 -0
  29. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +2 -2
  30. data/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +1 -1
  31. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +146 -21
  32. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +2 -2
  33. data/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +26 -1
  34. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +254 -32
  35. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +115 -12
  36. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +2 -2
  37. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +2 -2
  38. data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +1 -1
  39. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +106 -15
  40. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +2 -2
  41. data/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +1 -1
  42. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +106 -15
  43. data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +2 -2
  44. data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +2 -2
  45. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +106 -15
  46. data/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +1 -1
  47. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +2 -2
  48. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +1 -1
  49. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +106 -15
  50. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +3 -2
  51. data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +1 -1
  52. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +84 -9
  53. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +2 -2
  54. data/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +29 -1
  55. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +308 -36
  56. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +115 -12
  57. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +2 -2
  58. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +1 -1
  59. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +106 -15
  60. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +2 -2
  61. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  62. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +2 -2
  63. data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +17 -1
  64. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +156 -18
  65. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +115 -12
  66. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +2 -2
  67. data/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +1 -1
  68. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +106 -15
  69. data/lib/google/cloud/dialogflow/cx/v3.rb +2 -0
  70. data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +122 -0
  71. data/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +135 -0
  72. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +62 -0
  73. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +2 -2
  74. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +4 -1
  75. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +58 -42
  76. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +3 -1
  77. metadata +21 -5
@@ -0,0 +1,502 @@
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
+ # @example Basic example
190
+ # require "google/cloud/dialogflow/cx/v3"
191
+ #
192
+ # # Create a client object. The client can be reused for multiple calls.
193
+ # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new
194
+ #
195
+ # # Create a request. To set request fields, pass in keyword arguments.
196
+ # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new
197
+ #
198
+ # # Call the list_deployments method.
199
+ # result = client.list_deployments request
200
+ #
201
+ # # The returned object is of type Gapic::PagedEnumerable. You can
202
+ # # iterate over all elements by calling #each, and the enumerable
203
+ # # will lazily make API calls to fetch subsequent pages. Other
204
+ # # methods are also available for managing paging directly.
205
+ # result.each do |response|
206
+ # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Deployment.
207
+ # p response
208
+ # end
209
+ #
210
+ def list_deployments request, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request.nil?
212
+
213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest
214
+
215
+ # Converts hash and nil to an options object
216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+
218
+ # Customize the options with defaults
219
+ metadata = @config.rpcs.list_deployments.metadata.to_h
220
+
221
+ # Set x-goog-api-client and x-goog-user-project headers
222
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
224
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
225
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
+
227
+ header_params = {}
228
+ if request.parent
229
+ header_params["parent"] = request.parent
230
+ end
231
+
232
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
233
+ metadata[:"x-goog-request-params"] ||= request_params_header
234
+
235
+ options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
236
+ metadata: metadata,
237
+ retry_policy: @config.rpcs.list_deployments.retry_policy
238
+
239
+ options.apply_defaults timeout: @config.timeout,
240
+ metadata: @config.metadata,
241
+ retry_policy: @config.retry_policy
242
+
243
+ @deployments_stub.call_rpc :list_deployments, request, options: options do |response, operation|
244
+ response = ::Gapic::PagedEnumerable.new @deployments_stub, :list_deployments, request, response, operation, options
245
+ yield response, operation if block_given?
246
+ return response
247
+ end
248
+ rescue ::GRPC::BadStatus => e
249
+ raise ::Google::Cloud::Error.from_error(e)
250
+ end
251
+
252
+ ##
253
+ # Retrieves the specified {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}.
254
+ #
255
+ # @overload get_deployment(request, options = nil)
256
+ # Pass arguments to `get_deployment` via a request object, either of type
257
+ # {::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest} or an equivalent Hash.
258
+ #
259
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest, ::Hash]
260
+ # A request object representing the call parameters. Required. To specify no
261
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
262
+ # @param options [::Gapic::CallOptions, ::Hash]
263
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
264
+ #
265
+ # @overload get_deployment(name: nil)
266
+ # Pass arguments to `get_deployment` via keyword arguments. Note that at
267
+ # least one keyword argument is required. To specify no parameters, or to keep all
268
+ # the default parameter values, pass an empty Hash as a request object (see above).
269
+ #
270
+ # @param name [::String]
271
+ # Required. The name of the {::Google::Cloud::Dialogflow::CX::V3::Deployment Deployment}.
272
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
273
+ # ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
274
+ #
275
+ # @yield [response, operation] Access the result along with the RPC operation
276
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Deployment]
277
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
278
+ #
279
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment]
280
+ #
281
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
282
+ #
283
+ # @example Basic example
284
+ # require "google/cloud/dialogflow/cx/v3"
285
+ #
286
+ # # Create a client object. The client can be reused for multiple calls.
287
+ # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new
288
+ #
289
+ # # Create a request. To set request fields, pass in keyword arguments.
290
+ # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new
291
+ #
292
+ # # Call the get_deployment method.
293
+ # result = client.get_deployment request
294
+ #
295
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment.
296
+ # p result
297
+ #
298
+ def get_deployment request, options = nil
299
+ raise ::ArgumentError, "request must be provided" if request.nil?
300
+
301
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest
302
+
303
+ # Converts hash and nil to an options object
304
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
305
+
306
+ # Customize the options with defaults
307
+ metadata = @config.rpcs.get_deployment.metadata.to_h
308
+
309
+ # Set x-goog-api-client and x-goog-user-project headers
310
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
311
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
312
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
313
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
314
+
315
+ header_params = {}
316
+ if request.name
317
+ header_params["name"] = request.name
318
+ end
319
+
320
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
321
+ metadata[:"x-goog-request-params"] ||= request_params_header
322
+
323
+ options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
324
+ metadata: metadata,
325
+ retry_policy: @config.rpcs.get_deployment.retry_policy
326
+
327
+ options.apply_defaults timeout: @config.timeout,
328
+ metadata: @config.metadata,
329
+ retry_policy: @config.retry_policy
330
+
331
+ @deployments_stub.call_rpc :get_deployment, request, options: options do |response, operation|
332
+ yield response, operation if block_given?
333
+ return response
334
+ end
335
+ rescue ::GRPC::BadStatus => e
336
+ raise ::Google::Cloud::Error.from_error(e)
337
+ end
338
+
339
+ ##
340
+ # Configuration class for the Deployments API.
341
+ #
342
+ # This class represents the configuration for Deployments,
343
+ # providing control over timeouts, retry behavior, logging, transport
344
+ # parameters, and other low-level controls. Certain parameters can also be
345
+ # applied individually to specific RPCs. See
346
+ # {::Google::Cloud::Dialogflow::CX::V3::Deployments::Client::Configuration::Rpcs}
347
+ # for a list of RPCs that can be configured independently.
348
+ #
349
+ # Configuration can be applied globally to all clients, or to a single client
350
+ # on construction.
351
+ #
352
+ # @example
353
+ #
354
+ # # Modify the global config, setting the timeout for
355
+ # # list_deployments to 20 seconds,
356
+ # # and all remaining timeouts to 10 seconds.
357
+ # ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.configure do |config|
358
+ # config.timeout = 10.0
359
+ # config.rpcs.list_deployments.timeout = 20.0
360
+ # end
361
+ #
362
+ # # Apply the above configuration only to a new client.
363
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config|
364
+ # config.timeout = 10.0
365
+ # config.rpcs.list_deployments.timeout = 20.0
366
+ # end
367
+ #
368
+ # @!attribute [rw] endpoint
369
+ # The hostname or hostname:port of the service endpoint.
370
+ # Defaults to `"dialogflow.googleapis.com"`.
371
+ # @return [::String]
372
+ # @!attribute [rw] credentials
373
+ # Credentials to send with calls. You may provide any of the following types:
374
+ # * (`String`) The path to a service account key file in JSON format
375
+ # * (`Hash`) A service account key as a Hash
376
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
377
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
378
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
379
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
380
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
381
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
382
+ # * (`nil`) indicating no credentials
383
+ # @return [::Object]
384
+ # @!attribute [rw] scope
385
+ # The OAuth scopes
386
+ # @return [::Array<::String>]
387
+ # @!attribute [rw] lib_name
388
+ # The library name as recorded in instrumentation and logging
389
+ # @return [::String]
390
+ # @!attribute [rw] lib_version
391
+ # The library version as recorded in instrumentation and logging
392
+ # @return [::String]
393
+ # @!attribute [rw] channel_args
394
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
395
+ # `GRPC::Core::Channel` object is provided as the credential.
396
+ # @return [::Hash]
397
+ # @!attribute [rw] interceptors
398
+ # An array of interceptors that are run before calls are executed.
399
+ # @return [::Array<::GRPC::ClientInterceptor>]
400
+ # @!attribute [rw] timeout
401
+ # The call timeout in seconds.
402
+ # @return [::Numeric]
403
+ # @!attribute [rw] metadata
404
+ # Additional gRPC headers to be sent with the call.
405
+ # @return [::Hash{::Symbol=>::String}]
406
+ # @!attribute [rw] retry_policy
407
+ # The retry policy. The value is a hash with the following keys:
408
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
409
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
410
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
411
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
412
+ # trigger a retry.
413
+ # @return [::Hash]
414
+ # @!attribute [rw] quota_project
415
+ # A separate project against which to charge quota.
416
+ # @return [::String]
417
+ #
418
+ class Configuration
419
+ extend ::Gapic::Config
420
+
421
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
422
+ config_attr :credentials, nil do |value|
423
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
424
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
425
+ allowed.any? { |klass| klass === value }
426
+ end
427
+ config_attr :scope, nil, ::String, ::Array, nil
428
+ config_attr :lib_name, nil, ::String, nil
429
+ config_attr :lib_version, nil, ::String, nil
430
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
431
+ config_attr :interceptors, nil, ::Array, nil
432
+ config_attr :timeout, nil, ::Numeric, nil
433
+ config_attr :metadata, nil, ::Hash, nil
434
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
435
+ config_attr :quota_project, nil, ::String, nil
436
+
437
+ # @private
438
+ def initialize parent_config = nil
439
+ @parent_config = parent_config unless parent_config.nil?
440
+
441
+ yield self if block_given?
442
+ end
443
+
444
+ ##
445
+ # Configurations for individual RPCs
446
+ # @return [Rpcs]
447
+ #
448
+ def rpcs
449
+ @rpcs ||= begin
450
+ parent_rpcs = nil
451
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
452
+ Rpcs.new parent_rpcs
453
+ end
454
+ end
455
+
456
+ ##
457
+ # Configuration RPC class for the Deployments API.
458
+ #
459
+ # Includes fields providing the configuration for each RPC in this service.
460
+ # Each configuration object is of type `Gapic::Config::Method` and includes
461
+ # the following configuration fields:
462
+ #
463
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
464
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
465
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
466
+ # include the following keys:
467
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
468
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
469
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
470
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
471
+ # trigger a retry.
472
+ #
473
+ class Rpcs
474
+ ##
475
+ # RPC-specific configuration for `list_deployments`
476
+ # @return [::Gapic::Config::Method]
477
+ #
478
+ attr_reader :list_deployments
479
+ ##
480
+ # RPC-specific configuration for `get_deployment`
481
+ # @return [::Gapic::Config::Method]
482
+ #
483
+ attr_reader :get_deployment
484
+
485
+ # @private
486
+ def initialize parent_rpcs = nil
487
+ list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
488
+ @list_deployments = ::Gapic::Config::Method.new list_deployments_config
489
+ get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
490
+ @get_deployment = ::Gapic::Config::Method.new get_deployment_config
491
+
492
+ yield self if block_given?
493
+ end
494
+ end
495
+ end
496
+ end
497
+ end
498
+ end
499
+ end
500
+ end
501
+ end
502
+ 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