google-cloud-discovery_engine-v1 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +235 -4
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +801 -0
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +221 -4
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +1091 -0
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +1 -0
  8. data/lib/google/cloud/discovery_engine/v1/completion_service.rb +1 -0
  9. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +20 -3
  10. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +91 -0
  11. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +20 -3
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +45 -0
  13. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +924 -0
  14. data/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb +47 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +801 -0
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +97 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +863 -0
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +1091 -0
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb +403 -0
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb +54 -0
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service.rb +57 -0
  22. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +14 -0
  23. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +885 -0
  24. data/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb +47 -0
  25. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +801 -0
  26. data/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb +73 -0
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +824 -0
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +1091 -0
  29. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb +366 -0
  30. data/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb +54 -0
  31. data/lib/google/cloud/discovery_engine/v1/engine_service.rb +57 -0
  32. data/lib/google/cloud/discovery_engine/v1/rest.rb +3 -0
  33. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +14 -0
  34. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +40 -4
  35. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +19 -0
  36. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +40 -4
  37. data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +8 -0
  38. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +1631 -0
  39. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +801 -0
  41. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb +127 -0
  42. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +1521 -0
  43. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +1091 -0
  44. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +860 -0
  45. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb +53 -0
  46. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb +56 -0
  47. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +14 -0
  48. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  49. data/lib/google/cloud/discovery_engine/v1.rb +3 -0
  50. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +5 -1
  51. data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +45 -0
  52. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +4 -1
  53. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
  54. data/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  56. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +49 -0
  57. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +62 -0
  58. data/lib/google/cloud/discoveryengine/v1/data_store_service_services_pb.rb +61 -0
  59. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +1 -1
  61. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +53 -0
  62. data/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb +62 -0
  63. data/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb +55 -0
  64. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +7 -1
  65. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +6 -1
  66. data/lib/google/cloud/discoveryengine/v1/schema_pb.rb +1 -1
  67. data/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb +1 -1
  68. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +8 -1
  69. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +54 -0
  70. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +82 -0
  71. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb +73 -0
  72. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  73. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  74. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +51 -0
  75. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +53 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +10 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +19 -1
  79. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +88 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +214 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
  82. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +214 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb +177 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +66 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +41 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +149 -4
  87. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +160 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +525 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +3 -3
  90. metadata +48 -2
