google-cloud-ces-v1beta 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/ces/v1beta/agent_card_pb.rb +26 -0
  6. data/lib/google/cloud/ces/v1beta/agent_pb.rb +30 -0
  7. data/lib/google/cloud/ces/v1beta/agent_service/client.rb +5641 -0
  8. data/lib/google/cloud/ces/v1beta/agent_service/credentials.rb +48 -0
  9. data/lib/google/cloud/ces/v1beta/agent_service/operations.rb +843 -0
  10. data/lib/google/cloud/ces/v1beta/agent_service/paths.rb +481 -0
  11. data/lib/google/cloud/ces/v1beta/agent_service/rest/client.rb +5249 -0
  12. data/lib/google/cloud/ces/v1beta/agent_service/rest/operations.rb +927 -0
  13. data/lib/google/cloud/ces/v1beta/agent_service/rest/service_stub.rb +3213 -0
  14. data/lib/google/cloud/ces/v1beta/agent_service/rest.rb +55 -0
  15. data/lib/google/cloud/ces/v1beta/agent_service.rb +57 -0
  16. data/lib/google/cloud/ces/v1beta/agent_service_pb.rb +132 -0
  17. data/lib/google/cloud/ces/v1beta/agent_service_services_pb.rb +148 -0
  18. data/lib/google/cloud/ces/v1beta/agent_tool_pb.rb +24 -0
  19. data/lib/google/cloud/ces/v1beta/agent_transfers_pb.rb +29 -0
  20. data/lib/google/cloud/ces/v1beta/app_pb.rb +70 -0
  21. data/lib/google/cloud/ces/v1beta/app_version_pb.rb +32 -0
  22. data/lib/google/cloud/ces/v1beta/auth_pb.rb +34 -0
  23. data/lib/google/cloud/ces/v1beta/bigquery_export_pb.rb +23 -0
  24. data/lib/google/cloud/ces/v1beta/bindings_override.rb +75 -0
  25. data/lib/google/cloud/ces/v1beta/changelog_pb.rb +26 -0
  26. data/lib/google/cloud/ces/v1beta/client_function_pb.rb +24 -0
  27. data/lib/google/cloud/ces/v1beta/common_pb.rb +46 -0
  28. data/lib/google/cloud/ces/v1beta/connector_tool_pb.rb +27 -0
  29. data/lib/google/cloud/ces/v1beta/connector_toolset_pb.rb +25 -0
  30. data/lib/google/cloud/ces/v1beta/conversation_pb.rb +31 -0
  31. data/lib/google/cloud/ces/v1beta/data_store_pb.rb +27 -0
  32. data/lib/google/cloud/ces/v1beta/data_store_tool_pb.rb +40 -0
  33. data/lib/google/cloud/ces/v1beta/deployment_pb.rb +30 -0
  34. data/lib/google/cloud/ces/v1beta/evaluation_metrics_config_pb.rb +31 -0
  35. data/lib/google/cloud/ces/v1beta/evaluation_pb.rb +99 -0
  36. data/lib/google/cloud/ces/v1beta/evaluation_service/client.rb +4050 -0
  37. data/lib/google/cloud/ces/v1beta/evaluation_service/credentials.rb +48 -0
  38. data/lib/google/cloud/ces/v1beta/evaluation_service/operations.rb +843 -0
  39. data/lib/google/cloud/ces/v1beta/evaluation_service/paths.rb +306 -0
  40. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/client.rb +3770 -0
  41. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/operations.rb +927 -0
  42. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/service_stub.rb +2233 -0
  43. data/lib/google/cloud/ces/v1beta/evaluation_service/rest.rb +54 -0
  44. data/lib/google/cloud/ces/v1beta/evaluation_service.rb +56 -0
  45. data/lib/google/cloud/ces/v1beta/evaluation_service_pb.rb +93 -0
  46. data/lib/google/cloud/ces/v1beta/evaluation_service_services_pb.rb +116 -0
  47. data/lib/google/cloud/ces/v1beta/example_pb.rb +34 -0
  48. data/lib/google/cloud/ces/v1beta/fakes_pb.rb +25 -0
  49. data/lib/google/cloud/ces/v1beta/file_context_pb.rb +24 -0
  50. data/lib/google/cloud/ces/v1beta/file_search_tool_pb.rb +24 -0
  51. data/lib/google/cloud/ces/v1beta/golden_run_pb.rb +21 -0
  52. data/lib/google/cloud/ces/v1beta/google_search_tool_pb.rb +24 -0
  53. data/lib/google/cloud/ces/v1beta/guardrail_pb.rb +37 -0
  54. data/lib/google/cloud/ces/v1beta/mcp_tool_pb.rb +27 -0
  55. data/lib/google/cloud/ces/v1beta/mcp_toolset_pb.rb +28 -0
  56. data/lib/google/cloud/ces/v1beta/mocks_pb.rb +26 -0
  57. data/lib/google/cloud/ces/v1beta/omnichannel_pb.rb +31 -0
  58. data/lib/google/cloud/ces/v1beta/omnichannel_service_pb.rb +27 -0
  59. data/lib/google/cloud/ces/v1beta/open_api_tool_pb.rb +25 -0
  60. data/lib/google/cloud/ces/v1beta/open_api_toolset_pb.rb +25 -0
  61. data/lib/google/cloud/ces/v1beta/python_function_pb.rb +24 -0
  62. data/lib/google/cloud/ces/v1beta/rest.rb +42 -0
  63. data/lib/google/cloud/ces/v1beta/schema_pb.rb +25 -0
  64. data/lib/google/cloud/ces/v1beta/search_suggestions_pb.rb +22 -0
  65. data/lib/google/cloud/ces/v1beta/security_settings_pb.rb +27 -0
  66. data/lib/google/cloud/ces/v1beta/session_service/client.rb +762 -0
  67. data/lib/google/cloud/ces/v1beta/session_service/credentials.rb +48 -0
  68. data/lib/google/cloud/ces/v1beta/session_service/paths.rb +117 -0
  69. data/lib/google/cloud/ces/v1beta/session_service/rest/client.rb +562 -0
  70. data/lib/google/cloud/ces/v1beta/session_service/rest/service_stub.rb +199 -0
  71. data/lib/google/cloud/ces/v1beta/session_service/rest.rb +53 -0
  72. data/lib/google/cloud/ces/v1beta/session_service.rb +55 -0
  73. data/lib/google/cloud/ces/v1beta/session_service_pb.rb +54 -0
  74. data/lib/google/cloud/ces/v1beta/session_service_services_pb.rb +120 -0
  75. data/lib/google/cloud/ces/v1beta/system_tool_pb.rb +23 -0
  76. data/lib/google/cloud/ces/v1beta/tool_pb.rb +40 -0
  77. data/lib/google/cloud/ces/v1beta/tool_service/client.rb +733 -0
  78. data/lib/google/cloud/ces/v1beta/tool_service/credentials.rb +48 -0
  79. data/lib/google/cloud/ces/v1beta/tool_service/paths.rb +94 -0
  80. data/lib/google/cloud/ces/v1beta/tool_service/rest/client.rb +677 -0
  81. data/lib/google/cloud/ces/v1beta/tool_service/rest/service_stub.rb +267 -0
  82. data/lib/google/cloud/ces/v1beta/tool_service/rest.rb +53 -0
  83. data/lib/google/cloud/ces/v1beta/tool_service.rb +55 -0
  84. data/lib/google/cloud/ces/v1beta/tool_service_pb.rb +37 -0
  85. data/lib/google/cloud/ces/v1beta/tool_service_services_pb.rb +50 -0
  86. data/lib/google/cloud/ces/v1beta/toolset_pb.rb +30 -0
  87. data/lib/google/cloud/ces/v1beta/toolset_tool_pb.rb +24 -0
  88. data/lib/google/cloud/ces/v1beta/version.rb +7 -2
  89. data/lib/google/cloud/ces/v1beta/widget_service/client.rb +503 -0
  90. data/lib/google/cloud/ces/v1beta/widget_service/credentials.rb +48 -0
  91. data/lib/google/cloud/ces/v1beta/widget_service/paths.rb +75 -0
  92. data/lib/google/cloud/ces/v1beta/widget_service/rest/client.rb +461 -0
  93. data/lib/google/cloud/ces/v1beta/widget_service/rest/service_stub.rb +143 -0
  94. data/lib/google/cloud/ces/v1beta/widget_service/rest.rb +53 -0
  95. data/lib/google/cloud/ces/v1beta/widget_service.rb +55 -0
  96. data/lib/google/cloud/ces/v1beta/widget_service_pb.rb +28 -0
  97. data/lib/google/cloud/ces/v1beta/widget_service_services_pb.rb +46 -0
  98. data/lib/google/cloud/ces/v1beta/widget_tool_pb.rb +31 -0
  99. data/lib/google/cloud/ces/v1beta.rb +49 -0
  100. data/lib/google-cloud-ces-v1beta.rb +21 -0
  101. data/proto_docs/README.md +4 -0
  102. data/proto_docs/google/api/client.rb +593 -0
  103. data/proto_docs/google/api/field_behavior.rb +85 -0
  104. data/proto_docs/google/api/launch_stage.rb +71 -0
  105. data/proto_docs/google/api/resource.rb +227 -0
  106. data/proto_docs/google/cloud/ces/v1beta/agent.rb +233 -0
  107. data/proto_docs/google/cloud/ces/v1beta/agent_card.rb +122 -0
  108. data/proto_docs/google/cloud/ces/v1beta/agent_service.rb +1682 -0
  109. data/proto_docs/google/cloud/ces/v1beta/agent_tool.rb +48 -0
  110. data/proto_docs/google/cloud/ces/v1beta/agent_transfers.rb +111 -0
  111. data/proto_docs/google/cloud/ces/v1beta/app.rb +883 -0
  112. data/proto_docs/google/cloud/ces/v1beta/app_version.rb +83 -0
  113. data/proto_docs/google/cloud/ces/v1beta/auth.rb +214 -0
  114. data/proto_docs/google/cloud/ces/v1beta/bigquery_export.rb +45 -0
  115. data/proto_docs/google/cloud/ces/v1beta/changelog.rb +73 -0
  116. data/proto_docs/google/cloud/ces/v1beta/client_function.rb +48 -0
  117. data/proto_docs/google/cloud/ces/v1beta/common.rb +375 -0
  118. data/proto_docs/google/cloud/ces/v1beta/connector_tool.rb +122 -0
  119. data/proto_docs/google/cloud/ces/v1beta/connector_toolset.rb +52 -0
  120. data/proto_docs/google/cloud/ces/v1beta/conversation.rb +159 -0
  121. data/proto_docs/google/cloud/ces/v1beta/data_store.rb +102 -0
  122. data/proto_docs/google/cloud/ces/v1beta/data_store_tool.rb +328 -0
  123. data/proto_docs/google/cloud/ces/v1beta/deployment.rb +123 -0
  124. data/proto_docs/google/cloud/ces/v1beta/evaluation.rb +1687 -0
  125. data/proto_docs/google/cloud/ces/v1beta/evaluation_metrics_config.rb +151 -0
  126. data/proto_docs/google/cloud/ces/v1beta/evaluation_service.rb +1087 -0
  127. data/proto_docs/google/cloud/ces/v1beta/example.rb +245 -0
  128. data/proto_docs/google/cloud/ces/v1beta/fakes.rb +67 -0
  129. data/proto_docs/google/cloud/ces/v1beta/file_context.rb +50 -0
  130. data/proto_docs/google/cloud/ces/v1beta/file_search_tool.rb +60 -0
  131. data/proto_docs/google/cloud/ces/v1beta/golden_run.rb +40 -0
  132. data/proto_docs/google/cloud/ces/v1beta/google_search_tool.rb +76 -0
  133. data/proto_docs/google/cloud/ces/v1beta/guardrail.rb +324 -0
  134. data/proto_docs/google/cloud/ces/v1beta/mcp_tool.rb +110 -0
  135. data/proto_docs/google/cloud/ces/v1beta/mcp_toolset.rb +118 -0
  136. data/proto_docs/google/cloud/ces/v1beta/mocks.rb +60 -0
  137. data/proto_docs/google/cloud/ces/v1beta/omnichannel.rb +163 -0
  138. data/proto_docs/google/cloud/ces/v1beta/omnichannel_service.rb +45 -0
  139. data/proto_docs/google/cloud/ces/v1beta/open_api_tool.rb +66 -0
  140. data/proto_docs/google/cloud/ces/v1beta/open_api_toolset.rb +57 -0
  141. data/proto_docs/google/cloud/ces/v1beta/python_function.rb +47 -0
  142. data/proto_docs/google/cloud/ces/v1beta/schema.rb +162 -0
  143. data/proto_docs/google/cloud/ces/v1beta/search_suggestions.rb +55 -0
  144. data/proto_docs/google/cloud/ces/v1beta/security_settings.rb +80 -0
  145. data/proto_docs/google/cloud/ces/v1beta/session_service.rb +493 -0
  146. data/proto_docs/google/cloud/ces/v1beta/system_tool.rb +38 -0
  147. data/proto_docs/google/cloud/ces/v1beta/tool.rb +136 -0
  148. data/proto_docs/google/cloud/ces/v1beta/tool_service.rb +185 -0
  149. data/proto_docs/google/cloud/ces/v1beta/toolset.rb +80 -0
  150. data/proto_docs/google/cloud/ces/v1beta/toolset_tool.rb +40 -0
  151. data/proto_docs/google/cloud/ces/v1beta/widget_service.rb +62 -0
  152. data/proto_docs/google/cloud/ces/v1beta/widget_tool.rb +182 -0
  153. data/proto_docs/google/longrunning/operations.rb +191 -0
  154. data/proto_docs/google/protobuf/any.rb +145 -0
  155. data/proto_docs/google/protobuf/duration.rb +98 -0
  156. data/proto_docs/google/protobuf/empty.rb +34 -0
  157. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  158. data/proto_docs/google/protobuf/struct.rb +108 -0
  159. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  160. data/proto_docs/google/rpc/status.rb +48 -0
  161. metadata +208 -9
