google-cloud-vision_ai-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/vision_ai/v1/app_platform/client.rb +3318 -0
  6. data/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb +47 -0
  7. data/lib/google/cloud/vision_ai/v1/app_platform/operations.rb +809 -0
  8. data/lib/google/cloud/vision_ai/v1/app_platform/paths.rb +151 -0
  9. data/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +3106 -0
  10. data/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb +951 -0
  11. data/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb +1618 -0
  12. data/lib/google/cloud/vision_ai/v1/app_platform/rest.rb +53 -0
  13. data/lib/google/cloud/vision_ai/v1/app_platform.rb +56 -0
  14. data/lib/google/cloud/vision_ai/v1/health_check_service/client.rb +456 -0
  15. data/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb +47 -0
  16. data/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb +52 -0
  17. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +423 -0
  18. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb +128 -0
  19. data/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb +53 -0
  20. data/lib/google/cloud/vision_ai/v1/health_check_service.rb +56 -0
  21. data/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb +2375 -0
  22. data/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb +47 -0
  23. data/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb +809 -0
  24. data/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb +130 -0
  25. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +2220 -0
  26. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb +951 -0
  27. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb +1139 -0
  28. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb +54 -0
  29. data/lib/google/cloud/vision_ai/v1/live_video_analytics.rb +57 -0
  30. data/lib/google/cloud/vision_ai/v1/rest.rb +42 -0
  31. data/lib/google/cloud/vision_ai/v1/streaming_service/client.rb +915 -0
  32. data/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb +47 -0
  33. data/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb +54 -0
  34. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +610 -0
  35. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb +249 -0
  36. data/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb +52 -0
  37. data/lib/google/cloud/vision_ai/v1/streaming_service.rb +55 -0
  38. data/lib/google/cloud/vision_ai/v1/streams_service/client.rb +2931 -0
  39. data/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb +47 -0
  40. data/lib/google/cloud/vision_ai/v1/streams_service/operations.rb +809 -0
  41. data/lib/google/cloud/vision_ai/v1/streams_service/paths.rb +153 -0
  42. data/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +2740 -0
  43. data/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb +951 -0
  44. data/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb +1437 -0
  45. data/lib/google/cloud/vision_ai/v1/streams_service/rest.rb +56 -0
  46. data/lib/google/cloud/vision_ai/v1/streams_service.rb +59 -0
  47. data/lib/google/cloud/vision_ai/v1/version.rb +8 -3
  48. data/lib/google/cloud/vision_ai/v1/warehouse/client.rb +6957 -0
  49. data/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb +47 -0
  50. data/lib/google/cloud/vision_ai/v1/warehouse/operations.rb +809 -0
  51. data/lib/google/cloud/vision_ai/v1/warehouse/paths.rb +237 -0
  52. data/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +6402 -0
  53. data/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +951 -0
  54. data/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb +3760 -0
  55. data/lib/google/cloud/vision_ai/v1/warehouse/rest.rb +53 -0
  56. data/lib/google/cloud/vision_ai/v1/warehouse.rb +56 -0
  57. data/lib/google/cloud/vision_ai/v1.rb +50 -0
  58. data/lib/google/cloud/visionai/v1/annotations_pb.rb +90 -0
  59. data/lib/google/cloud/visionai/v1/common_pb.rb +50 -0
  60. data/lib/google/cloud/visionai/v1/health_service_pb.rb +48 -0
  61. data/lib/google/cloud/visionai/v1/health_service_services_pb.rb +46 -0
  62. data/lib/google/cloud/visionai/v1/lva_pb.rb +54 -0
  63. data/lib/google/cloud/visionai/v1/lva_resources_pb.rb +51 -0
  64. data/lib/google/cloud/visionai/v1/lva_service_pb.rb +80 -0
  65. data/lib/google/cloud/visionai/v1/lva_service_services_pb.rb +81 -0
  66. data/lib/google/cloud/visionai/v1/platform_pb.rb +162 -0
  67. data/lib/google/cloud/visionai/v1/platform_services_pb.rb +111 -0
  68. data/lib/google/cloud/visionai/v1/streaming_resources_pb.rb +58 -0
  69. data/lib/google/cloud/visionai/v1/streaming_service_pb.rb +71 -0
  70. data/lib/google/cloud/visionai/v1/streaming_service_services_pb.rb +55 -0
  71. data/lib/google/cloud/visionai/v1/streams_resources_pb.rb +53 -0
  72. data/lib/google/cloud/visionai/v1/streams_service_pb.rb +85 -0
  73. data/lib/google/cloud/visionai/v1/streams_service_services_pb.rb +92 -0
  74. data/lib/google/cloud/visionai/v1/warehouse_pb.rb +250 -0
  75. data/lib/google/cloud/visionai/v1/warehouse_services_pb.rb +227 -0
  76. data/lib/google-cloud-vision_ai-v1.rb +21 -0
  77. data/proto_docs/README.md +4 -0
  78. data/proto_docs/google/api/client.rb +403 -0
  79. data/proto_docs/google/api/field_behavior.rb +85 -0
  80. data/proto_docs/google/api/launch_stage.rb +71 -0
  81. data/proto_docs/google/api/resource.rb +227 -0
  82. data/proto_docs/google/cloud/visionai/v1/annotations.rb +787 -0
  83. data/proto_docs/google/cloud/visionai/v1/common.rb +134 -0
  84. data/proto_docs/google/cloud/visionai/v1/health_service.rb +61 -0
  85. data/proto_docs/google/cloud/visionai/v1/lva.rb +345 -0
  86. data/proto_docs/google/cloud/visionai/v1/lva_resources.rb +167 -0
  87. data/proto_docs/google/cloud/visionai/v1/lva_service.rb +543 -0
  88. data/proto_docs/google/cloud/visionai/v1/platform.rb +2228 -0
  89. data/proto_docs/google/cloud/visionai/v1/streaming_resources.rb +178 -0
  90. data/proto_docs/google/cloud/visionai/v1/streaming_service.rb +393 -0
  91. data/proto_docs/google/cloud/visionai/v1/streams_resources.rb +229 -0
  92. data/proto_docs/google/cloud/visionai/v1/streams_service.rb +644 -0
  93. data/proto_docs/google/cloud/visionai/v1/warehouse.rb +3002 -0
  94. data/proto_docs/google/longrunning/operations.rb +164 -0
  95. data/proto_docs/google/protobuf/any.rb +145 -0
  96. data/proto_docs/google/protobuf/duration.rb +98 -0
  97. data/proto_docs/google/protobuf/empty.rb +34 -0
  98. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  99. data/proto_docs/google/protobuf/struct.rb +96 -0
  100. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  101. data/proto_docs/google/rpc/status.rb +48 -0
  102. data/proto_docs/google/type/datetime.rb +99 -0
  103. data/proto_docs/google/type/expr.rb +75 -0
  104. metadata +183 -10