@@ -0,0 +1,1091 @@
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 "gapic/operation"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1
25
+ module CompletionService
26
+ module Rest
27
+ # Service that implements Longrunning Operations API.
28
+ class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
31
+
32
+ # @private
33
+ attr_reader :operations_stub
34
+
35
+ ##
36
+ # Configuration for the CompletionService Operations API.
37
+ #
38
+ # @yield [config] Configure the Operations client.
39
+ # @yieldparam config [Operations::Configuration]
40
+ #
41
+ # @return [Operations::Configuration]
42
+ #
43
+ def self.configure
44
+ @configure ||= Operations::Configuration.new
45
+ yield @configure if block_given?
46
+ @configure
47
+ end
48
+
49
+ ##
50
+ # Configure the CompletionService Operations instance.
51
+ #
52
+ # The configuration is set to the derived mode, meaning that values can be changed,
53
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
54
+ # should be made on {Operations.configure}.
55
+ #
56
+ # @yield [config] Configure the Operations client.
57
+ # @yieldparam config [Operations::Configuration]
58
+ #
59
+ # @return [Operations::Configuration]
60
+ #
61
+ def configure
62
+ yield @config if block_given?
63
+ @config
64
+ end
65
+
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
75
+ ##
76
+ # Create a new Operations client object.
77
+ #
78
+ # @yield [config] Configure the Client client.
79
+ # @yieldparam config [Operations::Configuration]
80
+ #
81
+ def initialize
82
+ # Create the configuration object
83
+ @config = Configuration.new Operations.configure
84
+
85
+ # Yield the configuration if needed
86
+ yield @config if block_given?
87
+
88
+ # Create credentials
89
+ credentials = @config.credentials
90
+ credentials ||= Credentials.default scope: @config.scope
91
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
92
+ credentials = Credentials.new credentials, scope: @config.scope
93
+ end
94
+
95
+ @quota_project_id = @config.quota_project
96
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
97
+
98
+ @operations_stub = OperationsServiceStub.new(
99
+ endpoint: @config.endpoint,
100
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
101
+ universe_domain: @config.universe_domain,
102
+ credentials: credentials
103
+ )
104
+
105
+ # Used by an LRO wrapper for some methods of this service
106
+ @operations_client = self
107
+ end
108
+
109
+ # Service calls
110
+
111
+ ##
112
+ # Lists operations that match the specified filter in the request. If the
113
+ # server doesn't support this method, it returns `UNIMPLEMENTED`.
114
+ #
115
+ # NOTE: the `name` binding allows API services to override the binding
116
+ # to use different resource name schemes, such as `users/*/operations`. To
117
+ # override the binding, API services can add a binding such as
118
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
119
+ # For backwards compatibility, the default name includes the operations
120
+ # collection id, however overriding users must ensure the name binding
121
+ # is the parent resource, without the operations collection id.
122
+ #
123
+ # @overload list_operations(request, options = nil)
124
+ # Pass arguments to `list_operations` via a request object, either of type
125
+ # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
126
+ #
127
+ # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
128
+ # A request object representing the call parameters. Required. To specify no
129
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
130
+ # @param options [::Gapic::CallOptions, ::Hash]
131
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
132
+ #
133
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
134
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
135
+ # least one keyword argument is required. To specify no parameters, or to keep all
136
+ # the default parameter values, pass an empty Hash as a request object (see above).
137
+ #
138
+ # @param name [::String]
139
+ # The name of the operation's parent resource.
140
+ # @param filter [::String]
141
+ # The standard list filter.
142
+ # @param page_size [::Integer]
143
+ # The standard list page size.
144
+ # @param page_token [::String]
145
+ # The standard list page token.
146
+ # @yield [result, operation] Access the result along with the TransportOperation object
147
+ # @yieldparam result [::Gapic::Operation]
148
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
149
+ #
150
+ # @return [::Gapic::Operation]
151
+ #
152
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
153
+ #
154
+ # @example Basic example
155
+ # require "google/longrunning"
156
+ #
157
+ # # Create a client object. The client can be reused for multiple calls.
158
+ # client = Google::Longrunning::Operations::Rest::Client.new
159
+ #
160
+ # # Create a request. To set request fields, pass in keyword arguments.
161
+ # request = Google::Longrunning::ListOperationsRequest.new
162
+ #
163
+ # # Call the list_operations method.
164
+ # result = client.list_operations request
165
+ #
166
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
167
+ # # over elements, and API calls will be issued to fetch pages as needed.
168
+ # result.each do |item|
169
+ # # Each element is of type ::Google::Longrunning::Operation.
170
+ # p item
171
+ # end
172
+ #
173
+ def list_operations request, options = nil
174
+ raise ::ArgumentError, "request must be provided" if request.nil?
175
+
176
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
177
+
178
+ # Converts hash and nil to an options object
179
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
180
+
181
+ # Customize the options with defaults
182
+ call_metadata = @config.rpcs.list_operations.metadata.to_h
183
+
184
+ # Set x-goog-api-client and x-goog-user-project headers
185
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
186
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
187
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
188
+ transports_version_send: [:rest]
189
+
190
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
191
+
192
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
193
+ metadata: call_metadata,
194
+ retry_policy: @config.rpcs.list_operations.retry_policy
195
+
196
+ options.apply_defaults timeout: @config.timeout,
197
+ metadata: @config.metadata,
198
+ retry_policy: @config.retry_policy
199
+
200
+ @operations_stub.list_operations request, options do |result, operation|
201
+ result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
202
+ yield result, operation if block_given?
203
+ return result
204
+ end
205
+ rescue ::Gapic::Rest::Error => e
206
+ raise ::Google::Cloud::Error.from_error(e)
207
+ end
208
+
209
+ ##
210
+ # Gets the latest state of a long-running operation. Clients can use this
211
+ # method to poll the operation result at intervals as recommended by the API
212
+ # service.
213
+ #
214
+ # @overload get_operation(request, options = nil)
215
+ # Pass arguments to `get_operation` via a request object, either of type
216
+ # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
217
+ #
218
+ # @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
219
+ # A request object representing the call parameters. Required. To specify no
220
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
221
+ # @param options [::Gapic::CallOptions, ::Hash]
222
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
223
+ #
224
+ # @overload get_operation(name: nil)
225
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
226
+ # least one keyword argument is required. To specify no parameters, or to keep all
227
+ # the default parameter values, pass an empty Hash as a request object (see above).
228
+ #
229
+ # @param name [::String]
230
+ # The name of the operation resource.
231
+ # @yield [result, operation] Access the result along with the TransportOperation object
232
+ # @yieldparam result [::Gapic::Operation]
233
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
234
+ #
235
+ # @return [::Gapic::Operation]
236
+ #
237
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
238
+ #
239
+ # @example Basic example
240
+ # require "google/longrunning"
241
+ #
242
+ # # Create a client object. The client can be reused for multiple calls.
243
+ # client = Google::Longrunning::Operations::Rest::Client.new
244
+ #
245
+ # # Create a request. To set request fields, pass in keyword arguments.
246
+ # request = Google::Longrunning::GetOperationRequest.new
247
+ #
248
+ # # Call the get_operation method.
249
+ # result = client.get_operation request
250
+ #
251
+ # # The returned object is of type Gapic::Operation. You can use it to
252
+ # # check the status of an operation, cancel it, or wait for results.
253
+ # # Here is how to wait for a response.
254
+ # result.wait_until_done! timeout: 60
255
+ # if result.response?
256
+ # p result.response
257
+ # else
258
+ # puts "No response received."
259
+ # end
260
+ #
261
+ def get_operation request, options = nil
262
+ raise ::ArgumentError, "request must be provided" if request.nil?
263
+
264
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
265
+
266
+ # Converts hash and nil to an options object
267
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
268
+
269
+ # Customize the options with defaults
270
+ call_metadata = @config.rpcs.get_operation.metadata.to_h
271
+
272
+ # Set x-goog-api-client and x-goog-user-project headers
273
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
274
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
275
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
276
+ transports_version_send: [:rest]
277
+
278
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
+
280
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
281
+ metadata: call_metadata,
282
+ retry_policy: @config.rpcs.get_operation.retry_policy
283
+
284
+ options.apply_defaults timeout: @config.timeout,
285
+ metadata: @config.metadata,
286
+ retry_policy: @config.retry_policy
287
+
288
+ @operations_stub.get_operation request, options do |result, operation|
289
+ result = ::Gapic::Operation.new result, @operations_client, options: options
290
+ yield result, operation if block_given?
291
+ return result
292
+ end
293
+ rescue ::Gapic::Rest::Error => e
294
+ raise ::Google::Cloud::Error.from_error(e)
295
+ end
296
+
297
+ ##
298
+ # Deletes a long-running operation. This method indicates that the client is
299
+ # no longer interested in the operation result. It does not cancel the
300
+ # operation. If the server doesn't support this method, it returns
301
+ # `google.rpc.Code.UNIMPLEMENTED`.
302
+ #
303
+ # @overload delete_operation(request, options = nil)
304
+ # Pass arguments to `delete_operation` via a request object, either of type
305
+ # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
306
+ #
307
+ # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
308
+ # A request object representing the call parameters. Required. To specify no
309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
310
+ # @param options [::Gapic::CallOptions, ::Hash]
311
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
312
+ #
313
+ # @overload delete_operation(name: nil)
314
+ # Pass arguments to `delete_operation` via keyword arguments. Note that at
315
+ # least one keyword argument is required. To specify no parameters, or to keep all
316
+ # the default parameter values, pass an empty Hash as a request object (see above).
317
+ #
318
+ # @param name [::String]
319
+ # The name of the operation resource to be deleted.
320
+ # @yield [result, operation] Access the result along with the TransportOperation object
321
+ # @yieldparam result [::Google::Protobuf::Empty]
322
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
323
+ #
324
+ # @return [::Google::Protobuf::Empty]
325
+ #
326
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ #
328
+ # @example Basic example
329
+ # require "google/longrunning"
330
+ #
331
+ # # Create a client object. The client can be reused for multiple calls.
332
+ # client = Google::Longrunning::Operations::Rest::Client.new
333
+ #
334
+ # # Create a request. To set request fields, pass in keyword arguments.
335
+ # request = Google::Longrunning::DeleteOperationRequest.new
336
+ #
337
+ # # Call the delete_operation method.
338
+ # result = client.delete_operation request
339
+ #
340
+ # # The returned object is of type Google::Protobuf::Empty.
341
+ # p result
342
+ #
343
+ def delete_operation request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ call_metadata = @config.rpcs.delete_operation.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
358
+ transports_version_send: [:rest]
359
+
360
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
+
362
+ options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
363
+ metadata: call_metadata,
364
+ retry_policy: @config.rpcs.delete_operation.retry_policy
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
368
+ retry_policy: @config.retry_policy
369
+
370
+ @operations_stub.delete_operation request, options do |result, operation|
371
+ yield result, operation if block_given?
372
+ return result
373
+ end
374
+ rescue ::Gapic::Rest::Error => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Starts asynchronous cancellation on a long-running operation. The server
380
+ # makes a best effort to cancel the operation, but success is not
381
+ # guaranteed. If the server doesn't support this method, it returns
382
+ # `google.rpc.Code.UNIMPLEMENTED`. Clients can use
383
+ # Operations.GetOperation or
384
+ # other methods to check whether the cancellation succeeded or whether the
385
+ # operation completed despite cancellation. On successful cancellation,
386
+ # the operation is not deleted; instead, it becomes an operation with
387
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
388
+ # corresponding to `Code.CANCELLED`.
389
+ #
390
+ # @overload cancel_operation(request, options = nil)
391
+ # Pass arguments to `cancel_operation` via a request object, either of type
392
+ # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
393
+ #
394
+ # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
395
+ # A request object representing the call parameters. Required. To specify no
396
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
397
+ # @param options [::Gapic::CallOptions, ::Hash]
398
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
399
+ #
400
+ # @overload cancel_operation(name: nil)
401
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
402
+ # least one keyword argument is required. To specify no parameters, or to keep all
403
+ # the default parameter values, pass an empty Hash as a request object (see above).
404
+ #
405
+ # @param name [::String]
406
+ # The name of the operation resource to be cancelled.
407
+ # @yield [result, operation] Access the result along with the TransportOperation object
408
+ # @yieldparam result [::Google::Protobuf::Empty]
409
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
410
+ #
411
+ # @return [::Google::Protobuf::Empty]
412
+ #
413
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
414
+ #
415
+ # @example Basic example
416
+ # require "google/longrunning"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Longrunning::Operations::Rest::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Longrunning::CancelOperationRequest.new
423
+ #
424
+ # # Call the cancel_operation method.
425
+ # result = client.cancel_operation request
426
+ #
427
+ # # The returned object is of type Google::Protobuf::Empty.
428
+ # p result
429
+ #
430
+ def cancel_operation request, options = nil
431
+ raise ::ArgumentError, "request must be provided" if request.nil?
432
+
433
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
434
+
435
+ # Converts hash and nil to an options object
436
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
437
+
438
+ # Customize the options with defaults
439
+ call_metadata = @config.rpcs.cancel_operation.metadata.to_h
440
+
441
+ # Set x-goog-api-client and x-goog-user-project headers
442
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
444
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
445
+ transports_version_send: [:rest]
446
+
447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
+
449
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
450
+ metadata: call_metadata,
451
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
452
+
453
+ options.apply_defaults timeout: @config.timeout,
454
+ metadata: @config.metadata,
455
+ retry_policy: @config.retry_policy
456
+
457
+ @operations_stub.cancel_operation request, options do |result, operation|
458
+ yield result, operation if block_given?
459
+ return result
460
+ end
461
+ rescue ::Gapic::Rest::Error => e
462
+ raise ::Google::Cloud::Error.from_error(e)
463
+ end
464
+
465
+ ##
466
+ # Configuration class for the Operations REST API.
467
+ #
468
+ # This class represents the configuration for Operations REST,
469
+ # providing control over timeouts, retry behavior, logging, transport
470
+ # parameters, and other low-level controls. Certain parameters can also be
471
+ # applied individually to specific RPCs. See
472
+ # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs}
473
+ # for a list of RPCs that can be configured independently.
474
+ #
475
+ # Configuration can be applied globally to all clients, or to a single client
476
+ # on construction.
477
+ #
478
+ # @example
479
+ #
480
+ # # Modify the global config, setting the timeout for
481
+ # # list_operations to 20 seconds,
482
+ # # and all remaining timeouts to 10 seconds.
483
+ # ::Google::Longrunning::Operations::Rest::Client.configure do |config|
484
+ # config.timeout = 10.0
485
+ # config.rpcs.list_operations.timeout = 20.0
486
+ # end
487
+ #
488
+ # # Apply the above configuration only to a new client.
489
+ # client = ::Google::Longrunning::Operations::Rest::Client.new do |config|
490
+ # config.timeout = 10.0
491
+ # config.rpcs.list_operations.timeout = 20.0
492
+ # end
493
+ #
494
+ # @!attribute [rw] endpoint
495
+ # A custom service endpoint, as a hostname or hostname:port. The default is
496
+ # nil, indicating to use the default endpoint in the current universe domain.
497
+ # @return [::String,nil]
498
+ # @!attribute [rw] credentials
499
+ # Credentials to send with calls. You may provide any of the following types:
500
+ # * (`String`) The path to a service account key file in JSON format
501
+ # * (`Hash`) A service account key as a Hash
502
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
503
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
504
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
505
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
506
+ # * (`nil`) indicating no credentials
507
+ # @return [::Object]
508
+ # @!attribute [rw] scope
509
+ # The OAuth scopes
510
+ # @return [::Array<::String>]
511
+ # @!attribute [rw] lib_name
512
+ # The library name as recorded in instrumentation and logging
513
+ # @return [::String]
514
+ # @!attribute [rw] lib_version
515
+ # The library version as recorded in instrumentation and logging
516
+ # @return [::String]
517
+ # @!attribute [rw] timeout
518
+ # The call timeout in seconds.
519
+ # @return [::Numeric]
520
+ # @!attribute [rw] metadata
521
+ # Additional headers to be sent with the call.
522
+ # @return [::Hash{::Symbol=>::String}]
523
+ # @!attribute [rw] retry_policy
524
+ # The retry policy. The value is a hash with the following keys:
525
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
526
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
527
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
528
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
529
+ # trigger a retry.
530
+ # @return [::Hash]
531
+ # @!attribute [rw] quota_project
532
+ # A separate project against which to charge quota.
533
+ # @return [::String]
534
+ # @!attribute [rw] universe_domain
535
+ # The universe domain within which to make requests. This determines the
536
+ # default endpoint URL. The default value of nil uses the environment
537
+ # universe (usually the default "googleapis.com" universe).
538
+ # @return [::String,nil]
539
+ #
540
+ class Configuration
541
+ extend ::Gapic::Config
542
+
543
+ # @private
544
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
545
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
546
+
547
+ config_attr :endpoint, nil, ::String, nil
548
+ config_attr :credentials, nil do |value|
549
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
550
+ allowed.any? { |klass| klass === value }
551
+ end
552
+ config_attr :scope, nil, ::String, ::Array, nil
553
+ config_attr :lib_name, nil, ::String, nil
554
+ config_attr :lib_version, nil, ::String, nil
555
+ config_attr :timeout, nil, ::Numeric, nil
556
+ config_attr :metadata, nil, ::Hash, nil
557
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
558
+ config_attr :quota_project, nil, ::String, nil
559
+ config_attr :universe_domain, nil, ::String, nil
560
+
561
+ # @private
562
+ def initialize parent_config = nil
563
+ @parent_config = parent_config unless parent_config.nil?
564
+
565
+ yield self if block_given?
566
+ end
567
+
568
+ ##
569
+ # Configurations for individual RPCs
570
+ # @return [Rpcs]
571
+ #
572
+ def rpcs
573
+ @rpcs ||= begin
574
+ parent_rpcs = nil
575
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
576
+ Rpcs.new parent_rpcs
577
+ end
578
+ end
579
+
580
+ ##
581
+ # Configuration RPC class for the Operations API.
582
+ #
583
+ # Includes fields providing the configuration for each RPC in this service.
584
+ # Each configuration object is of type `Gapic::Config::Method` and includes
585
+ # the following configuration fields:
586
+ #
587
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
588
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
589
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
590
+ # include the following keys:
591
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
592
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
593
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
594
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
595
+ # trigger a retry.
596
+ #
597
+ class Rpcs
598
+ ##
599
+ # RPC-specific configuration for `list_operations`
600
+ # @return [::Gapic::Config::Method]
601
+ #
602
+ attr_reader :list_operations
603
+ ##
604
+ # RPC-specific configuration for `get_operation`
605
+ # @return [::Gapic::Config::Method]
606
+ #
607
+ attr_reader :get_operation
608
+ ##
609
+ # RPC-specific configuration for `delete_operation`
610
+ # @return [::Gapic::Config::Method]
611
+ #
612
+ attr_reader :delete_operation
613
+ ##
614
+ # RPC-specific configuration for `cancel_operation`
615
+ # @return [::Gapic::Config::Method]
616
+ #
617
+ attr_reader :cancel_operation
618
+
619
+ # @private
620
+ def initialize parent_rpcs = nil
621
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
622
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
623
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
624
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
625
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
626
+ @delete_operation = ::Gapic::Config::Method.new delete_operation_config
627
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
628
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
629
+
630
+ yield self if block_given?
631
+ end
632
+ end
633
+ end
634
+ end
635
+
636
+ ##
637
+ # @private
638
+ # REST service stub for the Longrunning Operations API.
639
+ # Service stub contains baseline method implementations
640
+ # including transcoding, making the REST call, and deserialing the response.
641
+ class OperationsServiceStub
642
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
643
+ # These require statements are intentionally placed here to initialize
644
+ # the REST modules only when it's required.
645
+ require "gapic/rest"
646
+
647
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
648
+ endpoint_template: endpoint_template,
649
+ universe_domain: universe_domain,
650
+ credentials: credentials
651
+ end
652
+
653
+ ##
654
+ # Baseline implementation for the list_operations REST call
655
+ #
656
+ # @param request_pb [::Google::Longrunning::ListOperationsRequest]
657
+ # A request object representing the call parameters. Required.
658
+ # @param options [::Gapic::CallOptions]
659
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
660
+ #
661
+ # @yield [result, operation] Access the result along with the TransportOperation object
662
+ # @yieldparam result [::Google::Longrunning::ListOperationsResponse]
663
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
664
+ #
665
+ # @return [::Google::Longrunning::ListOperationsResponse]
666
+ # A result object deserialized from the server's reply
667
+ def list_operations request_pb, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
669
+
670
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
671
+ query_string_params = if query_string_params.any?
672
+ query_string_params.to_h { |p| p.split "=", 2 }
673
+ else
674
+ {}
675
+ end
676
+
677
+ response = @client_stub.make_http_request(
678
+ verb,
679
+ uri: uri,
680
+ body: body || "",
681
+ params: query_string_params,
682
+ options: options
683
+ )
684
+ operation = ::Gapic::Rest::TransportOperation.new response
685
+ result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
686
+
687
+ yield result, operation if block_given?
688
+ result
689
+ end
690
+
691
+ ##
692
+ # Baseline implementation for the get_operation REST call
693
+ #
694
+ # @param request_pb [::Google::Longrunning::GetOperationRequest]
695
+ # A request object representing the call parameters. Required.
696
+ # @param options [::Gapic::CallOptions]
697
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
698
+ #
699
+ # @yield [result, operation] Access the result along with the TransportOperation object
700
+ # @yieldparam result [::Google::Longrunning::Operation]
701
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
702
+ #
703
+ # @return [::Google::Longrunning::Operation]
704
+ # A result object deserialized from the server's reply
705
+ def get_operation request_pb, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
707
+
708
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
709
+ query_string_params = if query_string_params.any?
710
+ query_string_params.to_h { |p| p.split "=", 2 }
711
+ else
712
+ {}
713
+ end
714
+
715
+ response = @client_stub.make_http_request(
716
+ verb,
717
+ uri: uri,
718
+ body: body || "",
719
+ params: query_string_params,
720
+ options: options
721
+ )
722
+ operation = ::Gapic::Rest::TransportOperation.new response
723
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
724
+
725
+ yield result, operation if block_given?
726
+ result
727
+ end
728
+
729
+ ##
730
+ # Baseline implementation for the delete_operation REST call
731
+ #
732
+ # @param request_pb [::Google::Longrunning::DeleteOperationRequest]
733
+ # A request object representing the call parameters. Required.
734
+ # @param options [::Gapic::CallOptions]
735
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
736
+ #
737
+ # @yield [result, operation] Access the result along with the TransportOperation object
738
+ # @yieldparam result [::Google::Protobuf::Empty]
739
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
740
+ #
741
+ # @return [::Google::Protobuf::Empty]
742
+ # A result object deserialized from the server's reply
743
+ def delete_operation request_pb, options = nil
744
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
745
+
746
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
747
+ query_string_params = if query_string_params.any?
748
+ query_string_params.to_h { |p| p.split "=", 2 }
749
+ else
750
+ {}
751
+ end
752
+
753
+ response = @client_stub.make_http_request(
754
+ verb,
755
+ uri: uri,
756
+ body: body || "",
757
+ params: query_string_params,
758
+ options: options
759
+ )
760
+ operation = ::Gapic::Rest::TransportOperation.new response
761
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
762
+
763
+ yield result, operation if block_given?
764
+ result
765
+ end
766
+
767
+ ##
768
+ # Baseline implementation for the cancel_operation REST call
769
+ #
770
+ # @param request_pb [::Google::Longrunning::CancelOperationRequest]
771
+ # A request object representing the call parameters. Required.
772
+ # @param options [::Gapic::CallOptions]
773
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
774
+ #
775
+ # @yield [result, operation] Access the result along with the TransportOperation object
776
+ # @yieldparam result [::Google::Protobuf::Empty]
777
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
778
+ #
779
+ # @return [::Google::Protobuf::Empty]
780
+ # A result object deserialized from the server's reply
781
+ def cancel_operation request_pb, options = nil
782
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
783
+
784
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
785
+ query_string_params = if query_string_params.any?
786
+ query_string_params.to_h { |p| p.split "=", 2 }
787
+ else
788
+ {}
789
+ end
790
+
791
+ response = @client_stub.make_http_request(
792
+ verb,
793
+ uri: uri,
794
+ body: body || "",
795
+ params: query_string_params,
796
+ options: options
797
+ )
798
+ operation = ::Gapic::Rest::TransportOperation.new response
799
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
800
+
801
+ yield result, operation if block_given?
802
+ result
803
+ end
804
+
805
+ ##
806
+ # @private
807
+ #
808
+ # GRPC transcoding helper method for the list_operations REST call
809
+ #
810
+ # @param request_pb [::Google::Longrunning::ListOperationsRequest]
811
+ # A request object representing the call parameters. Required.
812
+ # @return [Array(String, [String, nil], Hash{String => String})]
813
+ # Uri, Body, Query string parameters
814
+ def self.transcode_list_operations_request request_pb
815
+ transcoder = Gapic::Rest::GrpcTranscoder.new
816
+ .with_bindings(
817
+ uri_method: :get,
818
+ uri_template: "/v1/{name}/operations",
819
+ matches: [
820
+ ["name", %r{^projects/[^/]+/?$}, false]
821
+ ]
822
+ )
823
+ .with_bindings(
824
+ uri_method: :get,
825
+ uri_template: "/v1/{name}/operations",
826
+ matches: [
827
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false]
828
+ ]
829
+ )
830
+ .with_bindings(
831
+ uri_method: :get,
832
+ uri_template: "/v1/{name}/operations",
833
+ matches: [
834
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false]
835
+ ]
836
+ )
837
+ .with_bindings(
838
+ uri_method: :get,
839
+ uri_template: "/v1/{name}/operations",
840
+ matches: [
841
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false]
842
+ ]
843
+ )
844
+ .with_bindings(
845
+ uri_method: :get,
846
+ uri_template: "/v1/{name}/operations",
847
+ matches: [
848
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false]
849
+ ]
850
+ )
851
+ .with_bindings(
852
+ uri_method: :get,
853
+ uri_template: "/v1/{name}/operations",
854
+ matches: [
855
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false]
856
+ ]
857
+ )
858
+ .with_bindings(
859
+ uri_method: :get,
860
+ uri_template: "/v1/{name}/operations",
861
+ matches: [
862
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false]
863
+ ]
864
+ )
865
+ .with_bindings(
866
+ uri_method: :get,
867
+ uri_template: "/v1/{name}/operations",
868
+ matches: [
869
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
870
+ ]
871
+ )
872
+ .with_bindings(
873
+ uri_method: :get,
874
+ uri_template: "/v1/{name}/operations",
875
+ matches: [
876
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
877
+ ]
878
+ )
879
+ .with_bindings(
880
+ uri_method: :get,
881
+ uri_template: "/v1/{name}/operations",
882
+ matches: [
883
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false]
884
+ ]
885
+ )
886
+ .with_bindings(
887
+ uri_method: :get,
888
+ uri_template: "/v1/{name}/operations",
889
+ matches: [
890
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false]
891
+ ]
892
+ )
893
+ .with_bindings(
894
+ uri_method: :get,
895
+ uri_template: "/v1/{name}/operations",
896
+ matches: [
897
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false]
898
+ ]
899
+ )
900
+ .with_bindings(
901
+ uri_method: :get,
902
+ uri_template: "/v1/{name}/operations",
903
+ matches: [
904
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
905
+ ]
906
+ )
907
+ .with_bindings(
908
+ uri_method: :get,
909
+ uri_template: "/v1/{name}/operations",
910
+ matches: [
911
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
912
+ ]
913
+ )
914
+ .with_bindings(
915
+ uri_method: :get,
916
+ uri_template: "/v1/{name}/operations",
917
+ matches: [
918
+ ["name", %r{^projects/[^/]+/?$}, false]
919
+ ]
920
+ )
921
+ transcoder.transcode request_pb
922
+ end
923
+
924
+ ##
925
+ # @private
926
+ #
927
+ # GRPC transcoding helper method for the get_operation REST call
928
+ #
929
+ # @param request_pb [::Google::Longrunning::GetOperationRequest]
930
+ # A request object representing the call parameters. Required.
931
+ # @return [Array(String, [String, nil], Hash{String => String})]
932
+ # Uri, Body, Query string parameters
933
+ def self.transcode_get_operation_request request_pb
934
+ transcoder = Gapic::Rest::GrpcTranscoder.new
935
+ .with_bindings(
936
+ uri_method: :get,
937
+ uri_template: "/v1/{name}",
938
+ matches: [
939
+ ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false]
940
+ ]
941
+ )
942
+ .with_bindings(
943
+ uri_method: :get,
944
+ uri_template: "/v1/{name}",
945
+ matches: [
946
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false]
947
+ ]
948
+ )
949
+ .with_bindings(
950
+ uri_method: :get,
951
+ uri_template: "/v1/{name}",
952
+ matches: [
953
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false]
954
+ ]
955
+ )
956
+ .with_bindings(
957
+ uri_method: :get,
958
+ uri_template: "/v1/{name}",
959
+ matches: [
960
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false]
961
+ ]
962
+ )
963
+ .with_bindings(
964
+ uri_method: :get,
965
+ uri_template: "/v1/{name}",
966
+ matches: [
967
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
968
+ ]
969
+ )
970
+ .with_bindings(
971
+ uri_method: :get,
972
+ uri_template: "/v1/{name}",
973
+ matches: [
974
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false]
975
+ ]
976
+ )
977
+ .with_bindings(
978
+ uri_method: :get,
979
+ uri_template: "/v1/{name}",
980
+ matches: [
981
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false]
982
+ ]
983
+ )
984
+ .with_bindings(
985
+ uri_method: :get,
986
+ uri_template: "/v1/{name}",
987
+ matches: [
988
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false]
989
+ ]
990
+ )
991
+ .with_bindings(
992
+ uri_method: :get,
993
+ uri_template: "/v1/{name}",
994
+ matches: [
995
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false]
996
+ ]
997
+ )
998
+ .with_bindings(
999
+ uri_method: :get,
1000
+ uri_template: "/v1/{name}",
1001
+ matches: [
1002
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false]
1003
+ ]
1004
+ )
1005
+ .with_bindings(
1006
+ uri_method: :get,
1007
+ uri_template: "/v1/{name}",
1008
+ matches: [
1009
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false]
1010
+ ]
1011
+ )
1012
+ .with_bindings(
1013
+ uri_method: :get,
1014
+ uri_template: "/v1/{name}",
1015
+ matches: [
1016
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false]
1017
+ ]
1018
+ )
1019
+ .with_bindings(
1020
+ uri_method: :get,
1021
+ uri_template: "/v1/{name}",
1022
+ matches: [
1023
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
1024
+ ]
1025
+ )
1026
+ .with_bindings(
1027
+ uri_method: :get,
1028
+ uri_template: "/v1/{name}",
1029
+ matches: [
1030
+ ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
1031
+ ]
1032
+ )
1033
+ .with_bindings(
1034
+ uri_method: :get,
1035
+ uri_template: "/v1/{name}",
1036
+ matches: [
1037
+ ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false]
1038
+ ]
1039
+ )
1040
+ transcoder.transcode request_pb
1041
+ end
1042
+
1043
+ ##
1044
+ # @private
1045
+ #
1046
+ # GRPC transcoding helper method for the delete_operation REST call
1047
+ #
1048
+ # @param request_pb [::Google::Longrunning::DeleteOperationRequest]
1049
+ # A request object representing the call parameters. Required.
1050
+ # @return [Array(String, [String, nil], Hash{String => String})]
1051
+ # Uri, Body, Query string parameters
1052
+ def self.transcode_delete_operation_request request_pb
1053
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1054
+ .with_bindings(
1055
+ uri_method: :delete,
1056
+ uri_template: "/v1/{name}",
1057
+ matches: [
1058
+ ["name", %r{^operations(?:/.*)?$}, true]
1059
+ ]
1060
+ )
1061
+ transcoder.transcode request_pb
1062
+ end
1063
+
1064
+ ##
1065
+ # @private
1066
+ #
1067
+ # GRPC transcoding helper method for the cancel_operation REST call
1068
+ #
1069
+ # @param request_pb [::Google::Longrunning::CancelOperationRequest]
1070
+ # A request object representing the call parameters. Required.
1071
+ # @return [Array(String, [String, nil], Hash{String => String})]
1072
+ # Uri, Body, Query string parameters
1073
+ def self.transcode_cancel_operation_request request_pb
1074
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1075
+ .with_bindings(
1076
+ uri_method: :post,
1077
+ uri_template: "/v1/{name}:cancel",
1078
+ body: "*",
1079
+ matches: [
1080
+ ["name", %r{^operations(?:/.*)?$}, true]
1081
+ ]
1082
+ )
1083
+ transcoder.transcode request_pb
1084
+ end
1085
+ end
1086
+ end
1087
+ end
1088
+ end
1089
+ end
1090
+ end
1091
+ end