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,2740 @@
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/streams_service_pb"
21
+ require "google/cloud/vision_ai/v1/streams_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 StreamsService
30
+ module Rest
31
+ ##
32
+ # REST client for the StreamsService service.
33
+ #
34
+ # Service describing handlers for resources.
35
+ # Vision API and Vision AI API are two independent APIs developed by the same
36
+ # team. Vision API is for people to annotate their image while Vision AI is an
37
+ # e2e solution for customer to build their own computer vision application.
38
+ #
39
+ class Client
40
+ # @private
41
+ API_VERSION = ""
42
+
43
+ # @private
44
+ DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$"
45
+
46
+ include Paths
47
+
48
+ # @private
49
+ attr_reader :streams_service_stub
50
+
51
+ ##
52
+ # Configure the StreamsService Client class.
53
+ #
54
+ # See {::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client::Configuration}
55
+ # for a description of the configuration fields.
56
+ #
57
+ # @example
58
+ #
59
+ # # Modify the configuration for all StreamsService clients
60
+ # ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.configure do |config|
61
+ # config.timeout = 10.0
62
+ # end
63
+ #
64
+ # @yield [config] Configure the Client client.
65
+ # @yieldparam config [Client::Configuration]
66
+ #
67
+ # @return [Client::Configuration]
68
+ #
69
+ def self.configure
70
+ @configure ||= begin
71
+ namespace = ["Google", "Cloud", "VisionAI", "V1"]
72
+ parent_config = while namespace.any?
73
+ parent_name = namespace.join "::"
74
+ parent_const = const_get parent_name
75
+ break parent_const.configure if parent_const.respond_to? :configure
76
+ namespace.pop
77
+ end
78
+ default_config = Client::Configuration.new parent_config
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the StreamsService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @streams_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new StreamsService REST client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the StreamsService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
161
+ @streams_service_stub = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::ServiceStub.new(
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ credentials: credentials
166
+ )
167
+
168
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @streams_service_stub.endpoint
172
+ config.universe_domain = @streams_service_stub.universe_domain
173
+ end
174
+
175
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @streams_service_stub.endpoint
179
+ config.universe_domain = @streams_service_stub.universe_domain
180
+ end
181
+ end
182
+
183
+ ##
184
+ # Get the associated client for long-running operations.
185
+ #
186
+ # @return [::Google::Cloud::VisionAI::V1::StreamsService::Rest::Operations]
187
+ #
188
+ attr_reader :operations_client
189
+
190
+ ##
191
+ # Get the associated client for mix-in of the Locations.
192
+ #
193
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
194
+ #
195
+ attr_reader :location_client
196
+
197
+ ##
198
+ # Get the associated client for mix-in of the IAMPolicy.
199
+ #
200
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
201
+ #
202
+ attr_reader :iam_policy_client
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Lists Clusters in a given project and location.
208
+ #
209
+ # @overload list_clusters(request, options = nil)
210
+ # Pass arguments to `list_clusters` via a request object, either of type
211
+ # {::Google::Cloud::VisionAI::V1::ListClustersRequest} or an equivalent Hash.
212
+ #
213
+ # @param request [::Google::Cloud::VisionAI::V1::ListClustersRequest, ::Hash]
214
+ # A request object representing the call parameters. Required. To specify no
215
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
216
+ # @param options [::Gapic::CallOptions, ::Hash]
217
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
218
+ #
219
+ # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
220
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
221
+ # least one keyword argument is required. To specify no parameters, or to keep all
222
+ # the default parameter values, pass an empty Hash as a request object (see above).
223
+ #
224
+ # @param parent [::String]
225
+ # Required. Parent value for ListClustersRequest.
226
+ # @param page_size [::Integer]
227
+ # Requested page size. Server may return fewer items than requested.
228
+ # If unspecified, server will pick an appropriate default.
229
+ # @param page_token [::String]
230
+ # A token identifying a page of results the server should return.
231
+ # @param filter [::String]
232
+ # Filtering results.
233
+ # @param order_by [::String]
234
+ # Hint for how to order the results.
235
+ # @yield [result, operation] Access the result along with the TransportOperation object
236
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListClustersResponse]
237
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
238
+ #
239
+ # @return [::Google::Cloud::VisionAI::V1::ListClustersResponse]
240
+ #
241
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
242
+ #
243
+ # @example Basic example
244
+ # require "google/cloud/vision_ai/v1"
245
+ #
246
+ # # Create a client object. The client can be reused for multiple calls.
247
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
248
+ #
249
+ # # Create a request. To set request fields, pass in keyword arguments.
250
+ # request = Google::Cloud::VisionAI::V1::ListClustersRequest.new
251
+ #
252
+ # # Call the list_clusters method.
253
+ # result = client.list_clusters request
254
+ #
255
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
256
+ # # over elements, and API calls will be issued to fetch pages as needed.
257
+ # result.each do |item|
258
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Cluster.
259
+ # p item
260
+ # end
261
+ #
262
+ def list_clusters request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListClustersRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ call_metadata = @config.rpcs.list_clusters.metadata.to_h
272
+
273
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
274
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
277
+ transports_version_send: [:rest]
278
+
279
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
280
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
+
282
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
283
+ metadata: call_metadata,
284
+ retry_policy: @config.rpcs.list_clusters.retry_policy
285
+
286
+ options.apply_defaults timeout: @config.timeout,
287
+ metadata: @config.metadata,
288
+ retry_policy: @config.retry_policy
289
+
290
+ @streams_service_stub.list_clusters request, options do |result, operation|
291
+ yield result, operation if block_given?
292
+ return result
293
+ end
294
+ rescue ::Gapic::Rest::Error => e
295
+ raise ::Google::Cloud::Error.from_error(e)
296
+ end
297
+
298
+ ##
299
+ # Gets details of a single Cluster.
300
+ #
301
+ # @overload get_cluster(request, options = nil)
302
+ # Pass arguments to `get_cluster` via a request object, either of type
303
+ # {::Google::Cloud::VisionAI::V1::GetClusterRequest} or an equivalent Hash.
304
+ #
305
+ # @param request [::Google::Cloud::VisionAI::V1::GetClusterRequest, ::Hash]
306
+ # A request object representing the call parameters. Required. To specify no
307
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
308
+ # @param options [::Gapic::CallOptions, ::Hash]
309
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
310
+ #
311
+ # @overload get_cluster(name: nil)
312
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param name [::String]
317
+ # Required. Name of the resource.
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Cluster]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::VisionAI::V1::Cluster]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
325
+ #
326
+ # @example Basic example
327
+ # require "google/cloud/vision_ai/v1"
328
+ #
329
+ # # Create a client object. The client can be reused for multiple calls.
330
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
331
+ #
332
+ # # Create a request. To set request fields, pass in keyword arguments.
333
+ # request = Google::Cloud::VisionAI::V1::GetClusterRequest.new
334
+ #
335
+ # # Call the get_cluster method.
336
+ # result = client.get_cluster request
337
+ #
338
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Cluster.
339
+ # p result
340
+ #
341
+ def get_cluster request, options = nil
342
+ raise ::ArgumentError, "request must be provided" if request.nil?
343
+
344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetClusterRequest
345
+
346
+ # Converts hash and nil to an options object
347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+
349
+ # Customize the options with defaults
350
+ call_metadata = @config.rpcs.get_cluster.metadata.to_h
351
+
352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
355
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
356
+ transports_version_send: [:rest]
357
+
358
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
362
+ metadata: call_metadata,
363
+ retry_policy: @config.rpcs.get_cluster.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @streams_service_stub.get_cluster request, options do |result, operation|
370
+ yield result, operation if block_given?
371
+ return result
372
+ end
373
+ rescue ::Gapic::Rest::Error => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Creates a new Cluster in a given project and location.
379
+ #
380
+ # @overload create_cluster(request, options = nil)
381
+ # Pass arguments to `create_cluster` via a request object, either of type
382
+ # {::Google::Cloud::VisionAI::V1::CreateClusterRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::VisionAI::V1::CreateClusterRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
389
+ #
390
+ # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil)
391
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param parent [::String]
396
+ # Required. Value for parent.
397
+ # @param cluster_id [::String]
398
+ # Required. Id of the requesting object.
399
+ # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash]
400
+ # Required. The resource being created.
401
+ # @param request_id [::String]
402
+ # Optional. An optional request ID to identify requests. Specify a unique
403
+ # request ID so that if you must retry your request, the server will know to
404
+ # ignore the request if it has already been completed. The server will
405
+ # guarantee that for at least 60 minutes since the first request.
406
+ #
407
+ # For example, consider a situation where you make an initial request and the
408
+ # request times out. If you make the request again with the same request ID,
409
+ # the server can check if original operation with the same request ID was
410
+ # received, and if so, will ignore the second request. This prevents clients
411
+ # from accidentally creating duplicate commitments.
412
+ #
413
+ # The request ID must be a valid UUID with the exception that zero UUID is
414
+ # not supported (00000000-0000-0000-0000-000000000000).
415
+ # @yield [result, operation] Access the result along with the TransportOperation object
416
+ # @yieldparam result [::Gapic::Operation]
417
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
418
+ #
419
+ # @return [::Gapic::Operation]
420
+ #
421
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
422
+ #
423
+ # @example Basic example
424
+ # require "google/cloud/vision_ai/v1"
425
+ #
426
+ # # Create a client object. The client can be reused for multiple calls.
427
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
428
+ #
429
+ # # Create a request. To set request fields, pass in keyword arguments.
430
+ # request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new
431
+ #
432
+ # # Call the create_cluster method.
433
+ # result = client.create_cluster request
434
+ #
435
+ # # The returned object is of type Gapic::Operation. You can use it to
436
+ # # check the status of an operation, cancel it, or wait for results.
437
+ # # Here is how to wait for a response.
438
+ # result.wait_until_done! timeout: 60
439
+ # if result.response?
440
+ # p result.response
441
+ # else
442
+ # puts "No response received."
443
+ # end
444
+ #
445
+ def create_cluster request, options = nil
446
+ raise ::ArgumentError, "request must be provided" if request.nil?
447
+
448
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateClusterRequest
449
+
450
+ # Converts hash and nil to an options object
451
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
452
+
453
+ # Customize the options with defaults
454
+ call_metadata = @config.rpcs.create_cluster.metadata.to_h
455
+
456
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
457
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
458
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
459
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
460
+ transports_version_send: [:rest]
461
+
462
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
463
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
466
+ metadata: call_metadata,
467
+ retry_policy: @config.rpcs.create_cluster.retry_policy
468
+
469
+ options.apply_defaults timeout: @config.timeout,
470
+ metadata: @config.metadata,
471
+ retry_policy: @config.retry_policy
472
+
473
+ @streams_service_stub.create_cluster request, options do |result, operation|
474
+ result = ::Gapic::Operation.new result, @operations_client, options: options
475
+ yield result, operation if block_given?
476
+ return result
477
+ end
478
+ rescue ::Gapic::Rest::Error => e
479
+ raise ::Google::Cloud::Error.from_error(e)
480
+ end
481
+
482
+ ##
483
+ # Updates the parameters of a single Cluster.
484
+ #
485
+ # @overload update_cluster(request, options = nil)
486
+ # Pass arguments to `update_cluster` via a request object, either of type
487
+ # {::Google::Cloud::VisionAI::V1::UpdateClusterRequest} or an equivalent Hash.
488
+ #
489
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateClusterRequest, ::Hash]
490
+ # A request object representing the call parameters. Required. To specify no
491
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
492
+ # @param options [::Gapic::CallOptions, ::Hash]
493
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
494
+ #
495
+ # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil)
496
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
497
+ # least one keyword argument is required. To specify no parameters, or to keep all
498
+ # the default parameter values, pass an empty Hash as a request object (see above).
499
+ #
500
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
501
+ # Required. Field mask is used to specify the fields to be overwritten in the
502
+ # Cluster resource by the update.
503
+ # The fields specified in the update_mask are relative to the resource, not
504
+ # the full request. A field will be overwritten if it is in the mask. If the
505
+ # user does not provide a mask then all fields will be overwritten.
506
+ # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash]
507
+ # Required. The resource being updated
508
+ # @param request_id [::String]
509
+ # Optional. An optional request ID to identify requests. Specify a unique
510
+ # request ID so that if you must retry your request, the server will know to
511
+ # ignore the request if it has already been completed. The server will
512
+ # guarantee that for at least 60 minutes since the first request.
513
+ #
514
+ # For example, consider a situation where you make an initial request and the
515
+ # request times out. If you make the request again with the same request ID,
516
+ # the server can check if original operation with the same request ID was
517
+ # received, and if so, will ignore the second request. This prevents clients
518
+ # from accidentally creating duplicate commitments.
519
+ #
520
+ # The request ID must be a valid UUID with the exception that zero UUID is
521
+ # not supported (00000000-0000-0000-0000-000000000000).
522
+ # @yield [result, operation] Access the result along with the TransportOperation object
523
+ # @yieldparam result [::Gapic::Operation]
524
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
525
+ #
526
+ # @return [::Gapic::Operation]
527
+ #
528
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
529
+ #
530
+ # @example Basic example
531
+ # require "google/cloud/vision_ai/v1"
532
+ #
533
+ # # Create a client object. The client can be reused for multiple calls.
534
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
535
+ #
536
+ # # Create a request. To set request fields, pass in keyword arguments.
537
+ # request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new
538
+ #
539
+ # # Call the update_cluster method.
540
+ # result = client.update_cluster request
541
+ #
542
+ # # The returned object is of type Gapic::Operation. You can use it to
543
+ # # check the status of an operation, cancel it, or wait for results.
544
+ # # Here is how to wait for a response.
545
+ # result.wait_until_done! timeout: 60
546
+ # if result.response?
547
+ # p result.response
548
+ # else
549
+ # puts "No response received."
550
+ # end
551
+ #
552
+ def update_cluster request, options = nil
553
+ raise ::ArgumentError, "request must be provided" if request.nil?
554
+
555
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateClusterRequest
556
+
557
+ # Converts hash and nil to an options object
558
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
559
+
560
+ # Customize the options with defaults
561
+ call_metadata = @config.rpcs.update_cluster.metadata.to_h
562
+
563
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
564
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
565
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
566
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
567
+ transports_version_send: [:rest]
568
+
569
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
570
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
571
+
572
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
573
+ metadata: call_metadata,
574
+ retry_policy: @config.rpcs.update_cluster.retry_policy
575
+
576
+ options.apply_defaults timeout: @config.timeout,
577
+ metadata: @config.metadata,
578
+ retry_policy: @config.retry_policy
579
+
580
+ @streams_service_stub.update_cluster request, options do |result, operation|
581
+ result = ::Gapic::Operation.new result, @operations_client, options: options
582
+ yield result, operation if block_given?
583
+ return result
584
+ end
585
+ rescue ::Gapic::Rest::Error => e
586
+ raise ::Google::Cloud::Error.from_error(e)
587
+ end
588
+
589
+ ##
590
+ # Deletes a single Cluster.
591
+ #
592
+ # @overload delete_cluster(request, options = nil)
593
+ # Pass arguments to `delete_cluster` via a request object, either of type
594
+ # {::Google::Cloud::VisionAI::V1::DeleteClusterRequest} or an equivalent Hash.
595
+ #
596
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteClusterRequest, ::Hash]
597
+ # A request object representing the call parameters. Required. To specify no
598
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
599
+ # @param options [::Gapic::CallOptions, ::Hash]
600
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
601
+ #
602
+ # @overload delete_cluster(name: nil, request_id: nil)
603
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
604
+ # least one keyword argument is required. To specify no parameters, or to keep all
605
+ # the default parameter values, pass an empty Hash as a request object (see above).
606
+ #
607
+ # @param name [::String]
608
+ # Required. Name of the resource
609
+ # @param request_id [::String]
610
+ # Optional. An optional request ID to identify requests. Specify a unique
611
+ # request ID so that if you must retry your request, the server will know to
612
+ # ignore the request if it has already been completed. The server will
613
+ # guarantee that for at least 60 minutes after the first request.
614
+ #
615
+ # For example, consider a situation where you make an initial request and the
616
+ # request times out. If you make the request again with the same request ID,
617
+ # the server can check if original operation with the same request ID was
618
+ # received, and if so, will ignore the second request. This prevents clients
619
+ # from accidentally creating duplicate commitments.
620
+ #
621
+ # The request ID must be a valid UUID with the exception that zero UUID is
622
+ # not supported (00000000-0000-0000-0000-000000000000).
623
+ # @yield [result, operation] Access the result along with the TransportOperation object
624
+ # @yieldparam result [::Gapic::Operation]
625
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
626
+ #
627
+ # @return [::Gapic::Operation]
628
+ #
629
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
630
+ #
631
+ # @example Basic example
632
+ # require "google/cloud/vision_ai/v1"
633
+ #
634
+ # # Create a client object. The client can be reused for multiple calls.
635
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
636
+ #
637
+ # # Create a request. To set request fields, pass in keyword arguments.
638
+ # request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new
639
+ #
640
+ # # Call the delete_cluster method.
641
+ # result = client.delete_cluster request
642
+ #
643
+ # # The returned object is of type Gapic::Operation. You can use it to
644
+ # # check the status of an operation, cancel it, or wait for results.
645
+ # # Here is how to wait for a response.
646
+ # result.wait_until_done! timeout: 60
647
+ # if result.response?
648
+ # p result.response
649
+ # else
650
+ # puts "No response received."
651
+ # end
652
+ #
653
+ def delete_cluster request, options = nil
654
+ raise ::ArgumentError, "request must be provided" if request.nil?
655
+
656
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteClusterRequest
657
+
658
+ # Converts hash and nil to an options object
659
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
660
+
661
+ # Customize the options with defaults
662
+ call_metadata = @config.rpcs.delete_cluster.metadata.to_h
663
+
664
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
665
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
666
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
667
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
668
+ transports_version_send: [:rest]
669
+
670
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
671
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
672
+
673
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
674
+ metadata: call_metadata,
675
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
676
+
677
+ options.apply_defaults timeout: @config.timeout,
678
+ metadata: @config.metadata,
679
+ retry_policy: @config.retry_policy
680
+
681
+ @streams_service_stub.delete_cluster request, options do |result, operation|
682
+ result = ::Gapic::Operation.new result, @operations_client, options: options
683
+ yield result, operation if block_given?
684
+ return result
685
+ end
686
+ rescue ::Gapic::Rest::Error => e
687
+ raise ::Google::Cloud::Error.from_error(e)
688
+ end
689
+
690
+ ##
691
+ # Lists Streams in a given project and location.
692
+ #
693
+ # @overload list_streams(request, options = nil)
694
+ # Pass arguments to `list_streams` via a request object, either of type
695
+ # {::Google::Cloud::VisionAI::V1::ListStreamsRequest} or an equivalent Hash.
696
+ #
697
+ # @param request [::Google::Cloud::VisionAI::V1::ListStreamsRequest, ::Hash]
698
+ # A request object representing the call parameters. Required. To specify no
699
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
700
+ # @param options [::Gapic::CallOptions, ::Hash]
701
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
702
+ #
703
+ # @overload list_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
704
+ # Pass arguments to `list_streams` via keyword arguments. Note that at
705
+ # least one keyword argument is required. To specify no parameters, or to keep all
706
+ # the default parameter values, pass an empty Hash as a request object (see above).
707
+ #
708
+ # @param parent [::String]
709
+ # Required. Parent value for ListStreamsRequest.
710
+ # @param page_size [::Integer]
711
+ # Requested page size. Server may return fewer items than requested.
712
+ # If unspecified, server will pick an appropriate default.
713
+ # @param page_token [::String]
714
+ # A token identifying a page of results the server should return.
715
+ # @param filter [::String]
716
+ # Filtering results.
717
+ # @param order_by [::String]
718
+ # Hint for how to order the results.
719
+ # @yield [result, operation] Access the result along with the TransportOperation object
720
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListStreamsResponse]
721
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
722
+ #
723
+ # @return [::Google::Cloud::VisionAI::V1::ListStreamsResponse]
724
+ #
725
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
726
+ #
727
+ # @example Basic example
728
+ # require "google/cloud/vision_ai/v1"
729
+ #
730
+ # # Create a client object. The client can be reused for multiple calls.
731
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
732
+ #
733
+ # # Create a request. To set request fields, pass in keyword arguments.
734
+ # request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new
735
+ #
736
+ # # Call the list_streams method.
737
+ # result = client.list_streams request
738
+ #
739
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
740
+ # # over elements, and API calls will be issued to fetch pages as needed.
741
+ # result.each do |item|
742
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Stream.
743
+ # p item
744
+ # end
745
+ #
746
+ def list_streams request, options = nil
747
+ raise ::ArgumentError, "request must be provided" if request.nil?
748
+
749
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListStreamsRequest
750
+
751
+ # Converts hash and nil to an options object
752
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
753
+
754
+ # Customize the options with defaults
755
+ call_metadata = @config.rpcs.list_streams.metadata.to_h
756
+
757
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
758
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
759
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
760
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
761
+ transports_version_send: [:rest]
762
+
763
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
764
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
765
+
766
+ options.apply_defaults timeout: @config.rpcs.list_streams.timeout,
767
+ metadata: call_metadata,
768
+ retry_policy: @config.rpcs.list_streams.retry_policy
769
+
770
+ options.apply_defaults timeout: @config.timeout,
771
+ metadata: @config.metadata,
772
+ retry_policy: @config.retry_policy
773
+
774
+ @streams_service_stub.list_streams request, options do |result, operation|
775
+ yield result, operation if block_given?
776
+ return result
777
+ end
778
+ rescue ::Gapic::Rest::Error => e
779
+ raise ::Google::Cloud::Error.from_error(e)
780
+ end
781
+
782
+ ##
783
+ # Gets details of a single Stream.
784
+ #
785
+ # @overload get_stream(request, options = nil)
786
+ # Pass arguments to `get_stream` via a request object, either of type
787
+ # {::Google::Cloud::VisionAI::V1::GetStreamRequest} or an equivalent Hash.
788
+ #
789
+ # @param request [::Google::Cloud::VisionAI::V1::GetStreamRequest, ::Hash]
790
+ # A request object representing the call parameters. Required. To specify no
791
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
792
+ # @param options [::Gapic::CallOptions, ::Hash]
793
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
794
+ #
795
+ # @overload get_stream(name: nil)
796
+ # Pass arguments to `get_stream` via keyword arguments. Note that at
797
+ # least one keyword argument is required. To specify no parameters, or to keep all
798
+ # the default parameter values, pass an empty Hash as a request object (see above).
799
+ #
800
+ # @param name [::String]
801
+ # Required. Name of the resource.
802
+ # @yield [result, operation] Access the result along with the TransportOperation object
803
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Stream]
804
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
805
+ #
806
+ # @return [::Google::Cloud::VisionAI::V1::Stream]
807
+ #
808
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
809
+ #
810
+ # @example Basic example
811
+ # require "google/cloud/vision_ai/v1"
812
+ #
813
+ # # Create a client object. The client can be reused for multiple calls.
814
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
815
+ #
816
+ # # Create a request. To set request fields, pass in keyword arguments.
817
+ # request = Google::Cloud::VisionAI::V1::GetStreamRequest.new
818
+ #
819
+ # # Call the get_stream method.
820
+ # result = client.get_stream request
821
+ #
822
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Stream.
823
+ # p result
824
+ #
825
+ def get_stream request, options = nil
826
+ raise ::ArgumentError, "request must be provided" if request.nil?
827
+
828
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamRequest
829
+
830
+ # Converts hash and nil to an options object
831
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
832
+
833
+ # Customize the options with defaults
834
+ call_metadata = @config.rpcs.get_stream.metadata.to_h
835
+
836
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
837
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
838
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
839
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
840
+ transports_version_send: [:rest]
841
+
842
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
843
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
844
+
845
+ options.apply_defaults timeout: @config.rpcs.get_stream.timeout,
846
+ metadata: call_metadata,
847
+ retry_policy: @config.rpcs.get_stream.retry_policy
848
+
849
+ options.apply_defaults timeout: @config.timeout,
850
+ metadata: @config.metadata,
851
+ retry_policy: @config.retry_policy
852
+
853
+ @streams_service_stub.get_stream request, options do |result, operation|
854
+ yield result, operation if block_given?
855
+ return result
856
+ end
857
+ rescue ::Gapic::Rest::Error => e
858
+ raise ::Google::Cloud::Error.from_error(e)
859
+ end
860
+
861
+ ##
862
+ # Creates a new Stream in a given project and location.
863
+ #
864
+ # @overload create_stream(request, options = nil)
865
+ # Pass arguments to `create_stream` via a request object, either of type
866
+ # {::Google::Cloud::VisionAI::V1::CreateStreamRequest} or an equivalent Hash.
867
+ #
868
+ # @param request [::Google::Cloud::VisionAI::V1::CreateStreamRequest, ::Hash]
869
+ # A request object representing the call parameters. Required. To specify no
870
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
871
+ # @param options [::Gapic::CallOptions, ::Hash]
872
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
873
+ #
874
+ # @overload create_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil)
875
+ # Pass arguments to `create_stream` via keyword arguments. Note that at
876
+ # least one keyword argument is required. To specify no parameters, or to keep all
877
+ # the default parameter values, pass an empty Hash as a request object (see above).
878
+ #
879
+ # @param parent [::String]
880
+ # Required. Value for parent.
881
+ # @param stream_id [::String]
882
+ # Required. Id of the requesting object.
883
+ # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash]
884
+ # Required. The resource being created.
885
+ # @param request_id [::String]
886
+ # Optional. An optional request ID to identify requests. Specify a unique
887
+ # request ID so that if you must retry your request, the server will know to
888
+ # ignore the request if it has already been completed. The server will
889
+ # guarantee that for at least 60 minutes since the first request.
890
+ #
891
+ # For example, consider a situation where you make an initial request and the
892
+ # request times out. If you make the request again with the same request ID,
893
+ # the server can check if original operation with the same request ID was
894
+ # received, and if so, will ignore the second request. This prevents clients
895
+ # from accidentally creating duplicate commitments.
896
+ #
897
+ # The request ID must be a valid UUID with the exception that zero UUID is
898
+ # not supported (00000000-0000-0000-0000-000000000000).
899
+ # @yield [result, operation] Access the result along with the TransportOperation object
900
+ # @yieldparam result [::Gapic::Operation]
901
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
902
+ #
903
+ # @return [::Gapic::Operation]
904
+ #
905
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
906
+ #
907
+ # @example Basic example
908
+ # require "google/cloud/vision_ai/v1"
909
+ #
910
+ # # Create a client object. The client can be reused for multiple calls.
911
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
912
+ #
913
+ # # Create a request. To set request fields, pass in keyword arguments.
914
+ # request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new
915
+ #
916
+ # # Call the create_stream method.
917
+ # result = client.create_stream request
918
+ #
919
+ # # The returned object is of type Gapic::Operation. You can use it to
920
+ # # check the status of an operation, cancel it, or wait for results.
921
+ # # Here is how to wait for a response.
922
+ # result.wait_until_done! timeout: 60
923
+ # if result.response?
924
+ # p result.response
925
+ # else
926
+ # puts "No response received."
927
+ # end
928
+ #
929
+ def create_stream request, options = nil
930
+ raise ::ArgumentError, "request must be provided" if request.nil?
931
+
932
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateStreamRequest
933
+
934
+ # Converts hash and nil to an options object
935
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
936
+
937
+ # Customize the options with defaults
938
+ call_metadata = @config.rpcs.create_stream.metadata.to_h
939
+
940
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
941
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
942
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
943
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
944
+ transports_version_send: [:rest]
945
+
946
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
947
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
948
+
949
+ options.apply_defaults timeout: @config.rpcs.create_stream.timeout,
950
+ metadata: call_metadata,
951
+ retry_policy: @config.rpcs.create_stream.retry_policy
952
+
953
+ options.apply_defaults timeout: @config.timeout,
954
+ metadata: @config.metadata,
955
+ retry_policy: @config.retry_policy
956
+
957
+ @streams_service_stub.create_stream request, options do |result, operation|
958
+ result = ::Gapic::Operation.new result, @operations_client, options: options
959
+ yield result, operation if block_given?
960
+ return result
961
+ end
962
+ rescue ::Gapic::Rest::Error => e
963
+ raise ::Google::Cloud::Error.from_error(e)
964
+ end
965
+
966
+ ##
967
+ # Updates the parameters of a single Stream.
968
+ #
969
+ # @overload update_stream(request, options = nil)
970
+ # Pass arguments to `update_stream` via a request object, either of type
971
+ # {::Google::Cloud::VisionAI::V1::UpdateStreamRequest} or an equivalent Hash.
972
+ #
973
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateStreamRequest, ::Hash]
974
+ # A request object representing the call parameters. Required. To specify no
975
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
976
+ # @param options [::Gapic::CallOptions, ::Hash]
977
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
978
+ #
979
+ # @overload update_stream(update_mask: nil, stream: nil, request_id: nil)
980
+ # Pass arguments to `update_stream` via keyword arguments. Note that at
981
+ # least one keyword argument is required. To specify no parameters, or to keep all
982
+ # the default parameter values, pass an empty Hash as a request object (see above).
983
+ #
984
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
985
+ # Required. Field mask is used to specify the fields to be overwritten in the
986
+ # Stream resource by the update.
987
+ # The fields specified in the update_mask are relative to the resource, not
988
+ # the full request. A field will be overwritten if it is in the mask. If the
989
+ # user does not provide a mask then all fields will be overwritten.
990
+ # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash]
991
+ # Required. The resource being updated.
992
+ # @param request_id [::String]
993
+ # Optional. An optional request ID to identify requests. Specify a unique
994
+ # request ID so that if you must retry your request, the server will know to
995
+ # ignore the request if it has already been completed. The server will
996
+ # guarantee that for at least 60 minutes since the first request.
997
+ #
998
+ # For example, consider a situation where you make an initial request and the
999
+ # request times out. If you make the request again with the same request ID,
1000
+ # the server can check if original operation with the same request ID was
1001
+ # received, and if so, will ignore the second request. This prevents clients
1002
+ # from accidentally creating duplicate commitments.
1003
+ #
1004
+ # The request ID must be a valid UUID with the exception that zero UUID is
1005
+ # not supported (00000000-0000-0000-0000-000000000000).
1006
+ # @yield [result, operation] Access the result along with the TransportOperation object
1007
+ # @yieldparam result [::Gapic::Operation]
1008
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1009
+ #
1010
+ # @return [::Gapic::Operation]
1011
+ #
1012
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1013
+ #
1014
+ # @example Basic example
1015
+ # require "google/cloud/vision_ai/v1"
1016
+ #
1017
+ # # Create a client object. The client can be reused for multiple calls.
1018
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1019
+ #
1020
+ # # Create a request. To set request fields, pass in keyword arguments.
1021
+ # request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new
1022
+ #
1023
+ # # Call the update_stream method.
1024
+ # result = client.update_stream request
1025
+ #
1026
+ # # The returned object is of type Gapic::Operation. You can use it to
1027
+ # # check the status of an operation, cancel it, or wait for results.
1028
+ # # Here is how to wait for a response.
1029
+ # result.wait_until_done! timeout: 60
1030
+ # if result.response?
1031
+ # p result.response
1032
+ # else
1033
+ # puts "No response received."
1034
+ # end
1035
+ #
1036
+ def update_stream request, options = nil
1037
+ raise ::ArgumentError, "request must be provided" if request.nil?
1038
+
1039
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateStreamRequest
1040
+
1041
+ # Converts hash and nil to an options object
1042
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1043
+
1044
+ # Customize the options with defaults
1045
+ call_metadata = @config.rpcs.update_stream.metadata.to_h
1046
+
1047
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1048
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1049
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1050
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1051
+ transports_version_send: [:rest]
1052
+
1053
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1054
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1055
+
1056
+ options.apply_defaults timeout: @config.rpcs.update_stream.timeout,
1057
+ metadata: call_metadata,
1058
+ retry_policy: @config.rpcs.update_stream.retry_policy
1059
+
1060
+ options.apply_defaults timeout: @config.timeout,
1061
+ metadata: @config.metadata,
1062
+ retry_policy: @config.retry_policy
1063
+
1064
+ @streams_service_stub.update_stream request, options do |result, operation|
1065
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1066
+ yield result, operation if block_given?
1067
+ return result
1068
+ end
1069
+ rescue ::Gapic::Rest::Error => e
1070
+ raise ::Google::Cloud::Error.from_error(e)
1071
+ end
1072
+
1073
+ ##
1074
+ # Deletes a single Stream.
1075
+ #
1076
+ # @overload delete_stream(request, options = nil)
1077
+ # Pass arguments to `delete_stream` via a request object, either of type
1078
+ # {::Google::Cloud::VisionAI::V1::DeleteStreamRequest} or an equivalent Hash.
1079
+ #
1080
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteStreamRequest, ::Hash]
1081
+ # A request object representing the call parameters. Required. To specify no
1082
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1083
+ # @param options [::Gapic::CallOptions, ::Hash]
1084
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1085
+ #
1086
+ # @overload delete_stream(name: nil, request_id: nil)
1087
+ # Pass arguments to `delete_stream` via keyword arguments. Note that at
1088
+ # least one keyword argument is required. To specify no parameters, or to keep all
1089
+ # the default parameter values, pass an empty Hash as a request object (see above).
1090
+ #
1091
+ # @param name [::String]
1092
+ # Required. Name of the resource.
1093
+ # @param request_id [::String]
1094
+ # Optional. An optional request ID to identify requests. Specify a unique
1095
+ # request ID so that if you must retry your request, the server will know to
1096
+ # ignore the request if it has already been completed. The server will
1097
+ # guarantee that for at least 60 minutes after the first request.
1098
+ #
1099
+ # For example, consider a situation where you make an initial request and the
1100
+ # request times out. If you make the request again with the same request ID,
1101
+ # the server can check if original operation with the same request ID was
1102
+ # received, and if so, will ignore the second request. This prevents clients
1103
+ # from accidentally creating duplicate commitments.
1104
+ #
1105
+ # The request ID must be a valid UUID with the exception that zero UUID is
1106
+ # not supported (00000000-0000-0000-0000-000000000000).
1107
+ # @yield [result, operation] Access the result along with the TransportOperation object
1108
+ # @yieldparam result [::Gapic::Operation]
1109
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1110
+ #
1111
+ # @return [::Gapic::Operation]
1112
+ #
1113
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1114
+ #
1115
+ # @example Basic example
1116
+ # require "google/cloud/vision_ai/v1"
1117
+ #
1118
+ # # Create a client object. The client can be reused for multiple calls.
1119
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1120
+ #
1121
+ # # Create a request. To set request fields, pass in keyword arguments.
1122
+ # request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new
1123
+ #
1124
+ # # Call the delete_stream method.
1125
+ # result = client.delete_stream request
1126
+ #
1127
+ # # The returned object is of type Gapic::Operation. You can use it to
1128
+ # # check the status of an operation, cancel it, or wait for results.
1129
+ # # Here is how to wait for a response.
1130
+ # result.wait_until_done! timeout: 60
1131
+ # if result.response?
1132
+ # p result.response
1133
+ # else
1134
+ # puts "No response received."
1135
+ # end
1136
+ #
1137
+ def delete_stream request, options = nil
1138
+ raise ::ArgumentError, "request must be provided" if request.nil?
1139
+
1140
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteStreamRequest
1141
+
1142
+ # Converts hash and nil to an options object
1143
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1144
+
1145
+ # Customize the options with defaults
1146
+ call_metadata = @config.rpcs.delete_stream.metadata.to_h
1147
+
1148
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1149
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1150
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1151
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1152
+ transports_version_send: [:rest]
1153
+
1154
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1155
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1156
+
1157
+ options.apply_defaults timeout: @config.rpcs.delete_stream.timeout,
1158
+ metadata: call_metadata,
1159
+ retry_policy: @config.rpcs.delete_stream.retry_policy
1160
+
1161
+ options.apply_defaults timeout: @config.timeout,
1162
+ metadata: @config.metadata,
1163
+ retry_policy: @config.retry_policy
1164
+
1165
+ @streams_service_stub.delete_stream request, options do |result, operation|
1166
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1167
+ yield result, operation if block_given?
1168
+ return result
1169
+ end
1170
+ rescue ::Gapic::Rest::Error => e
1171
+ raise ::Google::Cloud::Error.from_error(e)
1172
+ end
1173
+
1174
+ ##
1175
+ # Gets the thumbnail (image snapshot) of a single Stream.
1176
+ #
1177
+ # @overload get_stream_thumbnail(request, options = nil)
1178
+ # Pass arguments to `get_stream_thumbnail` via a request object, either of type
1179
+ # {::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest} or an equivalent Hash.
1180
+ #
1181
+ # @param request [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, ::Hash]
1182
+ # A request object representing the call parameters. Required. To specify no
1183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1184
+ # @param options [::Gapic::CallOptions, ::Hash]
1185
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1186
+ #
1187
+ # @overload get_stream_thumbnail(stream: nil, gcs_object_name: nil, event: nil, request_id: nil)
1188
+ # Pass arguments to `get_stream_thumbnail` via keyword arguments. Note that at
1189
+ # least one keyword argument is required. To specify no parameters, or to keep all
1190
+ # the default parameter values, pass an empty Hash as a request object (see above).
1191
+ #
1192
+ # @param stream [::String]
1193
+ # Required. The name of the stream for to get the thumbnail from.
1194
+ # @param gcs_object_name [::String]
1195
+ # Required. The name of the GCS object to store the thumbnail image.
1196
+ # @param event [::String]
1197
+ # Optional. The name of the event. If unspecified, the thumbnail will be
1198
+ # retrieved from the latest event.
1199
+ # @param request_id [::String]
1200
+ # Optional. An optional request ID to identify the requests. Specify a unique
1201
+ # request ID so that if you must retry your request, the server will know to
1202
+ # ignore the request if it has already been completed. The server will
1203
+ # guarantee that for at least 60 minutes since the first request.
1204
+ #
1205
+ # For example, consider a situation where you make an initial request and the
1206
+ # request times out. If you make the request again with the same request ID,
1207
+ # the server can check if original operation with the same request ID was
1208
+ # received, and if so, will ignore the second request. This prevents clients
1209
+ # from accidentally creating duplicate commitments.
1210
+ #
1211
+ # The request ID must be a valid UUID with the exception that zero UUID is
1212
+ # not supported (00000000-0000-0000-0000-000000000000).
1213
+ # @yield [result, operation] Access the result along with the TransportOperation object
1214
+ # @yieldparam result [::Gapic::Operation]
1215
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1216
+ #
1217
+ # @return [::Gapic::Operation]
1218
+ #
1219
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1220
+ #
1221
+ # @example Basic example
1222
+ # require "google/cloud/vision_ai/v1"
1223
+ #
1224
+ # # Create a client object. The client can be reused for multiple calls.
1225
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1226
+ #
1227
+ # # Create a request. To set request fields, pass in keyword arguments.
1228
+ # request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new
1229
+ #
1230
+ # # Call the get_stream_thumbnail method.
1231
+ # result = client.get_stream_thumbnail request
1232
+ #
1233
+ # # The returned object is of type Gapic::Operation. You can use it to
1234
+ # # check the status of an operation, cancel it, or wait for results.
1235
+ # # Here is how to wait for a response.
1236
+ # result.wait_until_done! timeout: 60
1237
+ # if result.response?
1238
+ # p result.response
1239
+ # else
1240
+ # puts "No response received."
1241
+ # end
1242
+ #
1243
+ def get_stream_thumbnail request, options = nil
1244
+ raise ::ArgumentError, "request must be provided" if request.nil?
1245
+
1246
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest
1247
+
1248
+ # Converts hash and nil to an options object
1249
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1250
+
1251
+ # Customize the options with defaults
1252
+ call_metadata = @config.rpcs.get_stream_thumbnail.metadata.to_h
1253
+
1254
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1255
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1257
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1258
+ transports_version_send: [:rest]
1259
+
1260
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1261
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1262
+
1263
+ options.apply_defaults timeout: @config.rpcs.get_stream_thumbnail.timeout,
1264
+ metadata: call_metadata,
1265
+ retry_policy: @config.rpcs.get_stream_thumbnail.retry_policy
1266
+
1267
+ options.apply_defaults timeout: @config.timeout,
1268
+ metadata: @config.metadata,
1269
+ retry_policy: @config.retry_policy
1270
+
1271
+ @streams_service_stub.get_stream_thumbnail request, options do |result, operation|
1272
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1273
+ yield result, operation if block_given?
1274
+ return result
1275
+ end
1276
+ rescue ::Gapic::Rest::Error => e
1277
+ raise ::Google::Cloud::Error.from_error(e)
1278
+ end
1279
+
1280
+ ##
1281
+ # Generate the JWT auth token required to get the stream HLS contents.
1282
+ #
1283
+ # @overload generate_stream_hls_token(request, options = nil)
1284
+ # Pass arguments to `generate_stream_hls_token` via a request object, either of type
1285
+ # {::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest} or an equivalent Hash.
1286
+ #
1287
+ # @param request [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, ::Hash]
1288
+ # A request object representing the call parameters. Required. To specify no
1289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1290
+ # @param options [::Gapic::CallOptions, ::Hash]
1291
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1292
+ #
1293
+ # @overload generate_stream_hls_token(stream: nil)
1294
+ # Pass arguments to `generate_stream_hls_token` via keyword arguments. Note that at
1295
+ # least one keyword argument is required. To specify no parameters, or to keep all
1296
+ # the default parameter values, pass an empty Hash as a request object (see above).
1297
+ #
1298
+ # @param stream [::String]
1299
+ # Required. The name of the stream.
1300
+ # @yield [result, operation] Access the result along with the TransportOperation object
1301
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse]
1302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1303
+ #
1304
+ # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse]
1305
+ #
1306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1307
+ #
1308
+ # @example Basic example
1309
+ # require "google/cloud/vision_ai/v1"
1310
+ #
1311
+ # # Create a client object. The client can be reused for multiple calls.
1312
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1313
+ #
1314
+ # # Create a request. To set request fields, pass in keyword arguments.
1315
+ # request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new
1316
+ #
1317
+ # # Call the generate_stream_hls_token method.
1318
+ # result = client.generate_stream_hls_token request
1319
+ #
1320
+ # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.
1321
+ # p result
1322
+ #
1323
+ def generate_stream_hls_token request, options = nil
1324
+ raise ::ArgumentError, "request must be provided" if request.nil?
1325
+
1326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest
1327
+
1328
+ # Converts hash and nil to an options object
1329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1330
+
1331
+ # Customize the options with defaults
1332
+ call_metadata = @config.rpcs.generate_stream_hls_token.metadata.to_h
1333
+
1334
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1335
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1337
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1338
+ transports_version_send: [:rest]
1339
+
1340
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1341
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1342
+
1343
+ options.apply_defaults timeout: @config.rpcs.generate_stream_hls_token.timeout,
1344
+ metadata: call_metadata,
1345
+ retry_policy: @config.rpcs.generate_stream_hls_token.retry_policy
1346
+
1347
+ options.apply_defaults timeout: @config.timeout,
1348
+ metadata: @config.metadata,
1349
+ retry_policy: @config.retry_policy
1350
+
1351
+ @streams_service_stub.generate_stream_hls_token request, options do |result, operation|
1352
+ yield result, operation if block_given?
1353
+ return result
1354
+ end
1355
+ rescue ::Gapic::Rest::Error => e
1356
+ raise ::Google::Cloud::Error.from_error(e)
1357
+ end
1358
+
1359
+ ##
1360
+ # Lists Events in a given project and location.
1361
+ #
1362
+ # @overload list_events(request, options = nil)
1363
+ # Pass arguments to `list_events` via a request object, either of type
1364
+ # {::Google::Cloud::VisionAI::V1::ListEventsRequest} or an equivalent Hash.
1365
+ #
1366
+ # @param request [::Google::Cloud::VisionAI::V1::ListEventsRequest, ::Hash]
1367
+ # A request object representing the call parameters. Required. To specify no
1368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1369
+ # @param options [::Gapic::CallOptions, ::Hash]
1370
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1371
+ #
1372
+ # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1373
+ # Pass arguments to `list_events` via keyword arguments. Note that at
1374
+ # least one keyword argument is required. To specify no parameters, or to keep all
1375
+ # the default parameter values, pass an empty Hash as a request object (see above).
1376
+ #
1377
+ # @param parent [::String]
1378
+ # Required. Parent value for ListEventsRequest.
1379
+ # @param page_size [::Integer]
1380
+ # Requested page size. Server may return fewer items than requested.
1381
+ # If unspecified, server will pick an appropriate default.
1382
+ # @param page_token [::String]
1383
+ # A token identifying a page of results the server should return.
1384
+ # @param filter [::String]
1385
+ # Filtering results.
1386
+ # @param order_by [::String]
1387
+ # Hint for how to order the results.
1388
+ # @yield [result, operation] Access the result along with the TransportOperation object
1389
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListEventsResponse]
1390
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1391
+ #
1392
+ # @return [::Google::Cloud::VisionAI::V1::ListEventsResponse]
1393
+ #
1394
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1395
+ #
1396
+ # @example Basic example
1397
+ # require "google/cloud/vision_ai/v1"
1398
+ #
1399
+ # # Create a client object. The client can be reused for multiple calls.
1400
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1401
+ #
1402
+ # # Create a request. To set request fields, pass in keyword arguments.
1403
+ # request = Google::Cloud::VisionAI::V1::ListEventsRequest.new
1404
+ #
1405
+ # # Call the list_events method.
1406
+ # result = client.list_events request
1407
+ #
1408
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1409
+ # # over elements, and API calls will be issued to fetch pages as needed.
1410
+ # result.each do |item|
1411
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Event.
1412
+ # p item
1413
+ # end
1414
+ #
1415
+ def list_events request, options = nil
1416
+ raise ::ArgumentError, "request must be provided" if request.nil?
1417
+
1418
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListEventsRequest
1419
+
1420
+ # Converts hash and nil to an options object
1421
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1422
+
1423
+ # Customize the options with defaults
1424
+ call_metadata = @config.rpcs.list_events.metadata.to_h
1425
+
1426
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1427
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1428
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1429
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1430
+ transports_version_send: [:rest]
1431
+
1432
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1433
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1434
+
1435
+ options.apply_defaults timeout: @config.rpcs.list_events.timeout,
1436
+ metadata: call_metadata,
1437
+ retry_policy: @config.rpcs.list_events.retry_policy
1438
+
1439
+ options.apply_defaults timeout: @config.timeout,
1440
+ metadata: @config.metadata,
1441
+ retry_policy: @config.retry_policy
1442
+
1443
+ @streams_service_stub.list_events request, options do |result, operation|
1444
+ yield result, operation if block_given?
1445
+ return result
1446
+ end
1447
+ rescue ::Gapic::Rest::Error => e
1448
+ raise ::Google::Cloud::Error.from_error(e)
1449
+ end
1450
+
1451
+ ##
1452
+ # Gets details of a single Event.
1453
+ #
1454
+ # @overload get_event(request, options = nil)
1455
+ # Pass arguments to `get_event` via a request object, either of type
1456
+ # {::Google::Cloud::VisionAI::V1::GetEventRequest} or an equivalent Hash.
1457
+ #
1458
+ # @param request [::Google::Cloud::VisionAI::V1::GetEventRequest, ::Hash]
1459
+ # A request object representing the call parameters. Required. To specify no
1460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1461
+ # @param options [::Gapic::CallOptions, ::Hash]
1462
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1463
+ #
1464
+ # @overload get_event(name: nil)
1465
+ # Pass arguments to `get_event` via keyword arguments. Note that at
1466
+ # least one keyword argument is required. To specify no parameters, or to keep all
1467
+ # the default parameter values, pass an empty Hash as a request object (see above).
1468
+ #
1469
+ # @param name [::String]
1470
+ # Required. Name of the resource.
1471
+ # @yield [result, operation] Access the result along with the TransportOperation object
1472
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Event]
1473
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1474
+ #
1475
+ # @return [::Google::Cloud::VisionAI::V1::Event]
1476
+ #
1477
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1478
+ #
1479
+ # @example Basic example
1480
+ # require "google/cloud/vision_ai/v1"
1481
+ #
1482
+ # # Create a client object. The client can be reused for multiple calls.
1483
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1484
+ #
1485
+ # # Create a request. To set request fields, pass in keyword arguments.
1486
+ # request = Google::Cloud::VisionAI::V1::GetEventRequest.new
1487
+ #
1488
+ # # Call the get_event method.
1489
+ # result = client.get_event request
1490
+ #
1491
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Event.
1492
+ # p result
1493
+ #
1494
+ def get_event request, options = nil
1495
+ raise ::ArgumentError, "request must be provided" if request.nil?
1496
+
1497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetEventRequest
1498
+
1499
+ # Converts hash and nil to an options object
1500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1501
+
1502
+ # Customize the options with defaults
1503
+ call_metadata = @config.rpcs.get_event.metadata.to_h
1504
+
1505
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1506
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1508
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1509
+ transports_version_send: [:rest]
1510
+
1511
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1512
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1513
+
1514
+ options.apply_defaults timeout: @config.rpcs.get_event.timeout,
1515
+ metadata: call_metadata,
1516
+ retry_policy: @config.rpcs.get_event.retry_policy
1517
+
1518
+ options.apply_defaults timeout: @config.timeout,
1519
+ metadata: @config.metadata,
1520
+ retry_policy: @config.retry_policy
1521
+
1522
+ @streams_service_stub.get_event request, options do |result, operation|
1523
+ yield result, operation if block_given?
1524
+ return result
1525
+ end
1526
+ rescue ::Gapic::Rest::Error => e
1527
+ raise ::Google::Cloud::Error.from_error(e)
1528
+ end
1529
+
1530
+ ##
1531
+ # Creates a new Event in a given project and location.
1532
+ #
1533
+ # @overload create_event(request, options = nil)
1534
+ # Pass arguments to `create_event` via a request object, either of type
1535
+ # {::Google::Cloud::VisionAI::V1::CreateEventRequest} or an equivalent Hash.
1536
+ #
1537
+ # @param request [::Google::Cloud::VisionAI::V1::CreateEventRequest, ::Hash]
1538
+ # A request object representing the call parameters. Required. To specify no
1539
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1540
+ # @param options [::Gapic::CallOptions, ::Hash]
1541
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1542
+ #
1543
+ # @overload create_event(parent: nil, event_id: nil, event: nil, request_id: nil)
1544
+ # Pass arguments to `create_event` via keyword arguments. Note that at
1545
+ # least one keyword argument is required. To specify no parameters, or to keep all
1546
+ # the default parameter values, pass an empty Hash as a request object (see above).
1547
+ #
1548
+ # @param parent [::String]
1549
+ # Required. Value for parent.
1550
+ # @param event_id [::String]
1551
+ # Required. Id of the requesting object.
1552
+ # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash]
1553
+ # Required. The resource being created.
1554
+ # @param request_id [::String]
1555
+ # Optional. An optional request ID to identify requests. Specify a unique
1556
+ # request ID so that if you must retry your request, the server will know to
1557
+ # ignore the request if it has already been completed. The server will
1558
+ # guarantee that for at least 60 minutes since the first request.
1559
+ #
1560
+ # For example, consider a situation where you make an initial request and the
1561
+ # request times out. If you make the request again with the same request ID,
1562
+ # the server can check if original operation with the same request ID was
1563
+ # received, and if so, will ignore the second request. This prevents clients
1564
+ # from accidentally creating duplicate commitments.
1565
+ #
1566
+ # The request ID must be a valid UUID with the exception that zero UUID is
1567
+ # not supported (00000000-0000-0000-0000-000000000000).
1568
+ # @yield [result, operation] Access the result along with the TransportOperation object
1569
+ # @yieldparam result [::Gapic::Operation]
1570
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1571
+ #
1572
+ # @return [::Gapic::Operation]
1573
+ #
1574
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1575
+ #
1576
+ # @example Basic example
1577
+ # require "google/cloud/vision_ai/v1"
1578
+ #
1579
+ # # Create a client object. The client can be reused for multiple calls.
1580
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1581
+ #
1582
+ # # Create a request. To set request fields, pass in keyword arguments.
1583
+ # request = Google::Cloud::VisionAI::V1::CreateEventRequest.new
1584
+ #
1585
+ # # Call the create_event method.
1586
+ # result = client.create_event request
1587
+ #
1588
+ # # The returned object is of type Gapic::Operation. You can use it to
1589
+ # # check the status of an operation, cancel it, or wait for results.
1590
+ # # Here is how to wait for a response.
1591
+ # result.wait_until_done! timeout: 60
1592
+ # if result.response?
1593
+ # p result.response
1594
+ # else
1595
+ # puts "No response received."
1596
+ # end
1597
+ #
1598
+ def create_event request, options = nil
1599
+ raise ::ArgumentError, "request must be provided" if request.nil?
1600
+
1601
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateEventRequest
1602
+
1603
+ # Converts hash and nil to an options object
1604
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1605
+
1606
+ # Customize the options with defaults
1607
+ call_metadata = @config.rpcs.create_event.metadata.to_h
1608
+
1609
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1610
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1611
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1612
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1613
+ transports_version_send: [:rest]
1614
+
1615
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1616
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1617
+
1618
+ options.apply_defaults timeout: @config.rpcs.create_event.timeout,
1619
+ metadata: call_metadata,
1620
+ retry_policy: @config.rpcs.create_event.retry_policy
1621
+
1622
+ options.apply_defaults timeout: @config.timeout,
1623
+ metadata: @config.metadata,
1624
+ retry_policy: @config.retry_policy
1625
+
1626
+ @streams_service_stub.create_event request, options do |result, operation|
1627
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1628
+ yield result, operation if block_given?
1629
+ return result
1630
+ end
1631
+ rescue ::Gapic::Rest::Error => e
1632
+ raise ::Google::Cloud::Error.from_error(e)
1633
+ end
1634
+
1635
+ ##
1636
+ # Updates the parameters of a single Event.
1637
+ #
1638
+ # @overload update_event(request, options = nil)
1639
+ # Pass arguments to `update_event` via a request object, either of type
1640
+ # {::Google::Cloud::VisionAI::V1::UpdateEventRequest} or an equivalent Hash.
1641
+ #
1642
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateEventRequest, ::Hash]
1643
+ # A request object representing the call parameters. Required. To specify no
1644
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1645
+ # @param options [::Gapic::CallOptions, ::Hash]
1646
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1647
+ #
1648
+ # @overload update_event(update_mask: nil, event: nil, request_id: nil)
1649
+ # Pass arguments to `update_event` via keyword arguments. Note that at
1650
+ # least one keyword argument is required. To specify no parameters, or to keep all
1651
+ # the default parameter values, pass an empty Hash as a request object (see above).
1652
+ #
1653
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1654
+ # Required. Field mask is used to specify the fields to be overwritten in the
1655
+ # Event resource by the update.
1656
+ # The fields specified in the update_mask are relative to the resource, not
1657
+ # the full request. A field will be overwritten if it is in the mask. If the
1658
+ # user does not provide a mask then all fields will be overwritten.
1659
+ # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash]
1660
+ # Required. The resource being updated.
1661
+ # @param request_id [::String]
1662
+ # Optional. An optional request ID to identify requests. Specify a unique
1663
+ # request ID so that if you must retry your request, the server will know to
1664
+ # ignore the request if it has already been completed. The server will
1665
+ # guarantee that for at least 60 minutes since the first request.
1666
+ #
1667
+ # For example, consider a situation where you make an initial request and the
1668
+ # request times out. If you make the request again with the same request ID,
1669
+ # the server can check if original operation with the same request ID was
1670
+ # received, and if so, will ignore the second request. This prevents clients
1671
+ # from accidentally creating duplicate commitments.
1672
+ #
1673
+ # The request ID must be a valid UUID with the exception that zero UUID is
1674
+ # not supported (00000000-0000-0000-0000-000000000000).
1675
+ # @yield [result, operation] Access the result along with the TransportOperation object
1676
+ # @yieldparam result [::Gapic::Operation]
1677
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1678
+ #
1679
+ # @return [::Gapic::Operation]
1680
+ #
1681
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1682
+ #
1683
+ # @example Basic example
1684
+ # require "google/cloud/vision_ai/v1"
1685
+ #
1686
+ # # Create a client object. The client can be reused for multiple calls.
1687
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1688
+ #
1689
+ # # Create a request. To set request fields, pass in keyword arguments.
1690
+ # request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new
1691
+ #
1692
+ # # Call the update_event method.
1693
+ # result = client.update_event request
1694
+ #
1695
+ # # The returned object is of type Gapic::Operation. You can use it to
1696
+ # # check the status of an operation, cancel it, or wait for results.
1697
+ # # Here is how to wait for a response.
1698
+ # result.wait_until_done! timeout: 60
1699
+ # if result.response?
1700
+ # p result.response
1701
+ # else
1702
+ # puts "No response received."
1703
+ # end
1704
+ #
1705
+ def update_event request, options = nil
1706
+ raise ::ArgumentError, "request must be provided" if request.nil?
1707
+
1708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateEventRequest
1709
+
1710
+ # Converts hash and nil to an options object
1711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1712
+
1713
+ # Customize the options with defaults
1714
+ call_metadata = @config.rpcs.update_event.metadata.to_h
1715
+
1716
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1717
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1719
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1720
+ transports_version_send: [:rest]
1721
+
1722
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1723
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1724
+
1725
+ options.apply_defaults timeout: @config.rpcs.update_event.timeout,
1726
+ metadata: call_metadata,
1727
+ retry_policy: @config.rpcs.update_event.retry_policy
1728
+
1729
+ options.apply_defaults timeout: @config.timeout,
1730
+ metadata: @config.metadata,
1731
+ retry_policy: @config.retry_policy
1732
+
1733
+ @streams_service_stub.update_event request, options do |result, operation|
1734
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1735
+ yield result, operation if block_given?
1736
+ return result
1737
+ end
1738
+ rescue ::Gapic::Rest::Error => e
1739
+ raise ::Google::Cloud::Error.from_error(e)
1740
+ end
1741
+
1742
+ ##
1743
+ # Deletes a single Event.
1744
+ #
1745
+ # @overload delete_event(request, options = nil)
1746
+ # Pass arguments to `delete_event` via a request object, either of type
1747
+ # {::Google::Cloud::VisionAI::V1::DeleteEventRequest} or an equivalent Hash.
1748
+ #
1749
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteEventRequest, ::Hash]
1750
+ # A request object representing the call parameters. Required. To specify no
1751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1752
+ # @param options [::Gapic::CallOptions, ::Hash]
1753
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1754
+ #
1755
+ # @overload delete_event(name: nil, request_id: nil)
1756
+ # Pass arguments to `delete_event` via keyword arguments. Note that at
1757
+ # least one keyword argument is required. To specify no parameters, or to keep all
1758
+ # the default parameter values, pass an empty Hash as a request object (see above).
1759
+ #
1760
+ # @param name [::String]
1761
+ # Required. Name of the resource.
1762
+ # @param request_id [::String]
1763
+ # Optional. An optional request ID to identify requests. Specify a unique
1764
+ # request ID so that if you must retry your request, the server will know to
1765
+ # ignore the request if it has already been completed. The server will
1766
+ # guarantee that for at least 60 minutes after the first request.
1767
+ #
1768
+ # For example, consider a situation where you make an initial request and the
1769
+ # request times out. If you make the request again with the same request ID,
1770
+ # the server can check if original operation with the same request ID was
1771
+ # received, and if so, will ignore the second request. This prevents clients
1772
+ # from accidentally creating duplicate commitments.
1773
+ #
1774
+ # The request ID must be a valid UUID with the exception that zero UUID is
1775
+ # not supported (00000000-0000-0000-0000-000000000000).
1776
+ # @yield [result, operation] Access the result along with the TransportOperation object
1777
+ # @yieldparam result [::Gapic::Operation]
1778
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1779
+ #
1780
+ # @return [::Gapic::Operation]
1781
+ #
1782
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1783
+ #
1784
+ # @example Basic example
1785
+ # require "google/cloud/vision_ai/v1"
1786
+ #
1787
+ # # Create a client object. The client can be reused for multiple calls.
1788
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1789
+ #
1790
+ # # Create a request. To set request fields, pass in keyword arguments.
1791
+ # request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new
1792
+ #
1793
+ # # Call the delete_event method.
1794
+ # result = client.delete_event request
1795
+ #
1796
+ # # The returned object is of type Gapic::Operation. You can use it to
1797
+ # # check the status of an operation, cancel it, or wait for results.
1798
+ # # Here is how to wait for a response.
1799
+ # result.wait_until_done! timeout: 60
1800
+ # if result.response?
1801
+ # p result.response
1802
+ # else
1803
+ # puts "No response received."
1804
+ # end
1805
+ #
1806
+ def delete_event request, options = nil
1807
+ raise ::ArgumentError, "request must be provided" if request.nil?
1808
+
1809
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteEventRequest
1810
+
1811
+ # Converts hash and nil to an options object
1812
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1813
+
1814
+ # Customize the options with defaults
1815
+ call_metadata = @config.rpcs.delete_event.metadata.to_h
1816
+
1817
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1818
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1819
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1820
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1821
+ transports_version_send: [:rest]
1822
+
1823
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1824
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1825
+
1826
+ options.apply_defaults timeout: @config.rpcs.delete_event.timeout,
1827
+ metadata: call_metadata,
1828
+ retry_policy: @config.rpcs.delete_event.retry_policy
1829
+
1830
+ options.apply_defaults timeout: @config.timeout,
1831
+ metadata: @config.metadata,
1832
+ retry_policy: @config.retry_policy
1833
+
1834
+ @streams_service_stub.delete_event request, options do |result, operation|
1835
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1836
+ yield result, operation if block_given?
1837
+ return result
1838
+ end
1839
+ rescue ::Gapic::Rest::Error => e
1840
+ raise ::Google::Cloud::Error.from_error(e)
1841
+ end
1842
+
1843
+ ##
1844
+ # Lists Series in a given project and location.
1845
+ #
1846
+ # @overload list_series(request, options = nil)
1847
+ # Pass arguments to `list_series` via a request object, either of type
1848
+ # {::Google::Cloud::VisionAI::V1::ListSeriesRequest} or an equivalent Hash.
1849
+ #
1850
+ # @param request [::Google::Cloud::VisionAI::V1::ListSeriesRequest, ::Hash]
1851
+ # A request object representing the call parameters. Required. To specify no
1852
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1853
+ # @param options [::Gapic::CallOptions, ::Hash]
1854
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1855
+ #
1856
+ # @overload list_series(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1857
+ # Pass arguments to `list_series` via keyword arguments. Note that at
1858
+ # least one keyword argument is required. To specify no parameters, or to keep all
1859
+ # the default parameter values, pass an empty Hash as a request object (see above).
1860
+ #
1861
+ # @param parent [::String]
1862
+ # Required. Parent value for ListSeriesRequest.
1863
+ # @param page_size [::Integer]
1864
+ # Requested page size. Server may return fewer items than requested.
1865
+ # If unspecified, server will pick an appropriate default.
1866
+ # @param page_token [::String]
1867
+ # A token identifying a page of results the server should return.
1868
+ # @param filter [::String]
1869
+ # Filtering results.
1870
+ # @param order_by [::String]
1871
+ # Hint for how to order the results.
1872
+ # @yield [result, operation] Access the result along with the TransportOperation object
1873
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListSeriesResponse]
1874
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1875
+ #
1876
+ # @return [::Google::Cloud::VisionAI::V1::ListSeriesResponse]
1877
+ #
1878
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1879
+ #
1880
+ # @example Basic example
1881
+ # require "google/cloud/vision_ai/v1"
1882
+ #
1883
+ # # Create a client object. The client can be reused for multiple calls.
1884
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1885
+ #
1886
+ # # Create a request. To set request fields, pass in keyword arguments.
1887
+ # request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new
1888
+ #
1889
+ # # Call the list_series method.
1890
+ # result = client.list_series request
1891
+ #
1892
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1893
+ # # over elements, and API calls will be issued to fetch pages as needed.
1894
+ # result.each do |item|
1895
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Series.
1896
+ # p item
1897
+ # end
1898
+ #
1899
+ def list_series request, options = nil
1900
+ raise ::ArgumentError, "request must be provided" if request.nil?
1901
+
1902
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSeriesRequest
1903
+
1904
+ # Converts hash and nil to an options object
1905
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1906
+
1907
+ # Customize the options with defaults
1908
+ call_metadata = @config.rpcs.list_series.metadata.to_h
1909
+
1910
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1911
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1912
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1913
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1914
+ transports_version_send: [:rest]
1915
+
1916
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1917
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1918
+
1919
+ options.apply_defaults timeout: @config.rpcs.list_series.timeout,
1920
+ metadata: call_metadata,
1921
+ retry_policy: @config.rpcs.list_series.retry_policy
1922
+
1923
+ options.apply_defaults timeout: @config.timeout,
1924
+ metadata: @config.metadata,
1925
+ retry_policy: @config.retry_policy
1926
+
1927
+ @streams_service_stub.list_series request, options do |result, operation|
1928
+ yield result, operation if block_given?
1929
+ return result
1930
+ end
1931
+ rescue ::Gapic::Rest::Error => e
1932
+ raise ::Google::Cloud::Error.from_error(e)
1933
+ end
1934
+
1935
+ ##
1936
+ # Gets details of a single Series.
1937
+ #
1938
+ # @overload get_series(request, options = nil)
1939
+ # Pass arguments to `get_series` via a request object, either of type
1940
+ # {::Google::Cloud::VisionAI::V1::GetSeriesRequest} or an equivalent Hash.
1941
+ #
1942
+ # @param request [::Google::Cloud::VisionAI::V1::GetSeriesRequest, ::Hash]
1943
+ # A request object representing the call parameters. Required. To specify no
1944
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1945
+ # @param options [::Gapic::CallOptions, ::Hash]
1946
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1947
+ #
1948
+ # @overload get_series(name: nil)
1949
+ # Pass arguments to `get_series` via keyword arguments. Note that at
1950
+ # least one keyword argument is required. To specify no parameters, or to keep all
1951
+ # the default parameter values, pass an empty Hash as a request object (see above).
1952
+ #
1953
+ # @param name [::String]
1954
+ # Required. Name of the resource.
1955
+ # @yield [result, operation] Access the result along with the TransportOperation object
1956
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Series]
1957
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1958
+ #
1959
+ # @return [::Google::Cloud::VisionAI::V1::Series]
1960
+ #
1961
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1962
+ #
1963
+ # @example Basic example
1964
+ # require "google/cloud/vision_ai/v1"
1965
+ #
1966
+ # # Create a client object. The client can be reused for multiple calls.
1967
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
1968
+ #
1969
+ # # Create a request. To set request fields, pass in keyword arguments.
1970
+ # request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new
1971
+ #
1972
+ # # Call the get_series method.
1973
+ # result = client.get_series request
1974
+ #
1975
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Series.
1976
+ # p result
1977
+ #
1978
+ def get_series request, options = nil
1979
+ raise ::ArgumentError, "request must be provided" if request.nil?
1980
+
1981
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSeriesRequest
1982
+
1983
+ # Converts hash and nil to an options object
1984
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1985
+
1986
+ # Customize the options with defaults
1987
+ call_metadata = @config.rpcs.get_series.metadata.to_h
1988
+
1989
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1990
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1991
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1992
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1993
+ transports_version_send: [:rest]
1994
+
1995
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1996
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1997
+
1998
+ options.apply_defaults timeout: @config.rpcs.get_series.timeout,
1999
+ metadata: call_metadata,
2000
+ retry_policy: @config.rpcs.get_series.retry_policy
2001
+
2002
+ options.apply_defaults timeout: @config.timeout,
2003
+ metadata: @config.metadata,
2004
+ retry_policy: @config.retry_policy
2005
+
2006
+ @streams_service_stub.get_series request, options do |result, operation|
2007
+ yield result, operation if block_given?
2008
+ return result
2009
+ end
2010
+ rescue ::Gapic::Rest::Error => e
2011
+ raise ::Google::Cloud::Error.from_error(e)
2012
+ end
2013
+
2014
+ ##
2015
+ # Creates a new Series in a given project and location.
2016
+ #
2017
+ # @overload create_series(request, options = nil)
2018
+ # Pass arguments to `create_series` via a request object, either of type
2019
+ # {::Google::Cloud::VisionAI::V1::CreateSeriesRequest} or an equivalent Hash.
2020
+ #
2021
+ # @param request [::Google::Cloud::VisionAI::V1::CreateSeriesRequest, ::Hash]
2022
+ # A request object representing the call parameters. Required. To specify no
2023
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2024
+ # @param options [::Gapic::CallOptions, ::Hash]
2025
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2026
+ #
2027
+ # @overload create_series(parent: nil, series_id: nil, series: nil, request_id: nil)
2028
+ # Pass arguments to `create_series` via keyword arguments. Note that at
2029
+ # least one keyword argument is required. To specify no parameters, or to keep all
2030
+ # the default parameter values, pass an empty Hash as a request object (see above).
2031
+ #
2032
+ # @param parent [::String]
2033
+ # Required. Value for parent.
2034
+ # @param series_id [::String]
2035
+ # Required. Id of the requesting object.
2036
+ # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash]
2037
+ # Required. The resource being created.
2038
+ # @param request_id [::String]
2039
+ # Optional. An optional request ID to identify requests. Specify a unique
2040
+ # request ID so that if you must retry your request, the server will know to
2041
+ # ignore the request if it has already been completed. The server will
2042
+ # guarantee that for at least 60 minutes since the first request.
2043
+ #
2044
+ # For example, consider a situation where you make an initial request and the
2045
+ # request times out. If you make the request again with the same request ID,
2046
+ # the server can check if original operation with the same request ID was
2047
+ # received, and if so, will ignore the second request. This prevents clients
2048
+ # from accidentally creating duplicate commitments.
2049
+ #
2050
+ # The request ID must be a valid UUID with the exception that zero UUID is
2051
+ # not supported (00000000-0000-0000-0000-000000000000).
2052
+ # @yield [result, operation] Access the result along with the TransportOperation object
2053
+ # @yieldparam result [::Gapic::Operation]
2054
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2055
+ #
2056
+ # @return [::Gapic::Operation]
2057
+ #
2058
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2059
+ #
2060
+ # @example Basic example
2061
+ # require "google/cloud/vision_ai/v1"
2062
+ #
2063
+ # # Create a client object. The client can be reused for multiple calls.
2064
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
2065
+ #
2066
+ # # Create a request. To set request fields, pass in keyword arguments.
2067
+ # request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new
2068
+ #
2069
+ # # Call the create_series method.
2070
+ # result = client.create_series request
2071
+ #
2072
+ # # The returned object is of type Gapic::Operation. You can use it to
2073
+ # # check the status of an operation, cancel it, or wait for results.
2074
+ # # Here is how to wait for a response.
2075
+ # result.wait_until_done! timeout: 60
2076
+ # if result.response?
2077
+ # p result.response
2078
+ # else
2079
+ # puts "No response received."
2080
+ # end
2081
+ #
2082
+ def create_series request, options = nil
2083
+ raise ::ArgumentError, "request must be provided" if request.nil?
2084
+
2085
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSeriesRequest
2086
+
2087
+ # Converts hash and nil to an options object
2088
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2089
+
2090
+ # Customize the options with defaults
2091
+ call_metadata = @config.rpcs.create_series.metadata.to_h
2092
+
2093
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2094
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2095
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2096
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2097
+ transports_version_send: [:rest]
2098
+
2099
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2100
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2101
+
2102
+ options.apply_defaults timeout: @config.rpcs.create_series.timeout,
2103
+ metadata: call_metadata,
2104
+ retry_policy: @config.rpcs.create_series.retry_policy
2105
+
2106
+ options.apply_defaults timeout: @config.timeout,
2107
+ metadata: @config.metadata,
2108
+ retry_policy: @config.retry_policy
2109
+
2110
+ @streams_service_stub.create_series request, options do |result, operation|
2111
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2112
+ yield result, operation if block_given?
2113
+ return result
2114
+ end
2115
+ rescue ::Gapic::Rest::Error => e
2116
+ raise ::Google::Cloud::Error.from_error(e)
2117
+ end
2118
+
2119
+ ##
2120
+ # Updates the parameters of a single Event.
2121
+ #
2122
+ # @overload update_series(request, options = nil)
2123
+ # Pass arguments to `update_series` via a request object, either of type
2124
+ # {::Google::Cloud::VisionAI::V1::UpdateSeriesRequest} or an equivalent Hash.
2125
+ #
2126
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, ::Hash]
2127
+ # A request object representing the call parameters. Required. To specify no
2128
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2129
+ # @param options [::Gapic::CallOptions, ::Hash]
2130
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2131
+ #
2132
+ # @overload update_series(update_mask: nil, series: nil, request_id: nil)
2133
+ # Pass arguments to `update_series` via keyword arguments. Note that at
2134
+ # least one keyword argument is required. To specify no parameters, or to keep all
2135
+ # the default parameter values, pass an empty Hash as a request object (see above).
2136
+ #
2137
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2138
+ # Required. Field mask is used to specify the fields to be overwritten in the
2139
+ # Series resource by the update. The fields specified in the update_mask are
2140
+ # relative to the resource, not the full request. A field will be overwritten
2141
+ # if it is in the mask. If the user does not provide a mask then all fields
2142
+ # will be overwritten.
2143
+ # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash]
2144
+ # Required. The resource being updated
2145
+ # @param request_id [::String]
2146
+ # Optional. An optional request ID to identify requests. Specify a unique
2147
+ # request ID so that if you must retry your request, the server will know to
2148
+ # ignore the request if it has already been completed. The server will
2149
+ # guarantee that for at least 60 minutes since the first request.
2150
+ #
2151
+ # For example, consider a situation where you make an initial request and the
2152
+ # request times out. If you make the request again with the same request ID,
2153
+ # the server can check if original operation with the same request ID was
2154
+ # received, and if so, will ignore the second request. This prevents clients
2155
+ # from accidentally creating duplicate commitments.
2156
+ #
2157
+ # The request ID must be a valid UUID with the exception that zero UUID is
2158
+ # not supported (00000000-0000-0000-0000-000000000000).
2159
+ # @yield [result, operation] Access the result along with the TransportOperation object
2160
+ # @yieldparam result [::Gapic::Operation]
2161
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2162
+ #
2163
+ # @return [::Gapic::Operation]
2164
+ #
2165
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2166
+ #
2167
+ # @example Basic example
2168
+ # require "google/cloud/vision_ai/v1"
2169
+ #
2170
+ # # Create a client object. The client can be reused for multiple calls.
2171
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
2172
+ #
2173
+ # # Create a request. To set request fields, pass in keyword arguments.
2174
+ # request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new
2175
+ #
2176
+ # # Call the update_series method.
2177
+ # result = client.update_series request
2178
+ #
2179
+ # # The returned object is of type Gapic::Operation. You can use it to
2180
+ # # check the status of an operation, cancel it, or wait for results.
2181
+ # # Here is how to wait for a response.
2182
+ # result.wait_until_done! timeout: 60
2183
+ # if result.response?
2184
+ # p result.response
2185
+ # else
2186
+ # puts "No response received."
2187
+ # end
2188
+ #
2189
+ def update_series request, options = nil
2190
+ raise ::ArgumentError, "request must be provided" if request.nil?
2191
+
2192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest
2193
+
2194
+ # Converts hash and nil to an options object
2195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2196
+
2197
+ # Customize the options with defaults
2198
+ call_metadata = @config.rpcs.update_series.metadata.to_h
2199
+
2200
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2203
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2204
+ transports_version_send: [:rest]
2205
+
2206
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2207
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2208
+
2209
+ options.apply_defaults timeout: @config.rpcs.update_series.timeout,
2210
+ metadata: call_metadata,
2211
+ retry_policy: @config.rpcs.update_series.retry_policy
2212
+
2213
+ options.apply_defaults timeout: @config.timeout,
2214
+ metadata: @config.metadata,
2215
+ retry_policy: @config.retry_policy
2216
+
2217
+ @streams_service_stub.update_series request, options do |result, operation|
2218
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2219
+ yield result, operation if block_given?
2220
+ return result
2221
+ end
2222
+ rescue ::Gapic::Rest::Error => e
2223
+ raise ::Google::Cloud::Error.from_error(e)
2224
+ end
2225
+
2226
+ ##
2227
+ # Deletes a single Series.
2228
+ #
2229
+ # @overload delete_series(request, options = nil)
2230
+ # Pass arguments to `delete_series` via a request object, either of type
2231
+ # {::Google::Cloud::VisionAI::V1::DeleteSeriesRequest} or an equivalent Hash.
2232
+ #
2233
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, ::Hash]
2234
+ # A request object representing the call parameters. Required. To specify no
2235
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2236
+ # @param options [::Gapic::CallOptions, ::Hash]
2237
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2238
+ #
2239
+ # @overload delete_series(name: nil, request_id: nil)
2240
+ # Pass arguments to `delete_series` via keyword arguments. Note that at
2241
+ # least one keyword argument is required. To specify no parameters, or to keep all
2242
+ # the default parameter values, pass an empty Hash as a request object (see above).
2243
+ #
2244
+ # @param name [::String]
2245
+ # Required. Name of the resource.
2246
+ # @param request_id [::String]
2247
+ # Optional. An optional request ID to identify requests. Specify a unique
2248
+ # request ID so that if you must retry your request, the server will know to
2249
+ # ignore the request if it has already been completed. The server will
2250
+ # guarantee that for at least 60 minutes after the first request.
2251
+ #
2252
+ # For example, consider a situation where you make an initial request and the
2253
+ # request times out. If you make the request again with the same request ID,
2254
+ # the server can check if original operation with the same request ID was
2255
+ # received, and if so, will ignore the second request. This prevents clients
2256
+ # from accidentally creating duplicate commitments.
2257
+ #
2258
+ # The request ID must be a valid UUID with the exception that zero UUID is
2259
+ # not supported (00000000-0000-0000-0000-000000000000).
2260
+ # @yield [result, operation] Access the result along with the TransportOperation object
2261
+ # @yieldparam result [::Gapic::Operation]
2262
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2263
+ #
2264
+ # @return [::Gapic::Operation]
2265
+ #
2266
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2267
+ #
2268
+ # @example Basic example
2269
+ # require "google/cloud/vision_ai/v1"
2270
+ #
2271
+ # # Create a client object. The client can be reused for multiple calls.
2272
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
2273
+ #
2274
+ # # Create a request. To set request fields, pass in keyword arguments.
2275
+ # request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new
2276
+ #
2277
+ # # Call the delete_series method.
2278
+ # result = client.delete_series request
2279
+ #
2280
+ # # The returned object is of type Gapic::Operation. You can use it to
2281
+ # # check the status of an operation, cancel it, or wait for results.
2282
+ # # Here is how to wait for a response.
2283
+ # result.wait_until_done! timeout: 60
2284
+ # if result.response?
2285
+ # p result.response
2286
+ # else
2287
+ # puts "No response received."
2288
+ # end
2289
+ #
2290
+ def delete_series request, options = nil
2291
+ raise ::ArgumentError, "request must be provided" if request.nil?
2292
+
2293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest
2294
+
2295
+ # Converts hash and nil to an options object
2296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2297
+
2298
+ # Customize the options with defaults
2299
+ call_metadata = @config.rpcs.delete_series.metadata.to_h
2300
+
2301
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2302
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2303
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2304
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2305
+ transports_version_send: [:rest]
2306
+
2307
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2308
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2309
+
2310
+ options.apply_defaults timeout: @config.rpcs.delete_series.timeout,
2311
+ metadata: call_metadata,
2312
+ retry_policy: @config.rpcs.delete_series.retry_policy
2313
+
2314
+ options.apply_defaults timeout: @config.timeout,
2315
+ metadata: @config.metadata,
2316
+ retry_policy: @config.retry_policy
2317
+
2318
+ @streams_service_stub.delete_series request, options do |result, operation|
2319
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2320
+ yield result, operation if block_given?
2321
+ return result
2322
+ end
2323
+ rescue ::Gapic::Rest::Error => e
2324
+ raise ::Google::Cloud::Error.from_error(e)
2325
+ end
2326
+
2327
+ ##
2328
+ # Materialize a channel.
2329
+ #
2330
+ # @overload materialize_channel(request, options = nil)
2331
+ # Pass arguments to `materialize_channel` via a request object, either of type
2332
+ # {::Google::Cloud::VisionAI::V1::MaterializeChannelRequest} or an equivalent Hash.
2333
+ #
2334
+ # @param request [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, ::Hash]
2335
+ # A request object representing the call parameters. Required. To specify no
2336
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2337
+ # @param options [::Gapic::CallOptions, ::Hash]
2338
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2339
+ #
2340
+ # @overload materialize_channel(parent: nil, channel_id: nil, channel: nil, request_id: nil)
2341
+ # Pass arguments to `materialize_channel` via keyword arguments. Note that at
2342
+ # least one keyword argument is required. To specify no parameters, or to keep all
2343
+ # the default parameter values, pass an empty Hash as a request object (see above).
2344
+ #
2345
+ # @param parent [::String]
2346
+ # Required. Value for parent.
2347
+ # @param channel_id [::String]
2348
+ # Required. Id of the channel.
2349
+ # @param channel [::Google::Cloud::VisionAI::V1::Channel, ::Hash]
2350
+ # Required. The resource being created.
2351
+ # @param request_id [::String]
2352
+ # Optional. An optional request ID to identify requests. Specify a unique
2353
+ # request ID so that if you must retry your request, the server will know to
2354
+ # ignore the request if it has already been completed. The server will
2355
+ # guarantee that for at least 60 minutes since the first request.
2356
+ #
2357
+ # For example, consider a situation where you make an initial request and the
2358
+ # request times out. If you make the request again with the same request ID,
2359
+ # the server can check if original operation with the same request ID was
2360
+ # received, and if so, will ignore the second request. This prevents clients
2361
+ # from accidentally creating duplicate commitments.
2362
+ #
2363
+ # The request ID must be a valid UUID with the exception that zero UUID is
2364
+ # not supported (00000000-0000-0000-0000-000000000000).
2365
+ # @yield [result, operation] Access the result along with the TransportOperation object
2366
+ # @yieldparam result [::Gapic::Operation]
2367
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2368
+ #
2369
+ # @return [::Gapic::Operation]
2370
+ #
2371
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2372
+ #
2373
+ # @example Basic example
2374
+ # require "google/cloud/vision_ai/v1"
2375
+ #
2376
+ # # Create a client object. The client can be reused for multiple calls.
2377
+ # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new
2378
+ #
2379
+ # # Create a request. To set request fields, pass in keyword arguments.
2380
+ # request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new
2381
+ #
2382
+ # # Call the materialize_channel method.
2383
+ # result = client.materialize_channel request
2384
+ #
2385
+ # # The returned object is of type Gapic::Operation. You can use it to
2386
+ # # check the status of an operation, cancel it, or wait for results.
2387
+ # # Here is how to wait for a response.
2388
+ # result.wait_until_done! timeout: 60
2389
+ # if result.response?
2390
+ # p result.response
2391
+ # else
2392
+ # puts "No response received."
2393
+ # end
2394
+ #
2395
+ def materialize_channel request, options = nil
2396
+ raise ::ArgumentError, "request must be provided" if request.nil?
2397
+
2398
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest
2399
+
2400
+ # Converts hash and nil to an options object
2401
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2402
+
2403
+ # Customize the options with defaults
2404
+ call_metadata = @config.rpcs.materialize_channel.metadata.to_h
2405
+
2406
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2407
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2409
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2410
+ transports_version_send: [:rest]
2411
+
2412
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2413
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2414
+
2415
+ options.apply_defaults timeout: @config.rpcs.materialize_channel.timeout,
2416
+ metadata: call_metadata,
2417
+ retry_policy: @config.rpcs.materialize_channel.retry_policy
2418
+
2419
+ options.apply_defaults timeout: @config.timeout,
2420
+ metadata: @config.metadata,
2421
+ retry_policy: @config.retry_policy
2422
+
2423
+ @streams_service_stub.materialize_channel request, options do |result, operation|
2424
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2425
+ yield result, operation if block_given?
2426
+ return result
2427
+ end
2428
+ rescue ::Gapic::Rest::Error => e
2429
+ raise ::Google::Cloud::Error.from_error(e)
2430
+ end
2431
+
2432
+ ##
2433
+ # Configuration class for the StreamsService REST API.
2434
+ #
2435
+ # This class represents the configuration for StreamsService REST,
2436
+ # providing control over timeouts, retry behavior, logging, transport
2437
+ # parameters, and other low-level controls. Certain parameters can also be
2438
+ # applied individually to specific RPCs. See
2439
+ # {::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client::Configuration::Rpcs}
2440
+ # for a list of RPCs that can be configured independently.
2441
+ #
2442
+ # Configuration can be applied globally to all clients, or to a single client
2443
+ # on construction.
2444
+ #
2445
+ # @example
2446
+ #
2447
+ # # Modify the global config, setting the timeout for
2448
+ # # list_clusters to 20 seconds,
2449
+ # # and all remaining timeouts to 10 seconds.
2450
+ # ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.configure do |config|
2451
+ # config.timeout = 10.0
2452
+ # config.rpcs.list_clusters.timeout = 20.0
2453
+ # end
2454
+ #
2455
+ # # Apply the above configuration only to a new client.
2456
+ # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config|
2457
+ # config.timeout = 10.0
2458
+ # config.rpcs.list_clusters.timeout = 20.0
2459
+ # end
2460
+ #
2461
+ # @!attribute [rw] endpoint
2462
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2463
+ # nil, indicating to use the default endpoint in the current universe domain.
2464
+ # @return [::String,nil]
2465
+ # @!attribute [rw] credentials
2466
+ # Credentials to send with calls. You may provide any of the following types:
2467
+ # * (`String`) The path to a service account key file in JSON format
2468
+ # * (`Hash`) A service account key as a Hash
2469
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2470
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2471
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2472
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2473
+ # * (`nil`) indicating no credentials
2474
+ # @return [::Object]
2475
+ # @!attribute [rw] scope
2476
+ # The OAuth scopes
2477
+ # @return [::Array<::String>]
2478
+ # @!attribute [rw] lib_name
2479
+ # The library name as recorded in instrumentation and logging
2480
+ # @return [::String]
2481
+ # @!attribute [rw] lib_version
2482
+ # The library version as recorded in instrumentation and logging
2483
+ # @return [::String]
2484
+ # @!attribute [rw] timeout
2485
+ # The call timeout in seconds.
2486
+ # @return [::Numeric]
2487
+ # @!attribute [rw] metadata
2488
+ # Additional headers to be sent with the call.
2489
+ # @return [::Hash{::Symbol=>::String}]
2490
+ # @!attribute [rw] retry_policy
2491
+ # The retry policy. The value is a hash with the following keys:
2492
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2493
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2494
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2495
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2496
+ # trigger a retry.
2497
+ # @return [::Hash]
2498
+ # @!attribute [rw] quota_project
2499
+ # A separate project against which to charge quota.
2500
+ # @return [::String]
2501
+ # @!attribute [rw] universe_domain
2502
+ # The universe domain within which to make requests. This determines the
2503
+ # default endpoint URL. The default value of nil uses the environment
2504
+ # universe (usually the default "googleapis.com" universe).
2505
+ # @return [::String,nil]
2506
+ #
2507
+ class Configuration
2508
+ extend ::Gapic::Config
2509
+
2510
+ # @private
2511
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2512
+ DEFAULT_ENDPOINT = "visionai.googleapis.com"
2513
+
2514
+ config_attr :endpoint, nil, ::String, nil
2515
+ config_attr :credentials, nil do |value|
2516
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2517
+ allowed.any? { |klass| klass === value }
2518
+ end
2519
+ config_attr :scope, nil, ::String, ::Array, nil
2520
+ config_attr :lib_name, nil, ::String, nil
2521
+ config_attr :lib_version, nil, ::String, nil
2522
+ config_attr :timeout, nil, ::Numeric, nil
2523
+ config_attr :metadata, nil, ::Hash, nil
2524
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2525
+ config_attr :quota_project, nil, ::String, nil
2526
+ config_attr :universe_domain, nil, ::String, nil
2527
+
2528
+ # @private
2529
+ def initialize parent_config = nil
2530
+ @parent_config = parent_config unless parent_config.nil?
2531
+
2532
+ yield self if block_given?
2533
+ end
2534
+
2535
+ ##
2536
+ # Configurations for individual RPCs
2537
+ # @return [Rpcs]
2538
+ #
2539
+ def rpcs
2540
+ @rpcs ||= begin
2541
+ parent_rpcs = nil
2542
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2543
+ Rpcs.new parent_rpcs
2544
+ end
2545
+ end
2546
+
2547
+ ##
2548
+ # Configuration RPC class for the StreamsService API.
2549
+ #
2550
+ # Includes fields providing the configuration for each RPC in this service.
2551
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2552
+ # the following configuration fields:
2553
+ #
2554
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2555
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2556
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2557
+ # include the following keys:
2558
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2559
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2560
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2561
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2562
+ # trigger a retry.
2563
+ #
2564
+ class Rpcs
2565
+ ##
2566
+ # RPC-specific configuration for `list_clusters`
2567
+ # @return [::Gapic::Config::Method]
2568
+ #
2569
+ attr_reader :list_clusters
2570
+ ##
2571
+ # RPC-specific configuration for `get_cluster`
2572
+ # @return [::Gapic::Config::Method]
2573
+ #
2574
+ attr_reader :get_cluster
2575
+ ##
2576
+ # RPC-specific configuration for `create_cluster`
2577
+ # @return [::Gapic::Config::Method]
2578
+ #
2579
+ attr_reader :create_cluster
2580
+ ##
2581
+ # RPC-specific configuration for `update_cluster`
2582
+ # @return [::Gapic::Config::Method]
2583
+ #
2584
+ attr_reader :update_cluster
2585
+ ##
2586
+ # RPC-specific configuration for `delete_cluster`
2587
+ # @return [::Gapic::Config::Method]
2588
+ #
2589
+ attr_reader :delete_cluster
2590
+ ##
2591
+ # RPC-specific configuration for `list_streams`
2592
+ # @return [::Gapic::Config::Method]
2593
+ #
2594
+ attr_reader :list_streams
2595
+ ##
2596
+ # RPC-specific configuration for `get_stream`
2597
+ # @return [::Gapic::Config::Method]
2598
+ #
2599
+ attr_reader :get_stream
2600
+ ##
2601
+ # RPC-specific configuration for `create_stream`
2602
+ # @return [::Gapic::Config::Method]
2603
+ #
2604
+ attr_reader :create_stream
2605
+ ##
2606
+ # RPC-specific configuration for `update_stream`
2607
+ # @return [::Gapic::Config::Method]
2608
+ #
2609
+ attr_reader :update_stream
2610
+ ##
2611
+ # RPC-specific configuration for `delete_stream`
2612
+ # @return [::Gapic::Config::Method]
2613
+ #
2614
+ attr_reader :delete_stream
2615
+ ##
2616
+ # RPC-specific configuration for `get_stream_thumbnail`
2617
+ # @return [::Gapic::Config::Method]
2618
+ #
2619
+ attr_reader :get_stream_thumbnail
2620
+ ##
2621
+ # RPC-specific configuration for `generate_stream_hls_token`
2622
+ # @return [::Gapic::Config::Method]
2623
+ #
2624
+ attr_reader :generate_stream_hls_token
2625
+ ##
2626
+ # RPC-specific configuration for `list_events`
2627
+ # @return [::Gapic::Config::Method]
2628
+ #
2629
+ attr_reader :list_events
2630
+ ##
2631
+ # RPC-specific configuration for `get_event`
2632
+ # @return [::Gapic::Config::Method]
2633
+ #
2634
+ attr_reader :get_event
2635
+ ##
2636
+ # RPC-specific configuration for `create_event`
2637
+ # @return [::Gapic::Config::Method]
2638
+ #
2639
+ attr_reader :create_event
2640
+ ##
2641
+ # RPC-specific configuration for `update_event`
2642
+ # @return [::Gapic::Config::Method]
2643
+ #
2644
+ attr_reader :update_event
2645
+ ##
2646
+ # RPC-specific configuration for `delete_event`
2647
+ # @return [::Gapic::Config::Method]
2648
+ #
2649
+ attr_reader :delete_event
2650
+ ##
2651
+ # RPC-specific configuration for `list_series`
2652
+ # @return [::Gapic::Config::Method]
2653
+ #
2654
+ attr_reader :list_series
2655
+ ##
2656
+ # RPC-specific configuration for `get_series`
2657
+ # @return [::Gapic::Config::Method]
2658
+ #
2659
+ attr_reader :get_series
2660
+ ##
2661
+ # RPC-specific configuration for `create_series`
2662
+ # @return [::Gapic::Config::Method]
2663
+ #
2664
+ attr_reader :create_series
2665
+ ##
2666
+ # RPC-specific configuration for `update_series`
2667
+ # @return [::Gapic::Config::Method]
2668
+ #
2669
+ attr_reader :update_series
2670
+ ##
2671
+ # RPC-specific configuration for `delete_series`
2672
+ # @return [::Gapic::Config::Method]
2673
+ #
2674
+ attr_reader :delete_series
2675
+ ##
2676
+ # RPC-specific configuration for `materialize_channel`
2677
+ # @return [::Gapic::Config::Method]
2678
+ #
2679
+ attr_reader :materialize_channel
2680
+
2681
+ # @private
2682
+ def initialize parent_rpcs = nil
2683
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
2684
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
2685
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
2686
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
2687
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
2688
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
2689
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
2690
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
2691
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
2692
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
2693
+ list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams
2694
+ @list_streams = ::Gapic::Config::Method.new list_streams_config
2695
+ get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream
2696
+ @get_stream = ::Gapic::Config::Method.new get_stream_config
2697
+ create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream
2698
+ @create_stream = ::Gapic::Config::Method.new create_stream_config
2699
+ update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream
2700
+ @update_stream = ::Gapic::Config::Method.new update_stream_config
2701
+ delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream
2702
+ @delete_stream = ::Gapic::Config::Method.new delete_stream_config
2703
+ get_stream_thumbnail_config = parent_rpcs.get_stream_thumbnail if parent_rpcs.respond_to? :get_stream_thumbnail
2704
+ @get_stream_thumbnail = ::Gapic::Config::Method.new get_stream_thumbnail_config
2705
+ generate_stream_hls_token_config = parent_rpcs.generate_stream_hls_token if parent_rpcs.respond_to? :generate_stream_hls_token
2706
+ @generate_stream_hls_token = ::Gapic::Config::Method.new generate_stream_hls_token_config
2707
+ list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events
2708
+ @list_events = ::Gapic::Config::Method.new list_events_config
2709
+ get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event
2710
+ @get_event = ::Gapic::Config::Method.new get_event_config
2711
+ create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event
2712
+ @create_event = ::Gapic::Config::Method.new create_event_config
2713
+ update_event_config = parent_rpcs.update_event if parent_rpcs.respond_to? :update_event
2714
+ @update_event = ::Gapic::Config::Method.new update_event_config
2715
+ delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event
2716
+ @delete_event = ::Gapic::Config::Method.new delete_event_config
2717
+ list_series_config = parent_rpcs.list_series if parent_rpcs.respond_to? :list_series
2718
+ @list_series = ::Gapic::Config::Method.new list_series_config
2719
+ get_series_config = parent_rpcs.get_series if parent_rpcs.respond_to? :get_series
2720
+ @get_series = ::Gapic::Config::Method.new get_series_config
2721
+ create_series_config = parent_rpcs.create_series if parent_rpcs.respond_to? :create_series
2722
+ @create_series = ::Gapic::Config::Method.new create_series_config
2723
+ update_series_config = parent_rpcs.update_series if parent_rpcs.respond_to? :update_series
2724
+ @update_series = ::Gapic::Config::Method.new update_series_config
2725
+ delete_series_config = parent_rpcs.delete_series if parent_rpcs.respond_to? :delete_series
2726
+ @delete_series = ::Gapic::Config::Method.new delete_series_config
2727
+ materialize_channel_config = parent_rpcs.materialize_channel if parent_rpcs.respond_to? :materialize_channel
2728
+ @materialize_channel = ::Gapic::Config::Method.new materialize_channel_config
2729
+
2730
+ yield self if block_given?
2731
+ end
2732
+ end
2733
+ end
2734
+ end
2735
+ end
2736
+ end
2737
+ end
2738
+ end
2739
+ end
2740
+ end