@@ -0,0 +1,610 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/visionai/v1/streaming_service_pb"
21
+ require "google/cloud/vision_ai/v1/streaming_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module VisionAI
28
+ module V1
29
+ module StreamingService
30
+ module Rest
31
+ ##
32
+ # REST client for the StreamingService service.
33
+ #
34
+ # Streaming service for receiving and sending packets.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :streaming_service_stub
47
+
48
+ ##
49
+ # Configure the StreamingService Client class.
50
+ #
51
+ # See {::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all StreamingService clients
57
+ # ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "VisionAI", "V1"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the StreamingService Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @streaming_service_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new StreamingService REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the StreamingService client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @streaming_service_stub = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::ServiceStub.new(
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
155
+ credentials: credentials
156
+ )
157
+
158
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @streaming_service_stub.endpoint
162
+ config.universe_domain = @streaming_service_stub.universe_domain
163
+ end
164
+
165
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @streaming_service_stub.endpoint
169
+ config.universe_domain = @streaming_service_stub.universe_domain
170
+ end
171
+ end
172
+
173
+ ##
174
+ # Get the associated client for mix-in of the Locations.
175
+ #
176
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
177
+ #
178
+ attr_reader :location_client
179
+
180
+ ##
181
+ # Get the associated client for mix-in of the IAMPolicy.
182
+ #
183
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
184
+ #
185
+ attr_reader :iam_policy_client
186
+
187
+ # Service calls
188
+
189
+ ##
190
+ # AcquireLease acquires a lease.
191
+ #
192
+ # @overload acquire_lease(request, options = nil)
193
+ # Pass arguments to `acquire_lease` via a request object, either of type
194
+ # {::Google::Cloud::VisionAI::V1::AcquireLeaseRequest} or an equivalent Hash.
195
+ #
196
+ # @param request [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::Hash]
197
+ # A request object representing the call parameters. Required. To specify no
198
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
199
+ # @param options [::Gapic::CallOptions, ::Hash]
200
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
201
+ #
202
+ # @overload acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil)
203
+ # Pass arguments to `acquire_lease` via keyword arguments. Note that at
204
+ # least one keyword argument is required. To specify no parameters, or to keep all
205
+ # the default parameter values, pass an empty Hash as a request object (see above).
206
+ #
207
+ # @param series [::String]
208
+ # The series name.
209
+ # @param owner [::String]
210
+ # The owner name.
211
+ # @param term [::Google::Protobuf::Duration, ::Hash]
212
+ # The lease term.
213
+ # @param lease_type [::Google::Cloud::VisionAI::V1::LeaseType]
214
+ # The lease type.
215
+ # @yield [result, operation] Access the result along with the TransportOperation object
216
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease]
217
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
218
+ #
219
+ # @return [::Google::Cloud::VisionAI::V1::Lease]
220
+ #
221
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
222
+ #
223
+ # @example Basic example
224
+ # require "google/cloud/vision_ai/v1"
225
+ #
226
+ # # Create a client object. The client can be reused for multiple calls.
227
+ # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new
228
+ #
229
+ # # Create a request. To set request fields, pass in keyword arguments.
230
+ # request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new
231
+ #
232
+ # # Call the acquire_lease method.
233
+ # result = client.acquire_lease request
234
+ #
235
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Lease.
236
+ # p result
237
+ #
238
+ def acquire_lease request, options = nil
239
+ raise ::ArgumentError, "request must be provided" if request.nil?
240
+
241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest
242
+
243
+ # Converts hash and nil to an options object
244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
245
+
246
+ # Customize the options with defaults
247
+ call_metadata = @config.rpcs.acquire_lease.metadata.to_h
248
+
249
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
252
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
253
+ transports_version_send: [:rest]
254
+
255
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ options.apply_defaults timeout: @config.rpcs.acquire_lease.timeout,
259
+ metadata: call_metadata,
260
+ retry_policy: @config.rpcs.acquire_lease.retry_policy
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
264
+ retry_policy: @config.retry_policy
265
+
266
+ @streaming_service_stub.acquire_lease request, options do |result, operation|
267
+ yield result, operation if block_given?
268
+ return result
269
+ end
270
+ rescue ::Gapic::Rest::Error => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # RenewLease renews a lease.
276
+ #
277
+ # @overload renew_lease(request, options = nil)
278
+ # Pass arguments to `renew_lease` via a request object, either of type
279
+ # {::Google::Cloud::VisionAI::V1::RenewLeaseRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
286
+ #
287
+ # @overload renew_lease(id: nil, series: nil, owner: nil, term: nil)
288
+ # Pass arguments to `renew_lease` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param id [::String]
293
+ # Lease id.
294
+ # @param series [::String]
295
+ # Series name.
296
+ # @param owner [::String]
297
+ # Lease owner.
298
+ # @param term [::Google::Protobuf::Duration, ::Hash]
299
+ # Lease term.
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::VisionAI::V1::Lease]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
307
+ #
308
+ # @example Basic example
309
+ # require "google/cloud/vision_ai/v1"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new
316
+ #
317
+ # # Call the renew_lease method.
318
+ # result = client.renew_lease request
319
+ #
320
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Lease.
321
+ # p result
322
+ #
323
+ def renew_lease request, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request.nil?
325
+
326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RenewLeaseRequest
327
+
328
+ # Converts hash and nil to an options object
329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
330
+
331
+ # Customize the options with defaults
332
+ call_metadata = @config.rpcs.renew_lease.metadata.to_h
333
+
334
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
335
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
337
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
338
+ transports_version_send: [:rest]
339
+
340
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
341
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ options.apply_defaults timeout: @config.rpcs.renew_lease.timeout,
344
+ metadata: call_metadata,
345
+ retry_policy: @config.rpcs.renew_lease.retry_policy
346
+
347
+ options.apply_defaults timeout: @config.timeout,
348
+ metadata: @config.metadata,
349
+ retry_policy: @config.retry_policy
350
+
351
+ @streaming_service_stub.renew_lease request, options do |result, operation|
352
+ yield result, operation if block_given?
353
+ return result
354
+ end
355
+ rescue ::Gapic::Rest::Error => e
356
+ raise ::Google::Cloud::Error.from_error(e)
357
+ end
358
+
359
+ ##
360
+ # RleaseLease releases a lease.
361
+ #
362
+ # @overload release_lease(request, options = nil)
363
+ # Pass arguments to `release_lease` via a request object, either of type
364
+ # {::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest} or an equivalent Hash.
365
+ #
366
+ # @param request [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::Hash]
367
+ # A request object representing the call parameters. Required. To specify no
368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
369
+ # @param options [::Gapic::CallOptions, ::Hash]
370
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
371
+ #
372
+ # @overload release_lease(id: nil, series: nil, owner: nil)
373
+ # Pass arguments to `release_lease` via keyword arguments. Note that at
374
+ # least one keyword argument is required. To specify no parameters, or to keep all
375
+ # the default parameter values, pass an empty Hash as a request object (see above).
376
+ #
377
+ # @param id [::String]
378
+ # Lease id.
379
+ # @param series [::String]
380
+ # Series name.
381
+ # @param owner [::String]
382
+ # Lease owner.
383
+ # @yield [result, operation] Access the result along with the TransportOperation object
384
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse]
385
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
386
+ #
387
+ # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse]
388
+ #
389
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
390
+ #
391
+ # @example Basic example
392
+ # require "google/cloud/vision_ai/v1"
393
+ #
394
+ # # Create a client object. The client can be reused for multiple calls.
395
+ # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new
396
+ #
397
+ # # Create a request. To set request fields, pass in keyword arguments.
398
+ # request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new
399
+ #
400
+ # # Call the release_lease method.
401
+ # result = client.release_lease request
402
+ #
403
+ # # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.
404
+ # p result
405
+ #
406
+ def release_lease request, options = nil
407
+ raise ::ArgumentError, "request must be provided" if request.nil?
408
+
409
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest
410
+
411
+ # Converts hash and nil to an options object
412
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
413
+
414
+ # Customize the options with defaults
415
+ call_metadata = @config.rpcs.release_lease.metadata.to_h
416
+
417
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
418
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
419
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
420
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
421
+ transports_version_send: [:rest]
422
+
423
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
424
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
425
+
426
+ options.apply_defaults timeout: @config.rpcs.release_lease.timeout,
427
+ metadata: call_metadata,
428
+ retry_policy: @config.rpcs.release_lease.retry_policy
429
+
430
+ options.apply_defaults timeout: @config.timeout,
431
+ metadata: @config.metadata,
432
+ retry_policy: @config.retry_policy
433
+
434
+ @streaming_service_stub.release_lease request, options do |result, operation|
435
+ yield result, operation if block_given?
436
+ return result
437
+ end
438
+ rescue ::Gapic::Rest::Error => e
439
+ raise ::Google::Cloud::Error.from_error(e)
440
+ end
441
+
442
+ ##
443
+ # Configuration class for the StreamingService REST API.
444
+ #
445
+ # This class represents the configuration for StreamingService REST,
446
+ # providing control over timeouts, retry behavior, logging, transport
447
+ # parameters, and other low-level controls. Certain parameters can also be
448
+ # applied individually to specific RPCs. See
449
+ # {::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client::Configuration::Rpcs}
450
+ # for a list of RPCs that can be configured independently.
451
+ #
452
+ # Configuration can be applied globally to all clients, or to a single client
453
+ # on construction.
454
+ #
455
+ # @example
456
+ #
457
+ # # Modify the global config, setting the timeout for
458
+ # # acquire_lease to 20 seconds,
459
+ # # and all remaining timeouts to 10 seconds.
460
+ # ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.configure do |config|
461
+ # config.timeout = 10.0
462
+ # config.rpcs.acquire_lease.timeout = 20.0
463
+ # end
464
+ #
465
+ # # Apply the above configuration only to a new client.
466
+ # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config|
467
+ # config.timeout = 10.0
468
+ # config.rpcs.acquire_lease.timeout = 20.0
469
+ # end
470
+ #
471
+ # @!attribute [rw] endpoint
472
+ # A custom service endpoint, as a hostname or hostname:port. The default is
473
+ # nil, indicating to use the default endpoint in the current universe domain.
474
+ # @return [::String,nil]
475
+ # @!attribute [rw] credentials
476
+ # Credentials to send with calls. You may provide any of the following types:
477
+ # * (`String`) The path to a service account key file in JSON format
478
+ # * (`Hash`) A service account key as a Hash
479
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
480
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
481
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
482
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
483
+ # * (`nil`) indicating no credentials
484
+ # @return [::Object]
485
+ # @!attribute [rw] scope
486
+ # The OAuth scopes
487
+ # @return [::Array<::String>]
488
+ # @!attribute [rw] lib_name
489
+ # The library name as recorded in instrumentation and logging
490
+ # @return [::String]
491
+ # @!attribute [rw] lib_version
492
+ # The library version as recorded in instrumentation and logging
493
+ # @return [::String]
494
+ # @!attribute [rw] timeout
495
+ # The call timeout in seconds.
496
+ # @return [::Numeric]
497
+ # @!attribute [rw] metadata
498
+ # Additional headers to be sent with the call.
499
+ # @return [::Hash{::Symbol=>::String}]
500
+ # @!attribute [rw] retry_policy
501
+ # The retry policy. The value is a hash with the following keys:
502
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
503
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
504
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
505
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
506
+ # trigger a retry.
507
+ # @return [::Hash]
508
+ # @!attribute [rw] quota_project
509
+ # A separate project against which to charge quota.
510
+ # @return [::String]
511
+ # @!attribute [rw] universe_domain
512
+ # The universe domain within which to make requests. This determines the
513
+ # default endpoint URL. The default value of nil uses the environment
514
+ # universe (usually the default "googleapis.com" universe).
515
+ # @return [::String,nil]
516
+ #
517
+ class Configuration
518
+ extend ::Gapic::Config
519
+
520
+ # @private
521
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
522
+ DEFAULT_ENDPOINT = "visionai.googleapis.com"
523
+
524
+ config_attr :endpoint, nil, ::String, nil
525
+ config_attr :credentials, nil do |value|
526
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
527
+ allowed.any? { |klass| klass === value }
528
+ end
529
+ config_attr :scope, nil, ::String, ::Array, nil
530
+ config_attr :lib_name, nil, ::String, nil
531
+ config_attr :lib_version, nil, ::String, nil
532
+ config_attr :timeout, nil, ::Numeric, nil
533
+ config_attr :metadata, nil, ::Hash, nil
534
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
535
+ config_attr :quota_project, nil, ::String, nil
536
+ config_attr :universe_domain, nil, ::String, nil
537
+
538
+ # @private
539
+ def initialize parent_config = nil
540
+ @parent_config = parent_config unless parent_config.nil?
541
+
542
+ yield self if block_given?
543
+ end
544
+
545
+ ##
546
+ # Configurations for individual RPCs
547
+ # @return [Rpcs]
548
+ #
549
+ def rpcs
550
+ @rpcs ||= begin
551
+ parent_rpcs = nil
552
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
553
+ Rpcs.new parent_rpcs
554
+ end
555
+ end
556
+
557
+ ##
558
+ # Configuration RPC class for the StreamingService API.
559
+ #
560
+ # Includes fields providing the configuration for each RPC in this service.
561
+ # Each configuration object is of type `Gapic::Config::Method` and includes
562
+ # the following configuration fields:
563
+ #
564
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
565
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
566
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
567
+ # include the following keys:
568
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
569
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
570
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
571
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
572
+ # trigger a retry.
573
+ #
574
+ class Rpcs
575
+ ##
576
+ # RPC-specific configuration for `acquire_lease`
577
+ # @return [::Gapic::Config::Method]
578
+ #
579
+ attr_reader :acquire_lease
580
+ ##
581
+ # RPC-specific configuration for `renew_lease`
582
+ # @return [::Gapic::Config::Method]
583
+ #
584
+ attr_reader :renew_lease
585
+ ##
586
+ # RPC-specific configuration for `release_lease`
587
+ # @return [::Gapic::Config::Method]
588
+ #
589
+ attr_reader :release_lease
590
+
591
+ # @private
592
+ def initialize parent_rpcs = nil
593
+ acquire_lease_config = parent_rpcs.acquire_lease if parent_rpcs.respond_to? :acquire_lease
594
+ @acquire_lease = ::Gapic::Config::Method.new acquire_lease_config
595
+ renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease
596
+ @renew_lease = ::Gapic::Config::Method.new renew_lease_config
597
+ release_lease_config = parent_rpcs.release_lease if parent_rpcs.respond_to? :release_lease
598
+ @release_lease = ::Gapic::Config::Method.new release_lease_config
599
+
600
+ yield self if block_given?
601
+ end
602
+ end
603
+ end
604
+ end
605
+ end
606
+ end
607
+ end
608
+ end
609
+ end
610
+ end