@@ -0,0 +1,927 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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 Ces
24
+ module V1beta
25
+ module EvaluationService
26
+ module Rest
27
+ # Service that implements Longrunning Operations API.
28
+ class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
32
+ # @private
33
+ DEFAULT_ENDPOINT_TEMPLATE = "ces.$UNIVERSE_DOMAIN$"
34
+
35
+ # @private
36
+ attr_reader :operations_stub
37
+
38
+ ##
39
+ # Configuration for the EvaluationService Operations API.
40
+ #
41
+ # @yield [config] Configure the Operations client.
42
+ # @yieldparam config [Operations::Configuration]
43
+ #
44
+ # @return [Operations::Configuration]
45
+ #
46
+ def self.configure
47
+ @configure ||= Operations::Configuration.new
48
+ yield @configure if block_given?
49
+ @configure
50
+ end
51
+
52
+ ##
53
+ # Configure the EvaluationService Operations instance.
54
+ #
55
+ # The configuration is set to the derived mode, meaning that values can be changed,
56
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
57
+ # should be made on {Operations.configure}.
58
+ #
59
+ # @yield [config] Configure the Operations client.
60
+ # @yieldparam config [Operations::Configuration]
61
+ #
62
+ # @return [Operations::Configuration]
63
+ #
64
+ def configure
65
+ yield @config if block_given?
66
+ @config
67
+ end
68
+
69
+ ##
70
+ # The effective universe domain
71
+ #
72
+ # @return [String]
73
+ #
74
+ def universe_domain
75
+ @operations_stub.universe_domain
76
+ end
77
+
78
+ ##
79
+ # Create a new Operations client object.
80
+ #
81
+ # @yield [config] Configure the Client client.
82
+ # @yieldparam config [Operations::Configuration]
83
+ #
84
+ def initialize
85
+ # Create the configuration object
86
+ @config = Configuration.new Operations.configure
87
+
88
+ # Yield the configuration if needed
89
+ yield @config if block_given?
90
+
91
+ # Create credentials
92
+ credentials = @config.credentials
93
+ credentials ||= Credentials.default scope: @config.scope
94
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
95
+ credentials = Credentials.new credentials, scope: @config.scope
96
+ end
97
+
98
+ @quota_project_id = @config.quota_project
99
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
100
+
101
+ @operations_stub = OperationsServiceStub.new(
102
+ endpoint: @config.endpoint,
103
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
104
+ universe_domain: @config.universe_domain,
105
+ credentials: credentials
106
+ )
107
+
108
+ # Used by an LRO wrapper for some methods of this service
109
+ @operations_client = self
110
+ end
111
+
112
+ # Service calls
113
+
114
+ ##
115
+ # Lists operations that match the specified filter in the request. If the
116
+ # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
+ #
118
+ # @overload list_operations(request, options = nil)
119
+ # Pass arguments to `list_operations` via a request object, either of type
120
+ # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
121
+ #
122
+ # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
123
+ # A request object representing the call parameters. Required. To specify no
124
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
125
+ # @param options [::Gapic::CallOptions, ::Hash]
126
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
+ #
128
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
129
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
130
+ # least one keyword argument is required. To specify no parameters, or to keep all
131
+ # the default parameter values, pass an empty Hash as a request object (see above).
132
+ #
133
+ # @param name [::String]
134
+ # The name of the operation's parent resource.
135
+ # @param filter [::String]
136
+ # The standard list filter.
137
+ # @param page_size [::Integer]
138
+ # The standard list page size.
139
+ # @param page_token [::String]
140
+ # The standard list page token.
141
+ # @param return_partial_success [::Boolean]
142
+ # When set to `true`, operations that are reachable are returned as normal,
143
+ # and those that are unreachable are returned in the
144
+ # [ListOperationsResponse.unreachable] field.
145
+ #
146
+ # This can only be `true` when reading across collections e.g. when `parent`
147
+ # is set to `"projects/example/locations/-"`.
148
+ #
149
+ # This field is not by default supported and will result in an
150
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
151
+ # service or product specific documentation.
152
+ # @yield [result, operation] Access the result along with the TransportOperation object
153
+ # @yieldparam result [::Gapic::Operation]
154
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
155
+ #
156
+ # @return [::Gapic::Operation]
157
+ #
158
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
159
+ #
160
+ # @example Basic example
161
+ # require "google/longrunning"
162
+ #
163
+ # # Create a client object. The client can be reused for multiple calls.
164
+ # client = Google::Longrunning::Operations::Rest::Client.new
165
+ #
166
+ # # Create a request. To set request fields, pass in keyword arguments.
167
+ # request = Google::Longrunning::ListOperationsRequest.new
168
+ #
169
+ # # Call the list_operations method.
170
+ # result = client.list_operations request
171
+ #
172
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
173
+ # # over elements, and API calls will be issued to fetch pages as needed.
174
+ # result.each do |item|
175
+ # # Each element is of type ::Google::Longrunning::Operation.
176
+ # p item
177
+ # end
178
+ #
179
+ def list_operations request, options = nil
180
+ raise ::ArgumentError, "request must be provided" if request.nil?
181
+
182
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
183
+
184
+ # Converts hash and nil to an options object
185
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
186
+
187
+ # Customize the options with defaults
188
+ call_metadata = @config.rpcs.list_operations.metadata.to_h
189
+
190
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
191
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
192
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
193
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
194
+ transports_version_send: [:rest]
195
+
196
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
197
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
198
+
199
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
200
+ metadata: call_metadata,
201
+ retry_policy: @config.rpcs.list_operations.retry_policy
202
+
203
+ options.apply_defaults timeout: @config.timeout,
204
+ metadata: @config.metadata,
205
+ retry_policy: @config.retry_policy
206
+
207
+ @operations_stub.list_operations request, options do |result, operation|
208
+ result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
209
+ yield result, operation if block_given?
210
+ throw :response, result
211
+ end
212
+ rescue ::Gapic::Rest::Error => e
213
+ raise ::Google::Cloud::Error.from_error(e)
214
+ end
215
+
216
+ ##
217
+ # Gets the latest state of a long-running operation. Clients can use this
218
+ # method to poll the operation result at intervals as recommended by the API
219
+ # service.
220
+ #
221
+ # @overload get_operation(request, options = nil)
222
+ # Pass arguments to `get_operation` via a request object, either of type
223
+ # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
224
+ #
225
+ # @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
226
+ # A request object representing the call parameters. Required. To specify no
227
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
228
+ # @param options [::Gapic::CallOptions, ::Hash]
229
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
230
+ #
231
+ # @overload get_operation(name: nil)
232
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
233
+ # least one keyword argument is required. To specify no parameters, or to keep all
234
+ # the default parameter values, pass an empty Hash as a request object (see above).
235
+ #
236
+ # @param name [::String]
237
+ # The name of the operation resource.
238
+ # @yield [result, operation] Access the result along with the TransportOperation object
239
+ # @yieldparam result [::Gapic::Operation]
240
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
241
+ #
242
+ # @return [::Gapic::Operation]
243
+ #
244
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
245
+ #
246
+ # @example Basic example
247
+ # require "google/longrunning"
248
+ #
249
+ # # Create a client object. The client can be reused for multiple calls.
250
+ # client = Google::Longrunning::Operations::Rest::Client.new
251
+ #
252
+ # # Create a request. To set request fields, pass in keyword arguments.
253
+ # request = Google::Longrunning::GetOperationRequest.new
254
+ #
255
+ # # Call the get_operation method.
256
+ # result = client.get_operation request
257
+ #
258
+ # # The returned object is of type Gapic::Operation. You can use it to
259
+ # # check the status of an operation, cancel it, or wait for results.
260
+ # # Here is how to wait for a response.
261
+ # result.wait_until_done! timeout: 60
262
+ # if result.response?
263
+ # p result.response
264
+ # else
265
+ # puts "No response received."
266
+ # end
267
+ #
268
+ def get_operation request, options = nil
269
+ raise ::ArgumentError, "request must be provided" if request.nil?
270
+
271
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
272
+
273
+ # Converts hash and nil to an options object
274
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
275
+
276
+ # Customize the options with defaults
277
+ call_metadata = @config.rpcs.get_operation.metadata.to_h
278
+
279
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
280
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
281
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
282
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
283
+ transports_version_send: [:rest]
284
+
285
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
286
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
289
+ metadata: call_metadata,
290
+ retry_policy: @config.rpcs.get_operation.retry_policy
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
294
+ retry_policy: @config.retry_policy
295
+
296
+ @operations_stub.get_operation request, options do |result, operation|
297
+ result = ::Gapic::Operation.new result, @operations_client, options: options
298
+ yield result, operation if block_given?
299
+ throw :response, result
300
+ end
301
+ rescue ::Gapic::Rest::Error => e
302
+ raise ::Google::Cloud::Error.from_error(e)
303
+ end
304
+
305
+ ##
306
+ # Deletes a long-running operation. This method indicates that the client is
307
+ # no longer interested in the operation result. It does not cancel the
308
+ # operation. If the server doesn't support this method, it returns
309
+ # `google.rpc.Code.UNIMPLEMENTED`.
310
+ #
311
+ # @overload delete_operation(request, options = nil)
312
+ # Pass arguments to `delete_operation` via a request object, either of type
313
+ # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
314
+ #
315
+ # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
316
+ # A request object representing the call parameters. Required. To specify no
317
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
318
+ # @param options [::Gapic::CallOptions, ::Hash]
319
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
320
+ #
321
+ # @overload delete_operation(name: nil)
322
+ # Pass arguments to `delete_operation` via keyword arguments. Note that at
323
+ # least one keyword argument is required. To specify no parameters, or to keep all
324
+ # the default parameter values, pass an empty Hash as a request object (see above).
325
+ #
326
+ # @param name [::String]
327
+ # The name of the operation resource to be deleted.
328
+ # @yield [result, operation] Access the result along with the TransportOperation object
329
+ # @yieldparam result [::Google::Protobuf::Empty]
330
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
331
+ #
332
+ # @return [::Google::Protobuf::Empty]
333
+ #
334
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
335
+ #
336
+ # @example Basic example
337
+ # require "google/longrunning"
338
+ #
339
+ # # Create a client object. The client can be reused for multiple calls.
340
+ # client = Google::Longrunning::Operations::Rest::Client.new
341
+ #
342
+ # # Create a request. To set request fields, pass in keyword arguments.
343
+ # request = Google::Longrunning::DeleteOperationRequest.new
344
+ #
345
+ # # Call the delete_operation method.
346
+ # result = client.delete_operation request
347
+ #
348
+ # # The returned object is of type Google::Protobuf::Empty.
349
+ # p result
350
+ #
351
+ def delete_operation request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ call_metadata = @config.rpcs.delete_operation.metadata.to_h
361
+
362
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
363
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
366
+ transports_version_send: [:rest]
367
+
368
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
369
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
370
+
371
+ options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
372
+ metadata: call_metadata,
373
+ retry_policy: @config.rpcs.delete_operation.retry_policy
374
+
375
+ options.apply_defaults timeout: @config.timeout,
376
+ metadata: @config.metadata,
377
+ retry_policy: @config.retry_policy
378
+
379
+ @operations_stub.delete_operation request, options do |result, operation|
380
+ yield result, operation if block_given?
381
+ end
382
+ rescue ::Gapic::Rest::Error => e
383
+ raise ::Google::Cloud::Error.from_error(e)
384
+ end
385
+
386
+ ##
387
+ # Starts asynchronous cancellation on a long-running operation. The server
388
+ # makes a best effort to cancel the operation, but success is not
389
+ # guaranteed. If the server doesn't support this method, it returns
390
+ # `google.rpc.Code.UNIMPLEMENTED`. Clients can use
391
+ # Operations.GetOperation or
392
+ # other methods to check whether the cancellation succeeded or whether the
393
+ # operation completed despite cancellation. On successful cancellation,
394
+ # the operation is not deleted; instead, it becomes an operation with
395
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
396
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
397
+ # `Code.CANCELLED`.
398
+ #
399
+ # @overload cancel_operation(request, options = nil)
400
+ # Pass arguments to `cancel_operation` via a request object, either of type
401
+ # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
402
+ #
403
+ # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
404
+ # A request object representing the call parameters. Required. To specify no
405
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
406
+ # @param options [::Gapic::CallOptions, ::Hash]
407
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
408
+ #
409
+ # @overload cancel_operation(name: nil)
410
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
411
+ # least one keyword argument is required. To specify no parameters, or to keep all
412
+ # the default parameter values, pass an empty Hash as a request object (see above).
413
+ #
414
+ # @param name [::String]
415
+ # The name of the operation resource to be cancelled.
416
+ # @yield [result, operation] Access the result along with the TransportOperation object
417
+ # @yieldparam result [::Google::Protobuf::Empty]
418
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
419
+ #
420
+ # @return [::Google::Protobuf::Empty]
421
+ #
422
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
423
+ #
424
+ # @example Basic example
425
+ # require "google/longrunning"
426
+ #
427
+ # # Create a client object. The client can be reused for multiple calls.
428
+ # client = Google::Longrunning::Operations::Rest::Client.new
429
+ #
430
+ # # Create a request. To set request fields, pass in keyword arguments.
431
+ # request = Google::Longrunning::CancelOperationRequest.new
432
+ #
433
+ # # Call the cancel_operation method.
434
+ # result = client.cancel_operation request
435
+ #
436
+ # # The returned object is of type Google::Protobuf::Empty.
437
+ # p result
438
+ #
439
+ def cancel_operation request, options = nil
440
+ raise ::ArgumentError, "request must be provided" if request.nil?
441
+
442
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
443
+
444
+ # Converts hash and nil to an options object
445
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
446
+
447
+ # Customize the options with defaults
448
+ call_metadata = @config.rpcs.cancel_operation.metadata.to_h
449
+
450
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
451
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
452
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
453
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
454
+ transports_version_send: [:rest]
455
+
456
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
457
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
+
459
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
460
+ metadata: call_metadata,
461
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
462
+
463
+ options.apply_defaults timeout: @config.timeout,
464
+ metadata: @config.metadata,
465
+ retry_policy: @config.retry_policy
466
+
467
+ @operations_stub.cancel_operation request, options do |result, operation|
468
+ yield result, operation if block_given?
469
+ end
470
+ rescue ::Gapic::Rest::Error => e
471
+ raise ::Google::Cloud::Error.from_error(e)
472
+ end
473
+
474
+ ##
475
+ # Configuration class for the Operations REST API.
476
+ #
477
+ # This class represents the configuration for Operations REST,
478
+ # providing control over timeouts, retry behavior, logging, transport
479
+ # parameters, and other low-level controls. Certain parameters can also be
480
+ # applied individually to specific RPCs. See
481
+ # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs}
482
+ # for a list of RPCs that can be configured independently.
483
+ #
484
+ # Configuration can be applied globally to all clients, or to a single client
485
+ # on construction.
486
+ #
487
+ # @example
488
+ #
489
+ # # Modify the global config, setting the timeout for
490
+ # # list_operations to 20 seconds,
491
+ # # and all remaining timeouts to 10 seconds.
492
+ # ::Google::Longrunning::Operations::Rest::Client.configure do |config|
493
+ # config.timeout = 10.0
494
+ # config.rpcs.list_operations.timeout = 20.0
495
+ # end
496
+ #
497
+ # # Apply the above configuration only to a new client.
498
+ # client = ::Google::Longrunning::Operations::Rest::Client.new do |config|
499
+ # config.timeout = 10.0
500
+ # config.rpcs.list_operations.timeout = 20.0
501
+ # end
502
+ #
503
+ # @!attribute [rw] endpoint
504
+ # A custom service endpoint, as a hostname or hostname:port. The default is
505
+ # nil, indicating to use the default endpoint in the current universe domain.
506
+ # @return [::String,nil]
507
+ # @!attribute [rw] credentials
508
+ # Credentials to send with calls. You may provide any of the following types:
509
+ # * (`String`) The path to a service account key file in JSON format
510
+ # * (`Hash`) A service account key as a Hash
511
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
512
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
513
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
514
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
515
+ # * (`nil`) indicating no credentials
516
+ #
517
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
518
+ # external source for authentication to Google Cloud, you must validate it before
519
+ # providing it to a Google API client library. Providing an unvalidated credential
520
+ # configuration to Google APIs can compromise the security of your systems and data.
521
+ # For more information, refer to [Validate credential configurations from external
522
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
523
+ # @return [::Object]
524
+ # @!attribute [rw] scope
525
+ # The OAuth scopes
526
+ # @return [::Array<::String>]
527
+ # @!attribute [rw] lib_name
528
+ # The library name as recorded in instrumentation and logging
529
+ # @return [::String]
530
+ # @!attribute [rw] lib_version
531
+ # The library version as recorded in instrumentation and logging
532
+ # @return [::String]
533
+ # @!attribute [rw] timeout
534
+ # The call timeout in seconds.
535
+ # @return [::Numeric]
536
+ # @!attribute [rw] metadata
537
+ # Additional headers to be sent with the call.
538
+ # @return [::Hash{::Symbol=>::String}]
539
+ # @!attribute [rw] retry_policy
540
+ # The retry policy. The value is a hash with the following keys:
541
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
542
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
543
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
544
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
545
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
546
+ # trigger a retry.
547
+ # @return [::Hash]
548
+ # @!attribute [rw] quota_project
549
+ # A separate project against which to charge quota.
550
+ # @return [::String]
551
+ # @!attribute [rw] universe_domain
552
+ # The universe domain within which to make requests. This determines the
553
+ # default endpoint URL. The default value of nil uses the environment
554
+ # universe (usually the default "googleapis.com" universe).
555
+ # @return [::String,nil]
556
+ # @!attribute [rw] logger
557
+ # A custom logger to use for request/response debug logging, or the value
558
+ # `:default` (the default) to construct a default logger, or `nil` to
559
+ # explicitly disable logging.
560
+ # @return [::Logger,:default,nil]
561
+ #
562
+ class Configuration
563
+ extend ::Gapic::Config
564
+
565
+ # @private
566
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
567
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
568
+
569
+ config_attr :endpoint, nil, ::String, nil
570
+ config_attr :credentials, nil do |value|
571
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
572
+ allowed.any? { |klass| klass === value }
573
+ end
574
+ config_attr :scope, nil, ::String, ::Array, nil
575
+ config_attr :lib_name, nil, ::String, nil
576
+ config_attr :lib_version, nil, ::String, nil
577
+ config_attr :timeout, nil, ::Numeric, nil
578
+ config_attr :metadata, nil, ::Hash, nil
579
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
580
+ config_attr :quota_project, nil, ::String, nil
581
+ config_attr :universe_domain, nil, ::String, nil
582
+ config_attr :logger, :default, ::Logger, nil, :default
583
+
584
+ # @private
585
+ def initialize parent_config = nil
586
+ @parent_config = parent_config unless parent_config.nil?
587
+
588
+ yield self if block_given?
589
+ end
590
+
591
+ ##
592
+ # Configurations for individual RPCs
593
+ # @return [Rpcs]
594
+ #
595
+ def rpcs
596
+ @rpcs ||= begin
597
+ parent_rpcs = nil
598
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
599
+ Rpcs.new parent_rpcs
600
+ end
601
+ end
602
+
603
+ ##
604
+ # Configuration RPC class for the Operations API.
605
+ #
606
+ # Includes fields providing the configuration for each RPC in this service.
607
+ # Each configuration object is of type `Gapic::Config::Method` and includes
608
+ # the following configuration fields:
609
+ #
610
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
611
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
612
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
613
+ # include the following keys:
614
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
615
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
616
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
617
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
618
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
619
+ # trigger a retry.
620
+ #
621
+ class Rpcs
622
+ ##
623
+ # RPC-specific configuration for `list_operations`
624
+ # @return [::Gapic::Config::Method]
625
+ #
626
+ attr_reader :list_operations
627
+ ##
628
+ # RPC-specific configuration for `get_operation`
629
+ # @return [::Gapic::Config::Method]
630
+ #
631
+ attr_reader :get_operation
632
+ ##
633
+ # RPC-specific configuration for `delete_operation`
634
+ # @return [::Gapic::Config::Method]
635
+ #
636
+ attr_reader :delete_operation
637
+ ##
638
+ # RPC-specific configuration for `cancel_operation`
639
+ # @return [::Gapic::Config::Method]
640
+ #
641
+ attr_reader :cancel_operation
642
+
643
+ # @private
644
+ def initialize parent_rpcs = nil
645
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
646
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
647
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
648
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
649
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
650
+ @delete_operation = ::Gapic::Config::Method.new delete_operation_config
651
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
652
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
653
+
654
+ yield self if block_given?
655
+ end
656
+ end
657
+ end
658
+ end
659
+
660
+ ##
661
+ # @private
662
+ # REST service stub for the Longrunning Operations API.
663
+ # Service stub contains baseline method implementations
664
+ # including transcoding, making the REST call, and deserialing the response.
665
+ class OperationsServiceStub
666
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
667
+ # These require statements are intentionally placed here to initialize
668
+ # the REST modules only when it's required.
669
+ require "gapic/rest"
670
+
671
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
672
+ endpoint_template: endpoint_template,
673
+ universe_domain: universe_domain,
674
+ credentials: credentials
675
+ end
676
+
677
+ ##
678
+ # Baseline implementation for the list_operations REST call
679
+ #
680
+ # @param request_pb [::Google::Longrunning::ListOperationsRequest]
681
+ # A request object representing the call parameters. Required.
682
+ # @param options [::Gapic::CallOptions]
683
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
684
+ #
685
+ # @yield [result, operation] Access the result along with the TransportOperation object
686
+ # @yieldparam result [::Google::Longrunning::ListOperationsResponse]
687
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
688
+ #
689
+ # @return [::Google::Longrunning::ListOperationsResponse]
690
+ # A result object deserialized from the server's reply
691
+ def list_operations request_pb, options = nil
692
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
693
+
694
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
695
+ query_string_params = if query_string_params.any?
696
+ query_string_params.to_h { |p| p.split "=", 2 }
697
+ else
698
+ {}
699
+ end
700
+
701
+ response = @client_stub.make_http_request(
702
+ verb,
703
+ uri: uri,
704
+ body: body || "",
705
+ params: query_string_params,
706
+ method_name: "list_operations",
707
+ options: options
708
+ )
709
+ operation = ::Gapic::Rest::TransportOperation.new response
710
+ result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
711
+ catch :response do
712
+ yield result, operation if block_given?
713
+ result
714
+ end
715
+ end
716
+
717
+ ##
718
+ # Baseline implementation for the get_operation REST call
719
+ #
720
+ # @param request_pb [::Google::Longrunning::GetOperationRequest]
721
+ # A request object representing the call parameters. Required.
722
+ # @param options [::Gapic::CallOptions]
723
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
724
+ #
725
+ # @yield [result, operation] Access the result along with the TransportOperation object
726
+ # @yieldparam result [::Google::Longrunning::Operation]
727
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
728
+ #
729
+ # @return [::Google::Longrunning::Operation]
730
+ # A result object deserialized from the server's reply
731
+ def get_operation request_pb, options = nil
732
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
733
+
734
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
735
+ query_string_params = if query_string_params.any?
736
+ query_string_params.to_h { |p| p.split "=", 2 }
737
+ else
738
+ {}
739
+ end
740
+
741
+ response = @client_stub.make_http_request(
742
+ verb,
743
+ uri: uri,
744
+ body: body || "",
745
+ params: query_string_params,
746
+ method_name: "get_operation",
747
+ options: options
748
+ )
749
+ operation = ::Gapic::Rest::TransportOperation.new response
750
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
751
+ catch :response do
752
+ yield result, operation if block_given?
753
+ result
754
+ end
755
+ end
756
+
757
+ ##
758
+ # Baseline implementation for the delete_operation REST call
759
+ #
760
+ # @param request_pb [::Google::Longrunning::DeleteOperationRequest]
761
+ # A request object representing the call parameters. Required.
762
+ # @param options [::Gapic::CallOptions]
763
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
764
+ #
765
+ # @yield [result, operation] Access the result along with the TransportOperation object
766
+ # @yieldparam result [::Google::Protobuf::Empty]
767
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
768
+ #
769
+ # @return [::Google::Protobuf::Empty]
770
+ # A result object deserialized from the server's reply
771
+ def delete_operation request_pb, options = nil
772
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
773
+
774
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
775
+ query_string_params = if query_string_params.any?
776
+ query_string_params.to_h { |p| p.split "=", 2 }
777
+ else
778
+ {}
779
+ end
780
+
781
+ response = @client_stub.make_http_request(
782
+ verb,
783
+ uri: uri,
784
+ body: body || "",
785
+ params: query_string_params,
786
+ method_name: "delete_operation",
787
+ options: options
788
+ )
789
+ operation = ::Gapic::Rest::TransportOperation.new response
790
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
791
+ catch :response do
792
+ yield result, operation if block_given?
793
+ result
794
+ end
795
+ end
796
+
797
+ ##
798
+ # Baseline implementation for the cancel_operation REST call
799
+ #
800
+ # @param request_pb [::Google::Longrunning::CancelOperationRequest]
801
+ # A request object representing the call parameters. Required.
802
+ # @param options [::Gapic::CallOptions]
803
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
804
+ #
805
+ # @yield [result, operation] Access the result along with the TransportOperation object
806
+ # @yieldparam result [::Google::Protobuf::Empty]
807
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
808
+ #
809
+ # @return [::Google::Protobuf::Empty]
810
+ # A result object deserialized from the server's reply
811
+ def cancel_operation request_pb, options = nil
812
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
813
+
814
+ verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
815
+ query_string_params = if query_string_params.any?
816
+ query_string_params.to_h { |p| p.split "=", 2 }
817
+ else
818
+ {}
819
+ end
820
+
821
+ response = @client_stub.make_http_request(
822
+ verb,
823
+ uri: uri,
824
+ body: body || "",
825
+ params: query_string_params,
826
+ method_name: "cancel_operation",
827
+ options: options
828
+ )
829
+ operation = ::Gapic::Rest::TransportOperation.new response
830
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
831
+ catch :response do
832
+ yield result, operation if block_given?
833
+ result
834
+ end
835
+ end
836
+
837
+ ##
838
+ # @private
839
+ #
840
+ # GRPC transcoding helper method for the list_operations REST call
841
+ #
842
+ # @param request_pb [::Google::Longrunning::ListOperationsRequest]
843
+ # A request object representing the call parameters. Required.
844
+ # @return [Array(String, [String, nil], Hash{String => String})]
845
+ # Uri, Body, Query string parameters
846
+ def self.transcode_list_operations_request request_pb
847
+ transcoder = Gapic::Rest::GrpcTranscoder.new
848
+ .with_bindings(
849
+ uri_method: :get,
850
+ uri_template: "/v1beta/{name}/operations",
851
+ matches: [
852
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
853
+ ]
854
+ )
855
+ transcoder.transcode request_pb
856
+ end
857
+
858
+ ##
859
+ # @private
860
+ #
861
+ # GRPC transcoding helper method for the get_operation REST call
862
+ #
863
+ # @param request_pb [::Google::Longrunning::GetOperationRequest]
864
+ # A request object representing the call parameters. Required.
865
+ # @return [Array(String, [String, nil], Hash{String => String})]
866
+ # Uri, Body, Query string parameters
867
+ def self.transcode_get_operation_request request_pb
868
+ transcoder = Gapic::Rest::GrpcTranscoder.new
869
+ .with_bindings(
870
+ uri_method: :get,
871
+ uri_template: "/v1beta/{name}",
872
+ matches: [
873
+ ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
874
+ ]
875
+ )
876
+ transcoder.transcode request_pb
877
+ end
878
+
879
+ ##
880
+ # @private
881
+ #
882
+ # GRPC transcoding helper method for the delete_operation REST call
883
+ #
884
+ # @param request_pb [::Google::Longrunning::DeleteOperationRequest]
885
+ # A request object representing the call parameters. Required.
886
+ # @return [Array(String, [String, nil], Hash{String => String})]
887
+ # Uri, Body, Query string parameters
888
+ def self.transcode_delete_operation_request request_pb
889
+ transcoder = Gapic::Rest::GrpcTranscoder.new
890
+ .with_bindings(
891
+ uri_method: :delete,
892
+ uri_template: "/v1beta/{name}",
893
+ matches: [
894
+ ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
895
+ ]
896
+ )
897
+ transcoder.transcode request_pb
898
+ end
899
+
900
+ ##
901
+ # @private
902
+ #
903
+ # GRPC transcoding helper method for the cancel_operation REST call
904
+ #
905
+ # @param request_pb [::Google::Longrunning::CancelOperationRequest]
906
+ # A request object representing the call parameters. Required.
907
+ # @return [Array(String, [String, nil], Hash{String => String})]
908
+ # Uri, Body, Query string parameters
909
+ def self.transcode_cancel_operation_request request_pb
910
+ transcoder = Gapic::Rest::GrpcTranscoder.new
911
+ .with_bindings(
912
+ uri_method: :post,
913
+ uri_template: "/v1beta/{name}:cancel",
914
+ body: "*",
915
+ matches: [
916
+ ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
917
+ ]
918
+ )
919
+ transcoder.transcode request_pb
920
+ end
921
+ end
922
+ end
923
+ end
924
+ end
925
+ end
926
+ end
927
+ end