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,2220 @@
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/lva_service_pb"
21
+ require "google/cloud/vision_ai/v1/live_video_analytics/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 LiveVideoAnalytics
30
+ module Rest
31
+ ##
32
+ # REST client for the LiveVideoAnalytics service.
33
+ #
34
+ # Service describing handlers for resources. The service enables clients to run
35
+ # Live Video Analytics (LVA) on the streaming inputs.
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :live_video_analytics_stub
48
+
49
+ ##
50
+ # Configure the LiveVideoAnalytics Client class.
51
+ #
52
+ # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all LiveVideoAnalytics clients
58
+ # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Cloud", "VisionAI", "V1"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.timeout = 60.0
79
+ default_config.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.list_operators.timeout = 60.0
84
+
85
+ default_config.rpcs.get_operator.timeout = 60.0
86
+
87
+ default_config.rpcs.create_operator.timeout = 300.0
88
+
89
+ default_config.rpcs.update_operator.timeout = 60.0
90
+
91
+ default_config.rpcs.delete_operator.timeout = 60.0
92
+
93
+ default_config.rpcs.list_analyses.timeout = 60.0
94
+
95
+ default_config.rpcs.get_analysis.timeout = 60.0
96
+
97
+ default_config.rpcs.create_analysis.timeout = 300.0
98
+
99
+ default_config.rpcs.update_analysis.timeout = 60.0
100
+
101
+ default_config.rpcs.delete_analysis.timeout = 60.0
102
+
103
+ default_config
104
+ end
105
+ yield @configure if block_given?
106
+ @configure
107
+ end
108
+
109
+ ##
110
+ # Configure the LiveVideoAnalytics Client instance.
111
+ #
112
+ # The configuration is set to the derived mode, meaning that values can be changed,
113
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
114
+ # should be made on {Client.configure}.
115
+ #
116
+ # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration}
117
+ # for a description of the configuration fields.
118
+ #
119
+ # @yield [config] Configure the Client client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ # @return [Client::Configuration]
123
+ #
124
+ def configure
125
+ yield @config if block_given?
126
+ @config
127
+ end
128
+
129
+ ##
130
+ # The effective universe domain
131
+ #
132
+ # @return [String]
133
+ #
134
+ def universe_domain
135
+ @live_video_analytics_stub.universe_domain
136
+ end
137
+
138
+ ##
139
+ # Create a new LiveVideoAnalytics REST client object.
140
+ #
141
+ # @example
142
+ #
143
+ # # Create a client using the default configuration
144
+ # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
145
+ #
146
+ # # Create a client using a custom configuration
147
+ # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config|
148
+ # config.timeout = 10.0
149
+ # end
150
+ #
151
+ # @yield [config] Configure the LiveVideoAnalytics client.
152
+ # @yieldparam config [Client::Configuration]
153
+ #
154
+ def initialize
155
+ # Create the configuration object
156
+ @config = Configuration.new Client.configure
157
+
158
+ # Yield the configuration if needed
159
+ yield @config if block_given?
160
+
161
+ # Create credentials
162
+ credentials = @config.credentials
163
+ # Use self-signed JWT if the endpoint is unchanged from default,
164
+ # but only if the default endpoint does not have a region prefix.
165
+ enable_self_signed_jwt = @config.endpoint.nil? ||
166
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
167
+ !@config.endpoint.split(".").first.include?("-"))
168
+ credentials ||= Credentials.default scope: @config.scope,
169
+ enable_self_signed_jwt: enable_self_signed_jwt
170
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
171
+ credentials = Credentials.new credentials, scope: @config.scope
172
+ end
173
+
174
+ @quota_project_id = @config.quota_project
175
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
176
+
177
+ @operations_client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Operations.new do |config|
178
+ config.credentials = credentials
179
+ config.quota_project = @quota_project_id
180
+ config.endpoint = @config.endpoint
181
+ config.universe_domain = @config.universe_domain
182
+ end
183
+
184
+ @live_video_analytics_stub = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.new(
185
+ endpoint: @config.endpoint,
186
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
187
+ universe_domain: @config.universe_domain,
188
+ credentials: credentials
189
+ )
190
+
191
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
192
+ config.credentials = credentials
193
+ config.quota_project = @quota_project_id
194
+ config.endpoint = @live_video_analytics_stub.endpoint
195
+ config.universe_domain = @live_video_analytics_stub.universe_domain
196
+ end
197
+
198
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
199
+ config.credentials = credentials
200
+ config.quota_project = @quota_project_id
201
+ config.endpoint = @live_video_analytics_stub.endpoint
202
+ config.universe_domain = @live_video_analytics_stub.universe_domain
203
+ end
204
+ end
205
+
206
+ ##
207
+ # Get the associated client for long-running operations.
208
+ #
209
+ # @return [::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Operations]
210
+ #
211
+ attr_reader :operations_client
212
+
213
+ ##
214
+ # Get the associated client for mix-in of the Locations.
215
+ #
216
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
217
+ #
218
+ attr_reader :location_client
219
+
220
+ ##
221
+ # Get the associated client for mix-in of the IAMPolicy.
222
+ #
223
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
224
+ #
225
+ attr_reader :iam_policy_client
226
+
227
+ # Service calls
228
+
229
+ ##
230
+ # ListPublicOperators returns all the operators in public registry.
231
+ #
232
+ # @overload list_public_operators(request, options = nil)
233
+ # Pass arguments to `list_public_operators` via a request object, either of type
234
+ # {::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest} or an equivalent Hash.
235
+ #
236
+ # @param request [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Hash]
237
+ # A request object representing the call parameters. Required. To specify no
238
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
239
+ # @param options [::Gapic::CallOptions, ::Hash]
240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
241
+ #
242
+ # @overload list_public_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
243
+ # Pass arguments to `list_public_operators` via keyword arguments. Note that at
244
+ # least one keyword argument is required. To specify no parameters, or to keep all
245
+ # the default parameter values, pass an empty Hash as a request object (see above).
246
+ #
247
+ # @param parent [::String]
248
+ # Required. Parent value for ListPublicOperatorsRequest.
249
+ # @param page_size [::Integer]
250
+ # Requested page size. Server may return fewer items than requested.
251
+ # If unspecified, server will pick an appropriate default.
252
+ # @param page_token [::String]
253
+ # A token identifying a page of results the server should return.
254
+ # @param filter [::String]
255
+ # Filtering results.
256
+ # @param order_by [::String]
257
+ # Hint for how to order the results.
258
+ # @yield [result, operation] Access the result along with the TransportOperation object
259
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>]
260
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
261
+ #
262
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>]
263
+ #
264
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
265
+ #
266
+ # @example Basic example
267
+ # require "google/cloud/vision_ai/v1"
268
+ #
269
+ # # Create a client object. The client can be reused for multiple calls.
270
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
271
+ #
272
+ # # Create a request. To set request fields, pass in keyword arguments.
273
+ # request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new
274
+ #
275
+ # # Call the list_public_operators method.
276
+ # result = client.list_public_operators request
277
+ #
278
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
279
+ # # over elements, and API calls will be issued to fetch pages as needed.
280
+ # result.each do |item|
281
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Operator.
282
+ # p item
283
+ # end
284
+ #
285
+ def list_public_operators request, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request.nil?
287
+
288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest
289
+
290
+ # Converts hash and nil to an options object
291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
292
+
293
+ # Customize the options with defaults
294
+ call_metadata = @config.rpcs.list_public_operators.metadata.to_h
295
+
296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
299
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
300
+ transports_version_send: [:rest]
301
+
302
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
303
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
304
+
305
+ options.apply_defaults timeout: @config.rpcs.list_public_operators.timeout,
306
+ metadata: call_metadata,
307
+ retry_policy: @config.rpcs.list_public_operators.retry_policy
308
+
309
+ options.apply_defaults timeout: @config.timeout,
310
+ metadata: @config.metadata,
311
+ retry_policy: @config.retry_policy
312
+
313
+ @live_video_analytics_stub.list_public_operators request, options do |result, operation|
314
+ result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, "operators", request, result, options
315
+ yield result, operation if block_given?
316
+ return result
317
+ end
318
+ rescue ::Gapic::Rest::Error => e
319
+ raise ::Google::Cloud::Error.from_error(e)
320
+ end
321
+
322
+ ##
323
+ # ResolveOperatorInfo returns the operator information based on the request.
324
+ #
325
+ # @overload resolve_operator_info(request, options = nil)
326
+ # Pass arguments to `resolve_operator_info` via a request object, either of type
327
+ # {::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest} or an equivalent Hash.
328
+ #
329
+ # @param request [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Hash]
330
+ # A request object representing the call parameters. Required. To specify no
331
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
332
+ # @param options [::Gapic::CallOptions, ::Hash]
333
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
334
+ #
335
+ # @overload resolve_operator_info(parent: nil, queries: nil)
336
+ # Pass arguments to `resolve_operator_info` via keyword arguments. Note that at
337
+ # least one keyword argument is required. To specify no parameters, or to keep all
338
+ # the default parameter values, pass an empty Hash as a request object (see above).
339
+ #
340
+ # @param parent [::String]
341
+ # Required. Parent value for ResolveOperatorInfoRequest.
342
+ # @param queries [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery, ::Hash>]
343
+ # Required. The operator queries.
344
+ # @yield [result, operation] Access the result along with the TransportOperation object
345
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse]
346
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
347
+ #
348
+ # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse]
349
+ #
350
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
351
+ #
352
+ # @example Basic example
353
+ # require "google/cloud/vision_ai/v1"
354
+ #
355
+ # # Create a client object. The client can be reused for multiple calls.
356
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
357
+ #
358
+ # # Create a request. To set request fields, pass in keyword arguments.
359
+ # request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new
360
+ #
361
+ # # Call the resolve_operator_info method.
362
+ # result = client.resolve_operator_info request
363
+ #
364
+ # # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.
365
+ # p result
366
+ #
367
+ def resolve_operator_info request, options = nil
368
+ raise ::ArgumentError, "request must be provided" if request.nil?
369
+
370
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest
371
+
372
+ # Converts hash and nil to an options object
373
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
374
+
375
+ # Customize the options with defaults
376
+ call_metadata = @config.rpcs.resolve_operator_info.metadata.to_h
377
+
378
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
379
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
380
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
381
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
382
+ transports_version_send: [:rest]
383
+
384
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
385
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
386
+
387
+ options.apply_defaults timeout: @config.rpcs.resolve_operator_info.timeout,
388
+ metadata: call_metadata,
389
+ retry_policy: @config.rpcs.resolve_operator_info.retry_policy
390
+
391
+ options.apply_defaults timeout: @config.timeout,
392
+ metadata: @config.metadata,
393
+ retry_policy: @config.retry_policy
394
+
395
+ @live_video_analytics_stub.resolve_operator_info request, options do |result, operation|
396
+ yield result, operation if block_given?
397
+ return result
398
+ end
399
+ rescue ::Gapic::Rest::Error => e
400
+ raise ::Google::Cloud::Error.from_error(e)
401
+ end
402
+
403
+ ##
404
+ # Lists Operators in a given project and location.
405
+ #
406
+ # @overload list_operators(request, options = nil)
407
+ # Pass arguments to `list_operators` via a request object, either of type
408
+ # {::Google::Cloud::VisionAI::V1::ListOperatorsRequest} or an equivalent Hash.
409
+ #
410
+ # @param request [::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Hash]
411
+ # A request object representing the call parameters. Required. To specify no
412
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
413
+ # @param options [::Gapic::CallOptions, ::Hash]
414
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
415
+ #
416
+ # @overload list_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
417
+ # Pass arguments to `list_operators` via keyword arguments. Note that at
418
+ # least one keyword argument is required. To specify no parameters, or to keep all
419
+ # the default parameter values, pass an empty Hash as a request object (see above).
420
+ #
421
+ # @param parent [::String]
422
+ # Required. Parent value for ListOperatorsRequest.
423
+ # @param page_size [::Integer]
424
+ # Requested page size. Server may return fewer items than requested.
425
+ # If unspecified, server will pick an appropriate default.
426
+ # @param page_token [::String]
427
+ # A token identifying a page of results the server should return.
428
+ # @param filter [::String]
429
+ # Filtering results.
430
+ # @param order_by [::String]
431
+ # Hint for how to order the results.
432
+ # @yield [result, operation] Access the result along with the TransportOperation object
433
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListOperatorsResponse]
434
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
435
+ #
436
+ # @return [::Google::Cloud::VisionAI::V1::ListOperatorsResponse]
437
+ #
438
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
439
+ #
440
+ # @example Basic example
441
+ # require "google/cloud/vision_ai/v1"
442
+ #
443
+ # # Create a client object. The client can be reused for multiple calls.
444
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
445
+ #
446
+ # # Create a request. To set request fields, pass in keyword arguments.
447
+ # request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new
448
+ #
449
+ # # Call the list_operators method.
450
+ # result = client.list_operators request
451
+ #
452
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
453
+ # # over elements, and API calls will be issued to fetch pages as needed.
454
+ # result.each do |item|
455
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Operator.
456
+ # p item
457
+ # end
458
+ #
459
+ def list_operators request, options = nil
460
+ raise ::ArgumentError, "request must be provided" if request.nil?
461
+
462
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListOperatorsRequest
463
+
464
+ # Converts hash and nil to an options object
465
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
466
+
467
+ # Customize the options with defaults
468
+ call_metadata = @config.rpcs.list_operators.metadata.to_h
469
+
470
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
471
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
472
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
473
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
474
+ transports_version_send: [:rest]
475
+
476
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
+
479
+ options.apply_defaults timeout: @config.rpcs.list_operators.timeout,
480
+ metadata: call_metadata,
481
+ retry_policy: @config.rpcs.list_operators.retry_policy
482
+
483
+ options.apply_defaults timeout: @config.timeout,
484
+ metadata: @config.metadata,
485
+ retry_policy: @config.retry_policy
486
+
487
+ @live_video_analytics_stub.list_operators request, options do |result, operation|
488
+ yield result, operation if block_given?
489
+ return result
490
+ end
491
+ rescue ::Gapic::Rest::Error => e
492
+ raise ::Google::Cloud::Error.from_error(e)
493
+ end
494
+
495
+ ##
496
+ # Gets details of a single Operator.
497
+ #
498
+ # @overload get_operator(request, options = nil)
499
+ # Pass arguments to `get_operator` via a request object, either of type
500
+ # {::Google::Cloud::VisionAI::V1::GetOperatorRequest} or an equivalent Hash.
501
+ #
502
+ # @param request [::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Hash]
503
+ # A request object representing the call parameters. Required. To specify no
504
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
505
+ # @param options [::Gapic::CallOptions, ::Hash]
506
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
507
+ #
508
+ # @overload get_operator(name: nil)
509
+ # Pass arguments to `get_operator` via keyword arguments. Note that at
510
+ # least one keyword argument is required. To specify no parameters, or to keep all
511
+ # the default parameter values, pass an empty Hash as a request object (see above).
512
+ #
513
+ # @param name [::String]
514
+ # Required. Name of the resource.
515
+ # @yield [result, operation] Access the result along with the TransportOperation object
516
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Operator]
517
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
518
+ #
519
+ # @return [::Google::Cloud::VisionAI::V1::Operator]
520
+ #
521
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
522
+ #
523
+ # @example Basic example
524
+ # require "google/cloud/vision_ai/v1"
525
+ #
526
+ # # Create a client object. The client can be reused for multiple calls.
527
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
528
+ #
529
+ # # Create a request. To set request fields, pass in keyword arguments.
530
+ # request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new
531
+ #
532
+ # # Call the get_operator method.
533
+ # result = client.get_operator request
534
+ #
535
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Operator.
536
+ # p result
537
+ #
538
+ def get_operator request, options = nil
539
+ raise ::ArgumentError, "request must be provided" if request.nil?
540
+
541
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetOperatorRequest
542
+
543
+ # Converts hash and nil to an options object
544
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
545
+
546
+ # Customize the options with defaults
547
+ call_metadata = @config.rpcs.get_operator.metadata.to_h
548
+
549
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
550
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
551
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
552
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
553
+ transports_version_send: [:rest]
554
+
555
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
556
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
557
+
558
+ options.apply_defaults timeout: @config.rpcs.get_operator.timeout,
559
+ metadata: call_metadata,
560
+ retry_policy: @config.rpcs.get_operator.retry_policy
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata,
564
+ retry_policy: @config.retry_policy
565
+
566
+ @live_video_analytics_stub.get_operator request, options do |result, operation|
567
+ yield result, operation if block_given?
568
+ return result
569
+ end
570
+ rescue ::Gapic::Rest::Error => e
571
+ raise ::Google::Cloud::Error.from_error(e)
572
+ end
573
+
574
+ ##
575
+ # Creates a new Operator in a given project and location.
576
+ #
577
+ # @overload create_operator(request, options = nil)
578
+ # Pass arguments to `create_operator` via a request object, either of type
579
+ # {::Google::Cloud::VisionAI::V1::CreateOperatorRequest} or an equivalent Hash.
580
+ #
581
+ # @param request [::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Hash]
582
+ # A request object representing the call parameters. Required. To specify no
583
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
584
+ # @param options [::Gapic::CallOptions, ::Hash]
585
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
586
+ #
587
+ # @overload create_operator(parent: nil, operator_id: nil, operator: nil, request_id: nil)
588
+ # Pass arguments to `create_operator` via keyword arguments. Note that at
589
+ # least one keyword argument is required. To specify no parameters, or to keep all
590
+ # the default parameter values, pass an empty Hash as a request object (see above).
591
+ #
592
+ # @param parent [::String]
593
+ # Required. Value for parent.
594
+ # @param operator_id [::String]
595
+ # Required. Id of the requesting object.
596
+ # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash]
597
+ # Required. The resource being created.
598
+ # @param request_id [::String]
599
+ # Optional. An optional request ID to identify requests. Specify a unique
600
+ # request ID so that if you must retry your request, the server will know to
601
+ # ignore the request if it has already been completed. The server will
602
+ # guarantee that for at least 60 minutes since the first request.
603
+ #
604
+ # For example, consider a situation where you make an initial request and the
605
+ # request times out. If you make the request again with the same request ID,
606
+ # the server can check if original operation with the same request ID was
607
+ # received, and if so, will ignore the second request. This prevents clients
608
+ # from accidentally creating duplicate commitments.
609
+ #
610
+ # The request ID must be a valid UUID with the exception that zero UUID is
611
+ # not supported (00000000-0000-0000-0000-000000000000).
612
+ # @yield [result, operation] Access the result along with the TransportOperation object
613
+ # @yieldparam result [::Gapic::Operation]
614
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
615
+ #
616
+ # @return [::Gapic::Operation]
617
+ #
618
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
619
+ #
620
+ # @example Basic example
621
+ # require "google/cloud/vision_ai/v1"
622
+ #
623
+ # # Create a client object. The client can be reused for multiple calls.
624
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
625
+ #
626
+ # # Create a request. To set request fields, pass in keyword arguments.
627
+ # request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new
628
+ #
629
+ # # Call the create_operator method.
630
+ # result = client.create_operator request
631
+ #
632
+ # # The returned object is of type Gapic::Operation. You can use it to
633
+ # # check the status of an operation, cancel it, or wait for results.
634
+ # # Here is how to wait for a response.
635
+ # result.wait_until_done! timeout: 60
636
+ # if result.response?
637
+ # p result.response
638
+ # else
639
+ # puts "No response received."
640
+ # end
641
+ #
642
+ def create_operator request, options = nil
643
+ raise ::ArgumentError, "request must be provided" if request.nil?
644
+
645
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateOperatorRequest
646
+
647
+ # Converts hash and nil to an options object
648
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
649
+
650
+ # Customize the options with defaults
651
+ call_metadata = @config.rpcs.create_operator.metadata.to_h
652
+
653
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
654
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
655
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
656
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
657
+ transports_version_send: [:rest]
658
+
659
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
660
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
661
+
662
+ options.apply_defaults timeout: @config.rpcs.create_operator.timeout,
663
+ metadata: call_metadata,
664
+ retry_policy: @config.rpcs.create_operator.retry_policy
665
+
666
+ options.apply_defaults timeout: @config.timeout,
667
+ metadata: @config.metadata,
668
+ retry_policy: @config.retry_policy
669
+
670
+ @live_video_analytics_stub.create_operator request, options do |result, operation|
671
+ result = ::Gapic::Operation.new result, @operations_client, options: options
672
+ yield result, operation if block_given?
673
+ return result
674
+ end
675
+ rescue ::Gapic::Rest::Error => e
676
+ raise ::Google::Cloud::Error.from_error(e)
677
+ end
678
+
679
+ ##
680
+ # Updates the parameters of a single Operator.
681
+ #
682
+ # @overload update_operator(request, options = nil)
683
+ # Pass arguments to `update_operator` via a request object, either of type
684
+ # {::Google::Cloud::VisionAI::V1::UpdateOperatorRequest} or an equivalent Hash.
685
+ #
686
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Hash]
687
+ # A request object representing the call parameters. Required. To specify no
688
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
689
+ # @param options [::Gapic::CallOptions, ::Hash]
690
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
691
+ #
692
+ # @overload update_operator(update_mask: nil, operator: nil, request_id: nil)
693
+ # Pass arguments to `update_operator` via keyword arguments. Note that at
694
+ # least one keyword argument is required. To specify no parameters, or to keep all
695
+ # the default parameter values, pass an empty Hash as a request object (see above).
696
+ #
697
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
698
+ # Required. Field mask is used to specify the fields to be overwritten in the
699
+ # Operator resource by the update.
700
+ # The fields specified in the update_mask are relative to the resource, not
701
+ # the full request. A field will be overwritten if it is in the mask. If the
702
+ # user does not provide a mask then all fields will be overwritten.
703
+ # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash]
704
+ # Required. The resource being updated
705
+ # @param request_id [::String]
706
+ # Optional. An optional request ID to identify requests. Specify a unique
707
+ # request ID so that if you must retry your request, the server will know to
708
+ # ignore the request if it has already been completed. The server will
709
+ # guarantee that for at least 60 minutes since the first request.
710
+ #
711
+ # For example, consider a situation where you make an initial request and the
712
+ # request times out. If you make the request again with the same request ID,
713
+ # the server can check if original operation with the same request ID was
714
+ # received, and if so, will ignore the second request. This prevents clients
715
+ # from accidentally creating duplicate commitments.
716
+ #
717
+ # The request ID must be a valid UUID with the exception that zero UUID is
718
+ # not supported (00000000-0000-0000-0000-000000000000).
719
+ # @yield [result, operation] Access the result along with the TransportOperation object
720
+ # @yieldparam result [::Gapic::Operation]
721
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
722
+ #
723
+ # @return [::Gapic::Operation]
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::LiveVideoAnalytics::Rest::Client.new
732
+ #
733
+ # # Create a request. To set request fields, pass in keyword arguments.
734
+ # request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new
735
+ #
736
+ # # Call the update_operator method.
737
+ # result = client.update_operator request
738
+ #
739
+ # # The returned object is of type Gapic::Operation. You can use it to
740
+ # # check the status of an operation, cancel it, or wait for results.
741
+ # # Here is how to wait for a response.
742
+ # result.wait_until_done! timeout: 60
743
+ # if result.response?
744
+ # p result.response
745
+ # else
746
+ # puts "No response received."
747
+ # end
748
+ #
749
+ def update_operator request, options = nil
750
+ raise ::ArgumentError, "request must be provided" if request.nil?
751
+
752
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest
753
+
754
+ # Converts hash and nil to an options object
755
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
756
+
757
+ # Customize the options with defaults
758
+ call_metadata = @config.rpcs.update_operator.metadata.to_h
759
+
760
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
761
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
762
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
763
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
764
+ transports_version_send: [:rest]
765
+
766
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
767
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
768
+
769
+ options.apply_defaults timeout: @config.rpcs.update_operator.timeout,
770
+ metadata: call_metadata,
771
+ retry_policy: @config.rpcs.update_operator.retry_policy
772
+
773
+ options.apply_defaults timeout: @config.timeout,
774
+ metadata: @config.metadata,
775
+ retry_policy: @config.retry_policy
776
+
777
+ @live_video_analytics_stub.update_operator request, options do |result, operation|
778
+ result = ::Gapic::Operation.new result, @operations_client, options: options
779
+ yield result, operation if block_given?
780
+ return result
781
+ end
782
+ rescue ::Gapic::Rest::Error => e
783
+ raise ::Google::Cloud::Error.from_error(e)
784
+ end
785
+
786
+ ##
787
+ # Deletes a single Operator.
788
+ #
789
+ # @overload delete_operator(request, options = nil)
790
+ # Pass arguments to `delete_operator` via a request object, either of type
791
+ # {::Google::Cloud::VisionAI::V1::DeleteOperatorRequest} or an equivalent Hash.
792
+ #
793
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Hash]
794
+ # A request object representing the call parameters. Required. To specify no
795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
796
+ # @param options [::Gapic::CallOptions, ::Hash]
797
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
798
+ #
799
+ # @overload delete_operator(name: nil, request_id: nil)
800
+ # Pass arguments to `delete_operator` via keyword arguments. Note that at
801
+ # least one keyword argument is required. To specify no parameters, or to keep all
802
+ # the default parameter values, pass an empty Hash as a request object (see above).
803
+ #
804
+ # @param name [::String]
805
+ # Required. Name of the resource
806
+ # @param request_id [::String]
807
+ # Optional. An optional request ID to identify requests. Specify a unique
808
+ # request ID so that if you must retry your request, the server will know to
809
+ # ignore the request if it has already been completed. The server will
810
+ # guarantee that for at least 60 minutes after the first request.
811
+ #
812
+ # For example, consider a situation where you make an initial request and the
813
+ # request times out. If you make the request again with the same request ID,
814
+ # the server can check if original operation with the same request ID was
815
+ # received, and if so, will ignore the second request. This prevents clients
816
+ # from accidentally creating duplicate commitments.
817
+ #
818
+ # The request ID must be a valid UUID with the exception that zero UUID is
819
+ # not supported (00000000-0000-0000-0000-000000000000).
820
+ # @yield [result, operation] Access the result along with the TransportOperation object
821
+ # @yieldparam result [::Gapic::Operation]
822
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
823
+ #
824
+ # @return [::Gapic::Operation]
825
+ #
826
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
827
+ #
828
+ # @example Basic example
829
+ # require "google/cloud/vision_ai/v1"
830
+ #
831
+ # # Create a client object. The client can be reused for multiple calls.
832
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
833
+ #
834
+ # # Create a request. To set request fields, pass in keyword arguments.
835
+ # request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new
836
+ #
837
+ # # Call the delete_operator method.
838
+ # result = client.delete_operator request
839
+ #
840
+ # # The returned object is of type Gapic::Operation. You can use it to
841
+ # # check the status of an operation, cancel it, or wait for results.
842
+ # # Here is how to wait for a response.
843
+ # result.wait_until_done! timeout: 60
844
+ # if result.response?
845
+ # p result.response
846
+ # else
847
+ # puts "No response received."
848
+ # end
849
+ #
850
+ def delete_operator request, options = nil
851
+ raise ::ArgumentError, "request must be provided" if request.nil?
852
+
853
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest
854
+
855
+ # Converts hash and nil to an options object
856
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
857
+
858
+ # Customize the options with defaults
859
+ call_metadata = @config.rpcs.delete_operator.metadata.to_h
860
+
861
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
862
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
863
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
864
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
865
+ transports_version_send: [:rest]
866
+
867
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
868
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
869
+
870
+ options.apply_defaults timeout: @config.rpcs.delete_operator.timeout,
871
+ metadata: call_metadata,
872
+ retry_policy: @config.rpcs.delete_operator.retry_policy
873
+
874
+ options.apply_defaults timeout: @config.timeout,
875
+ metadata: @config.metadata,
876
+ retry_policy: @config.retry_policy
877
+
878
+ @live_video_analytics_stub.delete_operator request, options do |result, operation|
879
+ result = ::Gapic::Operation.new result, @operations_client, options: options
880
+ yield result, operation if block_given?
881
+ return result
882
+ end
883
+ rescue ::Gapic::Rest::Error => e
884
+ raise ::Google::Cloud::Error.from_error(e)
885
+ end
886
+
887
+ ##
888
+ # Lists Analyses in a given project and location.
889
+ #
890
+ # @overload list_analyses(request, options = nil)
891
+ # Pass arguments to `list_analyses` via a request object, either of type
892
+ # {::Google::Cloud::VisionAI::V1::ListAnalysesRequest} or an equivalent Hash.
893
+ #
894
+ # @param request [::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Hash]
895
+ # A request object representing the call parameters. Required. To specify no
896
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
897
+ # @param options [::Gapic::CallOptions, ::Hash]
898
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
899
+ #
900
+ # @overload list_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
901
+ # Pass arguments to `list_analyses` via keyword arguments. Note that at
902
+ # least one keyword argument is required. To specify no parameters, or to keep all
903
+ # the default parameter values, pass an empty Hash as a request object (see above).
904
+ #
905
+ # @param parent [::String]
906
+ # Required. Parent value for ListAnalysesRequest
907
+ # @param page_size [::Integer]
908
+ # Requested page size. Server may return fewer items than requested.
909
+ # If unspecified, server will pick an appropriate default.
910
+ # @param page_token [::String]
911
+ # A token identifying a page of results the server should return.
912
+ # @param filter [::String]
913
+ # Filtering results
914
+ # @param order_by [::String]
915
+ # Hint for how to order the results
916
+ # @yield [result, operation] Access the result along with the TransportOperation object
917
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListAnalysesResponse]
918
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
919
+ #
920
+ # @return [::Google::Cloud::VisionAI::V1::ListAnalysesResponse]
921
+ #
922
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
923
+ #
924
+ # @example Basic example
925
+ # require "google/cloud/vision_ai/v1"
926
+ #
927
+ # # Create a client object. The client can be reused for multiple calls.
928
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
929
+ #
930
+ # # Create a request. To set request fields, pass in keyword arguments.
931
+ # request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new
932
+ #
933
+ # # Call the list_analyses method.
934
+ # result = client.list_analyses request
935
+ #
936
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
937
+ # # over elements, and API calls will be issued to fetch pages as needed.
938
+ # result.each do |item|
939
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Analysis.
940
+ # p item
941
+ # end
942
+ #
943
+ def list_analyses request, options = nil
944
+ raise ::ArgumentError, "request must be provided" if request.nil?
945
+
946
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnalysesRequest
947
+
948
+ # Converts hash and nil to an options object
949
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
950
+
951
+ # Customize the options with defaults
952
+ call_metadata = @config.rpcs.list_analyses.metadata.to_h
953
+
954
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
955
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
956
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
957
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
958
+ transports_version_send: [:rest]
959
+
960
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
961
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
962
+
963
+ options.apply_defaults timeout: @config.rpcs.list_analyses.timeout,
964
+ metadata: call_metadata,
965
+ retry_policy: @config.rpcs.list_analyses.retry_policy
966
+
967
+ options.apply_defaults timeout: @config.timeout,
968
+ metadata: @config.metadata,
969
+ retry_policy: @config.retry_policy
970
+
971
+ @live_video_analytics_stub.list_analyses request, options do |result, operation|
972
+ yield result, operation if block_given?
973
+ return result
974
+ end
975
+ rescue ::Gapic::Rest::Error => e
976
+ raise ::Google::Cloud::Error.from_error(e)
977
+ end
978
+
979
+ ##
980
+ # Gets details of a single Analysis.
981
+ #
982
+ # @overload get_analysis(request, options = nil)
983
+ # Pass arguments to `get_analysis` via a request object, either of type
984
+ # {::Google::Cloud::VisionAI::V1::GetAnalysisRequest} or an equivalent Hash.
985
+ #
986
+ # @param request [::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Hash]
987
+ # A request object representing the call parameters. Required. To specify no
988
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
989
+ # @param options [::Gapic::CallOptions, ::Hash]
990
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
991
+ #
992
+ # @overload get_analysis(name: nil)
993
+ # Pass arguments to `get_analysis` via keyword arguments. Note that at
994
+ # least one keyword argument is required. To specify no parameters, or to keep all
995
+ # the default parameter values, pass an empty Hash as a request object (see above).
996
+ #
997
+ # @param name [::String]
998
+ # Required. Name of the resource.
999
+ # @yield [result, operation] Access the result along with the TransportOperation object
1000
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Analysis]
1001
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1002
+ #
1003
+ # @return [::Google::Cloud::VisionAI::V1::Analysis]
1004
+ #
1005
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1006
+ #
1007
+ # @example Basic example
1008
+ # require "google/cloud/vision_ai/v1"
1009
+ #
1010
+ # # Create a client object. The client can be reused for multiple calls.
1011
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1012
+ #
1013
+ # # Create a request. To set request fields, pass in keyword arguments.
1014
+ # request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new
1015
+ #
1016
+ # # Call the get_analysis method.
1017
+ # result = client.get_analysis request
1018
+ #
1019
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Analysis.
1020
+ # p result
1021
+ #
1022
+ def get_analysis request, options = nil
1023
+ raise ::ArgumentError, "request must be provided" if request.nil?
1024
+
1025
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnalysisRequest
1026
+
1027
+ # Converts hash and nil to an options object
1028
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1029
+
1030
+ # Customize the options with defaults
1031
+ call_metadata = @config.rpcs.get_analysis.metadata.to_h
1032
+
1033
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1034
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1035
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1036
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1037
+ transports_version_send: [:rest]
1038
+
1039
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1040
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1041
+
1042
+ options.apply_defaults timeout: @config.rpcs.get_analysis.timeout,
1043
+ metadata: call_metadata,
1044
+ retry_policy: @config.rpcs.get_analysis.retry_policy
1045
+
1046
+ options.apply_defaults timeout: @config.timeout,
1047
+ metadata: @config.metadata,
1048
+ retry_policy: @config.retry_policy
1049
+
1050
+ @live_video_analytics_stub.get_analysis request, options do |result, operation|
1051
+ yield result, operation if block_given?
1052
+ return result
1053
+ end
1054
+ rescue ::Gapic::Rest::Error => e
1055
+ raise ::Google::Cloud::Error.from_error(e)
1056
+ end
1057
+
1058
+ ##
1059
+ # Creates a new Analysis in a given project and location.
1060
+ #
1061
+ # @overload create_analysis(request, options = nil)
1062
+ # Pass arguments to `create_analysis` via a request object, either of type
1063
+ # {::Google::Cloud::VisionAI::V1::CreateAnalysisRequest} or an equivalent Hash.
1064
+ #
1065
+ # @param request [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Hash]
1066
+ # A request object representing the call parameters. Required. To specify no
1067
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1068
+ # @param options [::Gapic::CallOptions, ::Hash]
1069
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1070
+ #
1071
+ # @overload create_analysis(parent: nil, analysis_id: nil, analysis: nil, request_id: nil)
1072
+ # Pass arguments to `create_analysis` via keyword arguments. Note that at
1073
+ # least one keyword argument is required. To specify no parameters, or to keep all
1074
+ # the default parameter values, pass an empty Hash as a request object (see above).
1075
+ #
1076
+ # @param parent [::String]
1077
+ # Required. Value for parent.
1078
+ # @param analysis_id [::String]
1079
+ # Required. Id of the requesting object.
1080
+ # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash]
1081
+ # Required. The resource being created.
1082
+ # @param request_id [::String]
1083
+ # Optional. An optional request ID to identify requests. Specify a unique
1084
+ # request ID so that if you must retry your request, the server will know to
1085
+ # ignore the request if it has already been completed. The server will
1086
+ # guarantee that for at least 60 minutes since the first request.
1087
+ #
1088
+ # For example, consider a situation where you make an initial request and the
1089
+ # request times out. If you make the request again with the same request ID,
1090
+ # the server can check if original operation with the same request ID was
1091
+ # received, and if so, will ignore the second request. This prevents clients
1092
+ # from accidentally creating duplicate commitments.
1093
+ #
1094
+ # The request ID must be a valid UUID with the exception that zero UUID is
1095
+ # not supported (00000000-0000-0000-0000-000000000000).
1096
+ # @yield [result, operation] Access the result along with the TransportOperation object
1097
+ # @yieldparam result [::Gapic::Operation]
1098
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1099
+ #
1100
+ # @return [::Gapic::Operation]
1101
+ #
1102
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1103
+ #
1104
+ # @example Basic example
1105
+ # require "google/cloud/vision_ai/v1"
1106
+ #
1107
+ # # Create a client object. The client can be reused for multiple calls.
1108
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1109
+ #
1110
+ # # Create a request. To set request fields, pass in keyword arguments.
1111
+ # request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new
1112
+ #
1113
+ # # Call the create_analysis method.
1114
+ # result = client.create_analysis request
1115
+ #
1116
+ # # The returned object is of type Gapic::Operation. You can use it to
1117
+ # # check the status of an operation, cancel it, or wait for results.
1118
+ # # Here is how to wait for a response.
1119
+ # result.wait_until_done! timeout: 60
1120
+ # if result.response?
1121
+ # p result.response
1122
+ # else
1123
+ # puts "No response received."
1124
+ # end
1125
+ #
1126
+ def create_analysis request, options = nil
1127
+ raise ::ArgumentError, "request must be provided" if request.nil?
1128
+
1129
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest
1130
+
1131
+ # Converts hash and nil to an options object
1132
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1133
+
1134
+ # Customize the options with defaults
1135
+ call_metadata = @config.rpcs.create_analysis.metadata.to_h
1136
+
1137
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1138
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1139
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1140
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1141
+ transports_version_send: [:rest]
1142
+
1143
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1144
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1145
+
1146
+ options.apply_defaults timeout: @config.rpcs.create_analysis.timeout,
1147
+ metadata: call_metadata,
1148
+ retry_policy: @config.rpcs.create_analysis.retry_policy
1149
+
1150
+ options.apply_defaults timeout: @config.timeout,
1151
+ metadata: @config.metadata,
1152
+ retry_policy: @config.retry_policy
1153
+
1154
+ @live_video_analytics_stub.create_analysis request, options do |result, operation|
1155
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1156
+ yield result, operation if block_given?
1157
+ return result
1158
+ end
1159
+ rescue ::Gapic::Rest::Error => e
1160
+ raise ::Google::Cloud::Error.from_error(e)
1161
+ end
1162
+
1163
+ ##
1164
+ # Updates the parameters of a single Analysis.
1165
+ #
1166
+ # @overload update_analysis(request, options = nil)
1167
+ # Pass arguments to `update_analysis` via a request object, either of type
1168
+ # {::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest} or an equivalent Hash.
1169
+ #
1170
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Hash]
1171
+ # A request object representing the call parameters. Required. To specify no
1172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1173
+ # @param options [::Gapic::CallOptions, ::Hash]
1174
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1175
+ #
1176
+ # @overload update_analysis(update_mask: nil, analysis: nil, request_id: nil)
1177
+ # Pass arguments to `update_analysis` via keyword arguments. Note that at
1178
+ # least one keyword argument is required. To specify no parameters, or to keep all
1179
+ # the default parameter values, pass an empty Hash as a request object (see above).
1180
+ #
1181
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1182
+ # Required. Field mask is used to specify the fields to be overwritten in the
1183
+ # Analysis resource by the update.
1184
+ # The fields specified in the update_mask are relative to the resource, not
1185
+ # the full request. A field will be overwritten if it is in the mask. If the
1186
+ # user does not provide a mask then all fields will be overwritten.
1187
+ # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash]
1188
+ # Required. The resource being updated.
1189
+ # @param request_id [::String]
1190
+ # Optional. An optional request ID to identify requests. Specify a unique
1191
+ # request ID so that if you must retry your request, the server will know to
1192
+ # ignore the request if it has already been completed. The server will
1193
+ # guarantee that for at least 60 minutes since the first request.
1194
+ #
1195
+ # For example, consider a situation where you make an initial request and the
1196
+ # request times out. If you make the request again with the same request ID,
1197
+ # the server can check if original operation with the same request ID was
1198
+ # received, and if so, will ignore the second request. This prevents clients
1199
+ # from accidentally creating duplicate commitments.
1200
+ #
1201
+ # The request ID must be a valid UUID with the exception that zero UUID is
1202
+ # not supported (00000000-0000-0000-0000-000000000000).
1203
+ # @yield [result, operation] Access the result along with the TransportOperation object
1204
+ # @yieldparam result [::Gapic::Operation]
1205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1206
+ #
1207
+ # @return [::Gapic::Operation]
1208
+ #
1209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1210
+ #
1211
+ # @example Basic example
1212
+ # require "google/cloud/vision_ai/v1"
1213
+ #
1214
+ # # Create a client object. The client can be reused for multiple calls.
1215
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1216
+ #
1217
+ # # Create a request. To set request fields, pass in keyword arguments.
1218
+ # request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new
1219
+ #
1220
+ # # Call the update_analysis method.
1221
+ # result = client.update_analysis request
1222
+ #
1223
+ # # The returned object is of type Gapic::Operation. You can use it to
1224
+ # # check the status of an operation, cancel it, or wait for results.
1225
+ # # Here is how to wait for a response.
1226
+ # result.wait_until_done! timeout: 60
1227
+ # if result.response?
1228
+ # p result.response
1229
+ # else
1230
+ # puts "No response received."
1231
+ # end
1232
+ #
1233
+ def update_analysis request, options = nil
1234
+ raise ::ArgumentError, "request must be provided" if request.nil?
1235
+
1236
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest
1237
+
1238
+ # Converts hash and nil to an options object
1239
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1240
+
1241
+ # Customize the options with defaults
1242
+ call_metadata = @config.rpcs.update_analysis.metadata.to_h
1243
+
1244
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1245
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1246
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1247
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1248
+ transports_version_send: [:rest]
1249
+
1250
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1251
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1252
+
1253
+ options.apply_defaults timeout: @config.rpcs.update_analysis.timeout,
1254
+ metadata: call_metadata,
1255
+ retry_policy: @config.rpcs.update_analysis.retry_policy
1256
+
1257
+ options.apply_defaults timeout: @config.timeout,
1258
+ metadata: @config.metadata,
1259
+ retry_policy: @config.retry_policy
1260
+
1261
+ @live_video_analytics_stub.update_analysis request, options do |result, operation|
1262
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1263
+ yield result, operation if block_given?
1264
+ return result
1265
+ end
1266
+ rescue ::Gapic::Rest::Error => e
1267
+ raise ::Google::Cloud::Error.from_error(e)
1268
+ end
1269
+
1270
+ ##
1271
+ # Deletes a single Analysis.
1272
+ #
1273
+ # @overload delete_analysis(request, options = nil)
1274
+ # Pass arguments to `delete_analysis` via a request object, either of type
1275
+ # {::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest} or an equivalent Hash.
1276
+ #
1277
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Hash]
1278
+ # A request object representing the call parameters. Required. To specify no
1279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1280
+ # @param options [::Gapic::CallOptions, ::Hash]
1281
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1282
+ #
1283
+ # @overload delete_analysis(name: nil, request_id: nil)
1284
+ # Pass arguments to `delete_analysis` via keyword arguments. Note that at
1285
+ # least one keyword argument is required. To specify no parameters, or to keep all
1286
+ # the default parameter values, pass an empty Hash as a request object (see above).
1287
+ #
1288
+ # @param name [::String]
1289
+ # Required. Name of the resource.
1290
+ # @param request_id [::String]
1291
+ # Optional. An optional request ID to identify requests. Specify a unique
1292
+ # request ID so that if you must retry your request, the server will know to
1293
+ # ignore the request if it has already been completed. The server will
1294
+ # guarantee that for at least 60 minutes after the first request.
1295
+ #
1296
+ # For example, consider a situation where you make an initial request and the
1297
+ # request times out. If you make the request again with the same request ID,
1298
+ # the server can check if original operation with the same request ID was
1299
+ # received, and if so, will ignore the second request. This prevents clients
1300
+ # from accidentally creating duplicate commitments.
1301
+ #
1302
+ # The request ID must be a valid UUID with the exception that zero UUID is
1303
+ # not supported (00000000-0000-0000-0000-000000000000).
1304
+ # @yield [result, operation] Access the result along with the TransportOperation object
1305
+ # @yieldparam result [::Gapic::Operation]
1306
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1307
+ #
1308
+ # @return [::Gapic::Operation]
1309
+ #
1310
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1311
+ #
1312
+ # @example Basic example
1313
+ # require "google/cloud/vision_ai/v1"
1314
+ #
1315
+ # # Create a client object. The client can be reused for multiple calls.
1316
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1317
+ #
1318
+ # # Create a request. To set request fields, pass in keyword arguments.
1319
+ # request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new
1320
+ #
1321
+ # # Call the delete_analysis method.
1322
+ # result = client.delete_analysis request
1323
+ #
1324
+ # # The returned object is of type Gapic::Operation. You can use it to
1325
+ # # check the status of an operation, cancel it, or wait for results.
1326
+ # # Here is how to wait for a response.
1327
+ # result.wait_until_done! timeout: 60
1328
+ # if result.response?
1329
+ # p result.response
1330
+ # else
1331
+ # puts "No response received."
1332
+ # end
1333
+ #
1334
+ def delete_analysis request, options = nil
1335
+ raise ::ArgumentError, "request must be provided" if request.nil?
1336
+
1337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest
1338
+
1339
+ # Converts hash and nil to an options object
1340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1341
+
1342
+ # Customize the options with defaults
1343
+ call_metadata = @config.rpcs.delete_analysis.metadata.to_h
1344
+
1345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1348
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1349
+ transports_version_send: [:rest]
1350
+
1351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1353
+
1354
+ options.apply_defaults timeout: @config.rpcs.delete_analysis.timeout,
1355
+ metadata: call_metadata,
1356
+ retry_policy: @config.rpcs.delete_analysis.retry_policy
1357
+
1358
+ options.apply_defaults timeout: @config.timeout,
1359
+ metadata: @config.metadata,
1360
+ retry_policy: @config.retry_policy
1361
+
1362
+ @live_video_analytics_stub.delete_analysis request, options do |result, operation|
1363
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1364
+ yield result, operation if block_given?
1365
+ return result
1366
+ end
1367
+ rescue ::Gapic::Rest::Error => e
1368
+ raise ::Google::Cloud::Error.from_error(e)
1369
+ end
1370
+
1371
+ ##
1372
+ # Lists Processes in a given project and location.
1373
+ #
1374
+ # @overload list_processes(request, options = nil)
1375
+ # Pass arguments to `list_processes` via a request object, either of type
1376
+ # {::Google::Cloud::VisionAI::V1::ListProcessesRequest} or an equivalent Hash.
1377
+ #
1378
+ # @param request [::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Hash]
1379
+ # A request object representing the call parameters. Required. To specify no
1380
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1381
+ # @param options [::Gapic::CallOptions, ::Hash]
1382
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1383
+ #
1384
+ # @overload list_processes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1385
+ # Pass arguments to `list_processes` via keyword arguments. Note that at
1386
+ # least one keyword argument is required. To specify no parameters, or to keep all
1387
+ # the default parameter values, pass an empty Hash as a request object (see above).
1388
+ #
1389
+ # @param parent [::String]
1390
+ # Required. Parent value for ListProcessesRequest.
1391
+ # @param page_size [::Integer]
1392
+ # Requested page size. Server may return fewer items than requested.
1393
+ # If unspecified, server will pick an appropriate default.
1394
+ # @param page_token [::String]
1395
+ # A token identifying a page of results the server should return.
1396
+ # @param filter [::String]
1397
+ # Filtering results
1398
+ # @param order_by [::String]
1399
+ # Hint for how to order the results
1400
+ # @yield [result, operation] Access the result along with the TransportOperation object
1401
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListProcessesResponse]
1402
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1403
+ #
1404
+ # @return [::Google::Cloud::VisionAI::V1::ListProcessesResponse]
1405
+ #
1406
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1407
+ #
1408
+ # @example Basic example
1409
+ # require "google/cloud/vision_ai/v1"
1410
+ #
1411
+ # # Create a client object. The client can be reused for multiple calls.
1412
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1413
+ #
1414
+ # # Create a request. To set request fields, pass in keyword arguments.
1415
+ # request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new
1416
+ #
1417
+ # # Call the list_processes method.
1418
+ # result = client.list_processes request
1419
+ #
1420
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1421
+ # # over elements, and API calls will be issued to fetch pages as needed.
1422
+ # result.each do |item|
1423
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Process.
1424
+ # p item
1425
+ # end
1426
+ #
1427
+ def list_processes request, options = nil
1428
+ raise ::ArgumentError, "request must be provided" if request.nil?
1429
+
1430
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessesRequest
1431
+
1432
+ # Converts hash and nil to an options object
1433
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1434
+
1435
+ # Customize the options with defaults
1436
+ call_metadata = @config.rpcs.list_processes.metadata.to_h
1437
+
1438
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1439
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1440
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1441
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1442
+ transports_version_send: [:rest]
1443
+
1444
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1445
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1446
+
1447
+ options.apply_defaults timeout: @config.rpcs.list_processes.timeout,
1448
+ metadata: call_metadata,
1449
+ retry_policy: @config.rpcs.list_processes.retry_policy
1450
+
1451
+ options.apply_defaults timeout: @config.timeout,
1452
+ metadata: @config.metadata,
1453
+ retry_policy: @config.retry_policy
1454
+
1455
+ @live_video_analytics_stub.list_processes request, options do |result, operation|
1456
+ yield result, operation if block_given?
1457
+ return result
1458
+ end
1459
+ rescue ::Gapic::Rest::Error => e
1460
+ raise ::Google::Cloud::Error.from_error(e)
1461
+ end
1462
+
1463
+ ##
1464
+ # Gets details of a single Process.
1465
+ #
1466
+ # @overload get_process(request, options = nil)
1467
+ # Pass arguments to `get_process` via a request object, either of type
1468
+ # {::Google::Cloud::VisionAI::V1::GetProcessRequest} or an equivalent Hash.
1469
+ #
1470
+ # @param request [::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Hash]
1471
+ # A request object representing the call parameters. Required. To specify no
1472
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1473
+ # @param options [::Gapic::CallOptions, ::Hash]
1474
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1475
+ #
1476
+ # @overload get_process(name: nil)
1477
+ # Pass arguments to `get_process` via keyword arguments. Note that at
1478
+ # least one keyword argument is required. To specify no parameters, or to keep all
1479
+ # the default parameter values, pass an empty Hash as a request object (see above).
1480
+ #
1481
+ # @param name [::String]
1482
+ # Required. Name of the resource.
1483
+ # @yield [result, operation] Access the result along with the TransportOperation object
1484
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Process]
1485
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1486
+ #
1487
+ # @return [::Google::Cloud::VisionAI::V1::Process]
1488
+ #
1489
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1490
+ #
1491
+ # @example Basic example
1492
+ # require "google/cloud/vision_ai/v1"
1493
+ #
1494
+ # # Create a client object. The client can be reused for multiple calls.
1495
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1496
+ #
1497
+ # # Create a request. To set request fields, pass in keyword arguments.
1498
+ # request = Google::Cloud::VisionAI::V1::GetProcessRequest.new
1499
+ #
1500
+ # # Call the get_process method.
1501
+ # result = client.get_process request
1502
+ #
1503
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Process.
1504
+ # p result
1505
+ #
1506
+ def get_process request, options = nil
1507
+ raise ::ArgumentError, "request must be provided" if request.nil?
1508
+
1509
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessRequest
1510
+
1511
+ # Converts hash and nil to an options object
1512
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1513
+
1514
+ # Customize the options with defaults
1515
+ call_metadata = @config.rpcs.get_process.metadata.to_h
1516
+
1517
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1518
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1519
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1520
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1521
+ transports_version_send: [:rest]
1522
+
1523
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1524
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1525
+
1526
+ options.apply_defaults timeout: @config.rpcs.get_process.timeout,
1527
+ metadata: call_metadata,
1528
+ retry_policy: @config.rpcs.get_process.retry_policy
1529
+
1530
+ options.apply_defaults timeout: @config.timeout,
1531
+ metadata: @config.metadata,
1532
+ retry_policy: @config.retry_policy
1533
+
1534
+ @live_video_analytics_stub.get_process request, options do |result, operation|
1535
+ yield result, operation if block_given?
1536
+ return result
1537
+ end
1538
+ rescue ::Gapic::Rest::Error => e
1539
+ raise ::Google::Cloud::Error.from_error(e)
1540
+ end
1541
+
1542
+ ##
1543
+ # Creates a new Process in a given project and location.
1544
+ #
1545
+ # @overload create_process(request, options = nil)
1546
+ # Pass arguments to `create_process` via a request object, either of type
1547
+ # {::Google::Cloud::VisionAI::V1::CreateProcessRequest} or an equivalent Hash.
1548
+ #
1549
+ # @param request [::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash]
1550
+ # A request object representing the call parameters. Required. To specify no
1551
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1552
+ # @param options [::Gapic::CallOptions, ::Hash]
1553
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1554
+ #
1555
+ # @overload create_process(parent: nil, process_id: nil, process: nil, request_id: nil)
1556
+ # Pass arguments to `create_process` via keyword arguments. Note that at
1557
+ # least one keyword argument is required. To specify no parameters, or to keep all
1558
+ # the default parameter values, pass an empty Hash as a request object (see above).
1559
+ #
1560
+ # @param parent [::String]
1561
+ # Required. Value for parent.
1562
+ # @param process_id [::String]
1563
+ # Required. Id of the requesting object.
1564
+ # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash]
1565
+ # Required. The resource being created.
1566
+ # @param request_id [::String]
1567
+ # Optional. An optional request ID to identify requests. Specify a unique
1568
+ # request ID so that if you must retry your request, the server will know to
1569
+ # ignore the request if it has already been completed. The server will
1570
+ # guarantee that for at least 60 minutes since the first request.
1571
+ #
1572
+ # For example, consider a situation where you make an initial request and the
1573
+ # request times out. If you make the request again with the same request ID,
1574
+ # the server can check if original operation with the same request ID was
1575
+ # received, and if so, will ignore the second request. This prevents clients
1576
+ # from accidentally creating duplicate commitments.
1577
+ #
1578
+ # The request ID must be a valid UUID with the exception that zero UUID is
1579
+ # not supported (00000000-0000-0000-0000-000000000000).
1580
+ # @yield [result, operation] Access the result along with the TransportOperation object
1581
+ # @yieldparam result [::Gapic::Operation]
1582
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1583
+ #
1584
+ # @return [::Gapic::Operation]
1585
+ #
1586
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1587
+ #
1588
+ # @example Basic example
1589
+ # require "google/cloud/vision_ai/v1"
1590
+ #
1591
+ # # Create a client object. The client can be reused for multiple calls.
1592
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1593
+ #
1594
+ # # Create a request. To set request fields, pass in keyword arguments.
1595
+ # request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new
1596
+ #
1597
+ # # Call the create_process method.
1598
+ # result = client.create_process request
1599
+ #
1600
+ # # The returned object is of type Gapic::Operation. You can use it to
1601
+ # # check the status of an operation, cancel it, or wait for results.
1602
+ # # Here is how to wait for a response.
1603
+ # result.wait_until_done! timeout: 60
1604
+ # if result.response?
1605
+ # p result.response
1606
+ # else
1607
+ # puts "No response received."
1608
+ # end
1609
+ #
1610
+ def create_process request, options = nil
1611
+ raise ::ArgumentError, "request must be provided" if request.nil?
1612
+
1613
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessRequest
1614
+
1615
+ # Converts hash and nil to an options object
1616
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1617
+
1618
+ # Customize the options with defaults
1619
+ call_metadata = @config.rpcs.create_process.metadata.to_h
1620
+
1621
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1622
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1623
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1624
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1625
+ transports_version_send: [:rest]
1626
+
1627
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1628
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1629
+
1630
+ options.apply_defaults timeout: @config.rpcs.create_process.timeout,
1631
+ metadata: call_metadata,
1632
+ retry_policy: @config.rpcs.create_process.retry_policy
1633
+
1634
+ options.apply_defaults timeout: @config.timeout,
1635
+ metadata: @config.metadata,
1636
+ retry_policy: @config.retry_policy
1637
+
1638
+ @live_video_analytics_stub.create_process request, options do |result, operation|
1639
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1640
+ yield result, operation if block_given?
1641
+ return result
1642
+ end
1643
+ rescue ::Gapic::Rest::Error => e
1644
+ raise ::Google::Cloud::Error.from_error(e)
1645
+ end
1646
+
1647
+ ##
1648
+ # Updates the parameters of a single Process.
1649
+ #
1650
+ # @overload update_process(request, options = nil)
1651
+ # Pass arguments to `update_process` via a request object, either of type
1652
+ # {::Google::Cloud::VisionAI::V1::UpdateProcessRequest} or an equivalent Hash.
1653
+ #
1654
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Hash]
1655
+ # A request object representing the call parameters. Required. To specify no
1656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1657
+ # @param options [::Gapic::CallOptions, ::Hash]
1658
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1659
+ #
1660
+ # @overload update_process(update_mask: nil, process: nil, request_id: nil)
1661
+ # Pass arguments to `update_process` via keyword arguments. Note that at
1662
+ # least one keyword argument is required. To specify no parameters, or to keep all
1663
+ # the default parameter values, pass an empty Hash as a request object (see above).
1664
+ #
1665
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1666
+ # Required. Field mask is used to specify the fields to be overwritten in the
1667
+ # Process resource by the update.
1668
+ # The fields specified in the update_mask are relative to the resource, not
1669
+ # the full request. A field will be overwritten if it is in the mask. If the
1670
+ # user does not provide a mask then all fields will be overwritten.
1671
+ # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash]
1672
+ # Required. The resource being updated.
1673
+ # @param request_id [::String]
1674
+ # Optional. An optional request ID to identify requests. Specify a unique
1675
+ # request ID so that if you must retry your request, the server will know to
1676
+ # ignore the request if it has already been completed. The server will
1677
+ # guarantee that for at least 60 minutes since the first request.
1678
+ #
1679
+ # For example, consider a situation where you make an initial request and the
1680
+ # request times out. If you make the request again with the same request ID,
1681
+ # the server can check if original operation with the same request ID was
1682
+ # received, and if so, will ignore the second request. This prevents clients
1683
+ # from accidentally creating duplicate commitments.
1684
+ #
1685
+ # The request ID must be a valid UUID with the exception that zero UUID is
1686
+ # not supported (00000000-0000-0000-0000-000000000000).
1687
+ # @yield [result, operation] Access the result along with the TransportOperation object
1688
+ # @yieldparam result [::Gapic::Operation]
1689
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1690
+ #
1691
+ # @return [::Gapic::Operation]
1692
+ #
1693
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1694
+ #
1695
+ # @example Basic example
1696
+ # require "google/cloud/vision_ai/v1"
1697
+ #
1698
+ # # Create a client object. The client can be reused for multiple calls.
1699
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1700
+ #
1701
+ # # Create a request. To set request fields, pass in keyword arguments.
1702
+ # request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new
1703
+ #
1704
+ # # Call the update_process method.
1705
+ # result = client.update_process request
1706
+ #
1707
+ # # The returned object is of type Gapic::Operation. You can use it to
1708
+ # # check the status of an operation, cancel it, or wait for results.
1709
+ # # Here is how to wait for a response.
1710
+ # result.wait_until_done! timeout: 60
1711
+ # if result.response?
1712
+ # p result.response
1713
+ # else
1714
+ # puts "No response received."
1715
+ # end
1716
+ #
1717
+ def update_process request, options = nil
1718
+ raise ::ArgumentError, "request must be provided" if request.nil?
1719
+
1720
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessRequest
1721
+
1722
+ # Converts hash and nil to an options object
1723
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1724
+
1725
+ # Customize the options with defaults
1726
+ call_metadata = @config.rpcs.update_process.metadata.to_h
1727
+
1728
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1729
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1730
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1731
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1732
+ transports_version_send: [:rest]
1733
+
1734
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1735
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1736
+
1737
+ options.apply_defaults timeout: @config.rpcs.update_process.timeout,
1738
+ metadata: call_metadata,
1739
+ retry_policy: @config.rpcs.update_process.retry_policy
1740
+
1741
+ options.apply_defaults timeout: @config.timeout,
1742
+ metadata: @config.metadata,
1743
+ retry_policy: @config.retry_policy
1744
+
1745
+ @live_video_analytics_stub.update_process request, options do |result, operation|
1746
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1747
+ yield result, operation if block_given?
1748
+ return result
1749
+ end
1750
+ rescue ::Gapic::Rest::Error => e
1751
+ raise ::Google::Cloud::Error.from_error(e)
1752
+ end
1753
+
1754
+ ##
1755
+ # Deletes a single Process.
1756
+ #
1757
+ # @overload delete_process(request, options = nil)
1758
+ # Pass arguments to `delete_process` via a request object, either of type
1759
+ # {::Google::Cloud::VisionAI::V1::DeleteProcessRequest} or an equivalent Hash.
1760
+ #
1761
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Hash]
1762
+ # A request object representing the call parameters. Required. To specify no
1763
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1764
+ # @param options [::Gapic::CallOptions, ::Hash]
1765
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1766
+ #
1767
+ # @overload delete_process(name: nil, request_id: nil)
1768
+ # Pass arguments to `delete_process` via keyword arguments. Note that at
1769
+ # least one keyword argument is required. To specify no parameters, or to keep all
1770
+ # the default parameter values, pass an empty Hash as a request object (see above).
1771
+ #
1772
+ # @param name [::String]
1773
+ # Required. Name of the resource.
1774
+ # @param request_id [::String]
1775
+ # Optional. An optional request ID to identify requests. Specify a unique
1776
+ # request ID so that if you must retry your request, the server will know to
1777
+ # ignore the request if it has already been completed. The server will
1778
+ # guarantee that for at least 60 minutes after the first request.
1779
+ #
1780
+ # For example, consider a situation where you make an initial request and the
1781
+ # request times out. If you make the request again with the same request ID,
1782
+ # the server can check if original operation with the same request ID was
1783
+ # received, and if so, will ignore the second request. This prevents clients
1784
+ # from accidentally creating duplicate commitments.
1785
+ #
1786
+ # The request ID must be a valid UUID with the exception that zero UUID is
1787
+ # not supported (00000000-0000-0000-0000-000000000000).
1788
+ # @yield [result, operation] Access the result along with the TransportOperation object
1789
+ # @yieldparam result [::Gapic::Operation]
1790
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1791
+ #
1792
+ # @return [::Gapic::Operation]
1793
+ #
1794
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1795
+ #
1796
+ # @example Basic example
1797
+ # require "google/cloud/vision_ai/v1"
1798
+ #
1799
+ # # Create a client object. The client can be reused for multiple calls.
1800
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1801
+ #
1802
+ # # Create a request. To set request fields, pass in keyword arguments.
1803
+ # request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new
1804
+ #
1805
+ # # Call the delete_process method.
1806
+ # result = client.delete_process request
1807
+ #
1808
+ # # The returned object is of type Gapic::Operation. You can use it to
1809
+ # # check the status of an operation, cancel it, or wait for results.
1810
+ # # Here is how to wait for a response.
1811
+ # result.wait_until_done! timeout: 60
1812
+ # if result.response?
1813
+ # p result.response
1814
+ # else
1815
+ # puts "No response received."
1816
+ # end
1817
+ #
1818
+ def delete_process request, options = nil
1819
+ raise ::ArgumentError, "request must be provided" if request.nil?
1820
+
1821
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessRequest
1822
+
1823
+ # Converts hash and nil to an options object
1824
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1825
+
1826
+ # Customize the options with defaults
1827
+ call_metadata = @config.rpcs.delete_process.metadata.to_h
1828
+
1829
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1830
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1831
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1832
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1833
+ transports_version_send: [:rest]
1834
+
1835
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1836
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1837
+
1838
+ options.apply_defaults timeout: @config.rpcs.delete_process.timeout,
1839
+ metadata: call_metadata,
1840
+ retry_policy: @config.rpcs.delete_process.retry_policy
1841
+
1842
+ options.apply_defaults timeout: @config.timeout,
1843
+ metadata: @config.metadata,
1844
+ retry_policy: @config.retry_policy
1845
+
1846
+ @live_video_analytics_stub.delete_process request, options do |result, operation|
1847
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1848
+ yield result, operation if block_given?
1849
+ return result
1850
+ end
1851
+ rescue ::Gapic::Rest::Error => e
1852
+ raise ::Google::Cloud::Error.from_error(e)
1853
+ end
1854
+
1855
+ ##
1856
+ # Run all of the processes to "completion". Max time for each process is
1857
+ # the LRO time limit.
1858
+ #
1859
+ # @overload batch_run_process(request, options = nil)
1860
+ # Pass arguments to `batch_run_process` via a request object, either of type
1861
+ # {::Google::Cloud::VisionAI::V1::BatchRunProcessRequest} or an equivalent Hash.
1862
+ #
1863
+ # @param request [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Hash]
1864
+ # A request object representing the call parameters. Required. To specify no
1865
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1866
+ # @param options [::Gapic::CallOptions, ::Hash]
1867
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1868
+ #
1869
+ # @overload batch_run_process(parent: nil, requests: nil, options: nil)
1870
+ # Pass arguments to `batch_run_process` via keyword arguments. Note that at
1871
+ # least one keyword argument is required. To specify no parameters, or to keep all
1872
+ # the default parameter values, pass an empty Hash as a request object (see above).
1873
+ #
1874
+ # @param parent [::String]
1875
+ # Required. The parent resource shared by all processes being created.
1876
+ # @param requests [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash>]
1877
+ # Required. The create process requests.
1878
+ # @param options [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions, ::Hash]
1879
+ # Optional. Options for batch processes.
1880
+ # @yield [result, operation] Access the result along with the TransportOperation object
1881
+ # @yieldparam result [::Gapic::Operation]
1882
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1883
+ #
1884
+ # @return [::Gapic::Operation]
1885
+ #
1886
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1887
+ #
1888
+ # @example Basic example
1889
+ # require "google/cloud/vision_ai/v1"
1890
+ #
1891
+ # # Create a client object. The client can be reused for multiple calls.
1892
+ # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new
1893
+ #
1894
+ # # Create a request. To set request fields, pass in keyword arguments.
1895
+ # request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new
1896
+ #
1897
+ # # Call the batch_run_process method.
1898
+ # result = client.batch_run_process request
1899
+ #
1900
+ # # The returned object is of type Gapic::Operation. You can use it to
1901
+ # # check the status of an operation, cancel it, or wait for results.
1902
+ # # Here is how to wait for a response.
1903
+ # result.wait_until_done! timeout: 60
1904
+ # if result.response?
1905
+ # p result.response
1906
+ # else
1907
+ # puts "No response received."
1908
+ # end
1909
+ #
1910
+ def batch_run_process request, options = nil
1911
+ raise ::ArgumentError, "request must be provided" if request.nil?
1912
+
1913
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest
1914
+
1915
+ # Converts hash and nil to an options object
1916
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1917
+
1918
+ # Customize the options with defaults
1919
+ call_metadata = @config.rpcs.batch_run_process.metadata.to_h
1920
+
1921
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1922
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1923
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1924
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1925
+ transports_version_send: [:rest]
1926
+
1927
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1928
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1929
+
1930
+ options.apply_defaults timeout: @config.rpcs.batch_run_process.timeout,
1931
+ metadata: call_metadata,
1932
+ retry_policy: @config.rpcs.batch_run_process.retry_policy
1933
+
1934
+ options.apply_defaults timeout: @config.timeout,
1935
+ metadata: @config.metadata,
1936
+ retry_policy: @config.retry_policy
1937
+
1938
+ @live_video_analytics_stub.batch_run_process request, options do |result, operation|
1939
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1940
+ yield result, operation if block_given?
1941
+ return result
1942
+ end
1943
+ rescue ::Gapic::Rest::Error => e
1944
+ raise ::Google::Cloud::Error.from_error(e)
1945
+ end
1946
+
1947
+ ##
1948
+ # Configuration class for the LiveVideoAnalytics REST API.
1949
+ #
1950
+ # This class represents the configuration for LiveVideoAnalytics REST,
1951
+ # providing control over timeouts, retry behavior, logging, transport
1952
+ # parameters, and other low-level controls. Certain parameters can also be
1953
+ # applied individually to specific RPCs. See
1954
+ # {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration::Rpcs}
1955
+ # for a list of RPCs that can be configured independently.
1956
+ #
1957
+ # Configuration can be applied globally to all clients, or to a single client
1958
+ # on construction.
1959
+ #
1960
+ # @example
1961
+ #
1962
+ # # Modify the global config, setting the timeout for
1963
+ # # list_public_operators to 20 seconds,
1964
+ # # and all remaining timeouts to 10 seconds.
1965
+ # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.configure do |config|
1966
+ # config.timeout = 10.0
1967
+ # config.rpcs.list_public_operators.timeout = 20.0
1968
+ # end
1969
+ #
1970
+ # # Apply the above configuration only to a new client.
1971
+ # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config|
1972
+ # config.timeout = 10.0
1973
+ # config.rpcs.list_public_operators.timeout = 20.0
1974
+ # end
1975
+ #
1976
+ # @!attribute [rw] endpoint
1977
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1978
+ # nil, indicating to use the default endpoint in the current universe domain.
1979
+ # @return [::String,nil]
1980
+ # @!attribute [rw] credentials
1981
+ # Credentials to send with calls. You may provide any of the following types:
1982
+ # * (`String`) The path to a service account key file in JSON format
1983
+ # * (`Hash`) A service account key as a Hash
1984
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1985
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1986
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1987
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1988
+ # * (`nil`) indicating no credentials
1989
+ # @return [::Object]
1990
+ # @!attribute [rw] scope
1991
+ # The OAuth scopes
1992
+ # @return [::Array<::String>]
1993
+ # @!attribute [rw] lib_name
1994
+ # The library name as recorded in instrumentation and logging
1995
+ # @return [::String]
1996
+ # @!attribute [rw] lib_version
1997
+ # The library version as recorded in instrumentation and logging
1998
+ # @return [::String]
1999
+ # @!attribute [rw] timeout
2000
+ # The call timeout in seconds.
2001
+ # @return [::Numeric]
2002
+ # @!attribute [rw] metadata
2003
+ # Additional headers to be sent with the call.
2004
+ # @return [::Hash{::Symbol=>::String}]
2005
+ # @!attribute [rw] retry_policy
2006
+ # The retry policy. The value is a hash with the following keys:
2007
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2008
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2009
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2010
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2011
+ # trigger a retry.
2012
+ # @return [::Hash]
2013
+ # @!attribute [rw] quota_project
2014
+ # A separate project against which to charge quota.
2015
+ # @return [::String]
2016
+ # @!attribute [rw] universe_domain
2017
+ # The universe domain within which to make requests. This determines the
2018
+ # default endpoint URL. The default value of nil uses the environment
2019
+ # universe (usually the default "googleapis.com" universe).
2020
+ # @return [::String,nil]
2021
+ #
2022
+ class Configuration
2023
+ extend ::Gapic::Config
2024
+
2025
+ # @private
2026
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2027
+ DEFAULT_ENDPOINT = "visionai.googleapis.com"
2028
+
2029
+ config_attr :endpoint, nil, ::String, nil
2030
+ config_attr :credentials, nil do |value|
2031
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2032
+ allowed.any? { |klass| klass === value }
2033
+ end
2034
+ config_attr :scope, nil, ::String, ::Array, nil
2035
+ config_attr :lib_name, nil, ::String, nil
2036
+ config_attr :lib_version, nil, ::String, nil
2037
+ config_attr :timeout, nil, ::Numeric, nil
2038
+ config_attr :metadata, nil, ::Hash, nil
2039
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2040
+ config_attr :quota_project, nil, ::String, nil
2041
+ config_attr :universe_domain, nil, ::String, nil
2042
+
2043
+ # @private
2044
+ def initialize parent_config = nil
2045
+ @parent_config = parent_config unless parent_config.nil?
2046
+
2047
+ yield self if block_given?
2048
+ end
2049
+
2050
+ ##
2051
+ # Configurations for individual RPCs
2052
+ # @return [Rpcs]
2053
+ #
2054
+ def rpcs
2055
+ @rpcs ||= begin
2056
+ parent_rpcs = nil
2057
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2058
+ Rpcs.new parent_rpcs
2059
+ end
2060
+ end
2061
+
2062
+ ##
2063
+ # Configuration RPC class for the LiveVideoAnalytics API.
2064
+ #
2065
+ # Includes fields providing the configuration for each RPC in this service.
2066
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2067
+ # the following configuration fields:
2068
+ #
2069
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2070
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2071
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2072
+ # include the following keys:
2073
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2074
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2075
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2076
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2077
+ # trigger a retry.
2078
+ #
2079
+ class Rpcs
2080
+ ##
2081
+ # RPC-specific configuration for `list_public_operators`
2082
+ # @return [::Gapic::Config::Method]
2083
+ #
2084
+ attr_reader :list_public_operators
2085
+ ##
2086
+ # RPC-specific configuration for `resolve_operator_info`
2087
+ # @return [::Gapic::Config::Method]
2088
+ #
2089
+ attr_reader :resolve_operator_info
2090
+ ##
2091
+ # RPC-specific configuration for `list_operators`
2092
+ # @return [::Gapic::Config::Method]
2093
+ #
2094
+ attr_reader :list_operators
2095
+ ##
2096
+ # RPC-specific configuration for `get_operator`
2097
+ # @return [::Gapic::Config::Method]
2098
+ #
2099
+ attr_reader :get_operator
2100
+ ##
2101
+ # RPC-specific configuration for `create_operator`
2102
+ # @return [::Gapic::Config::Method]
2103
+ #
2104
+ attr_reader :create_operator
2105
+ ##
2106
+ # RPC-specific configuration for `update_operator`
2107
+ # @return [::Gapic::Config::Method]
2108
+ #
2109
+ attr_reader :update_operator
2110
+ ##
2111
+ # RPC-specific configuration for `delete_operator`
2112
+ # @return [::Gapic::Config::Method]
2113
+ #
2114
+ attr_reader :delete_operator
2115
+ ##
2116
+ # RPC-specific configuration for `list_analyses`
2117
+ # @return [::Gapic::Config::Method]
2118
+ #
2119
+ attr_reader :list_analyses
2120
+ ##
2121
+ # RPC-specific configuration for `get_analysis`
2122
+ # @return [::Gapic::Config::Method]
2123
+ #
2124
+ attr_reader :get_analysis
2125
+ ##
2126
+ # RPC-specific configuration for `create_analysis`
2127
+ # @return [::Gapic::Config::Method]
2128
+ #
2129
+ attr_reader :create_analysis
2130
+ ##
2131
+ # RPC-specific configuration for `update_analysis`
2132
+ # @return [::Gapic::Config::Method]
2133
+ #
2134
+ attr_reader :update_analysis
2135
+ ##
2136
+ # RPC-specific configuration for `delete_analysis`
2137
+ # @return [::Gapic::Config::Method]
2138
+ #
2139
+ attr_reader :delete_analysis
2140
+ ##
2141
+ # RPC-specific configuration for `list_processes`
2142
+ # @return [::Gapic::Config::Method]
2143
+ #
2144
+ attr_reader :list_processes
2145
+ ##
2146
+ # RPC-specific configuration for `get_process`
2147
+ # @return [::Gapic::Config::Method]
2148
+ #
2149
+ attr_reader :get_process
2150
+ ##
2151
+ # RPC-specific configuration for `create_process`
2152
+ # @return [::Gapic::Config::Method]
2153
+ #
2154
+ attr_reader :create_process
2155
+ ##
2156
+ # RPC-specific configuration for `update_process`
2157
+ # @return [::Gapic::Config::Method]
2158
+ #
2159
+ attr_reader :update_process
2160
+ ##
2161
+ # RPC-specific configuration for `delete_process`
2162
+ # @return [::Gapic::Config::Method]
2163
+ #
2164
+ attr_reader :delete_process
2165
+ ##
2166
+ # RPC-specific configuration for `batch_run_process`
2167
+ # @return [::Gapic::Config::Method]
2168
+ #
2169
+ attr_reader :batch_run_process
2170
+
2171
+ # @private
2172
+ def initialize parent_rpcs = nil
2173
+ list_public_operators_config = parent_rpcs.list_public_operators if parent_rpcs.respond_to? :list_public_operators
2174
+ @list_public_operators = ::Gapic::Config::Method.new list_public_operators_config
2175
+ resolve_operator_info_config = parent_rpcs.resolve_operator_info if parent_rpcs.respond_to? :resolve_operator_info
2176
+ @resolve_operator_info = ::Gapic::Config::Method.new resolve_operator_info_config
2177
+ list_operators_config = parent_rpcs.list_operators if parent_rpcs.respond_to? :list_operators
2178
+ @list_operators = ::Gapic::Config::Method.new list_operators_config
2179
+ get_operator_config = parent_rpcs.get_operator if parent_rpcs.respond_to? :get_operator
2180
+ @get_operator = ::Gapic::Config::Method.new get_operator_config
2181
+ create_operator_config = parent_rpcs.create_operator if parent_rpcs.respond_to? :create_operator
2182
+ @create_operator = ::Gapic::Config::Method.new create_operator_config
2183
+ update_operator_config = parent_rpcs.update_operator if parent_rpcs.respond_to? :update_operator
2184
+ @update_operator = ::Gapic::Config::Method.new update_operator_config
2185
+ delete_operator_config = parent_rpcs.delete_operator if parent_rpcs.respond_to? :delete_operator
2186
+ @delete_operator = ::Gapic::Config::Method.new delete_operator_config
2187
+ list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses
2188
+ @list_analyses = ::Gapic::Config::Method.new list_analyses_config
2189
+ get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis
2190
+ @get_analysis = ::Gapic::Config::Method.new get_analysis_config
2191
+ create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis
2192
+ @create_analysis = ::Gapic::Config::Method.new create_analysis_config
2193
+ update_analysis_config = parent_rpcs.update_analysis if parent_rpcs.respond_to? :update_analysis
2194
+ @update_analysis = ::Gapic::Config::Method.new update_analysis_config
2195
+ delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis
2196
+ @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config
2197
+ list_processes_config = parent_rpcs.list_processes if parent_rpcs.respond_to? :list_processes
2198
+ @list_processes = ::Gapic::Config::Method.new list_processes_config
2199
+ get_process_config = parent_rpcs.get_process if parent_rpcs.respond_to? :get_process
2200
+ @get_process = ::Gapic::Config::Method.new get_process_config
2201
+ create_process_config = parent_rpcs.create_process if parent_rpcs.respond_to? :create_process
2202
+ @create_process = ::Gapic::Config::Method.new create_process_config
2203
+ update_process_config = parent_rpcs.update_process if parent_rpcs.respond_to? :update_process
2204
+ @update_process = ::Gapic::Config::Method.new update_process_config
2205
+ delete_process_config = parent_rpcs.delete_process if parent_rpcs.respond_to? :delete_process
2206
+ @delete_process = ::Gapic::Config::Method.new delete_process_config
2207
+ batch_run_process_config = parent_rpcs.batch_run_process if parent_rpcs.respond_to? :batch_run_process
2208
+ @batch_run_process = ::Gapic::Config::Method.new batch_run_process_config
2209
+
2210
+ yield self if block_given?
2211
+ end
2212
+ end
2213
+ end
2214
+ end
2215
+ end
2216
+ end
2217
+ end
2218
+ end
2219
+ end
2220
+ end