google-cloud-vision_ai-v1 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/vision_ai/v1/app_platform/client.rb +50 -27
  4. data/lib/google/cloud/vision_ai/v1/app_platform/operations.rb +12 -15
  5. data/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +46 -27
  6. data/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb +43 -38
  7. data/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb +222 -158
  8. data/lib/google/cloud/vision_ai/v1/health_check_service/client.rb +29 -2
  9. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +29 -2
  10. data/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb +22 -8
  11. data/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb +43 -19
  12. data/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb +12 -15
  13. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +40 -19
  14. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb +43 -38
  15. data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb +158 -110
  16. data/lib/google/cloud/vision_ai/v1/streaming_service/client.rb +29 -7
  17. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +29 -4
  18. data/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb +38 -20
  19. data/lib/google/cloud/vision_ai/v1/streams_service/client.rb +47 -24
  20. data/lib/google/cloud/vision_ai/v1/streams_service/operations.rb +12 -15
  21. data/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +43 -24
  22. data/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb +43 -38
  23. data/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb +198 -140
  24. data/lib/google/cloud/vision_ai/v1/version.rb +1 -1
  25. data/lib/google/cloud/vision_ai/v1/warehouse/client.rb +60 -64
  26. data/lib/google/cloud/vision_ai/v1/warehouse/operations.rb +12 -15
  27. data/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +59 -63
  28. data/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +43 -38
  29. data/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb +510 -374
  30. data/proto_docs/google/api/client.rb +39 -0
  31. data/proto_docs/google/longrunning/operations.rb +19 -14
  32. metadata +5 -5
@@ -185,14 +185,26 @@ module Google
185
185
  endpoint: @config.endpoint,
186
186
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
187
187
  universe_domain: @config.universe_domain,
188
- credentials: credentials
188
+ credentials: credentials,
189
+ logger: @config.logger
189
190
  )
190
191
 
192
+ @live_video_analytics_stub.logger(stub: true)&.info do |entry|
193
+ entry.set_system_name
194
+ entry.set_service
195
+ entry.message = "Created client for #{entry.service}"
196
+ entry.set_credentials_fields credentials
197
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
198
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
199
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
200
+ end
201
+
191
202
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
192
203
  config.credentials = credentials
193
204
  config.quota_project = @quota_project_id
194
205
  config.endpoint = @live_video_analytics_stub.endpoint
195
206
  config.universe_domain = @live_video_analytics_stub.universe_domain
207
+ config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger=
196
208
  end
197
209
 
198
210
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -200,6 +212,7 @@ module Google
200
212
  config.quota_project = @quota_project_id
201
213
  config.endpoint = @live_video_analytics_stub.endpoint
202
214
  config.universe_domain = @live_video_analytics_stub.universe_domain
215
+ config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger=
203
216
  end
204
217
  end
205
218
 
@@ -224,6 +237,15 @@ module Google
224
237
  #
225
238
  attr_reader :iam_policy_client
226
239
 
240
+ ##
241
+ # The logger used for request/response debug logging.
242
+ #
243
+ # @return [Logger]
244
+ #
245
+ def logger
246
+ @live_video_analytics_stub.logger
247
+ end
248
+
227
249
  # Service calls
228
250
 
229
251
  ##
@@ -313,7 +335,7 @@ module Google
313
335
  @live_video_analytics_stub.list_public_operators request, options do |result, operation|
314
336
  result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, "operators", request, result, options
315
337
  yield result, operation if block_given?
316
- return result
338
+ throw :response, result
317
339
  end
318
340
  rescue ::Gapic::Rest::Error => e
319
341
  raise ::Google::Cloud::Error.from_error(e)
@@ -394,7 +416,6 @@ module Google
394
416
 
395
417
  @live_video_analytics_stub.resolve_operator_info request, options do |result, operation|
396
418
  yield result, operation if block_given?
397
- return result
398
419
  end
399
420
  rescue ::Gapic::Rest::Error => e
400
421
  raise ::Google::Cloud::Error.from_error(e)
@@ -486,7 +507,6 @@ module Google
486
507
 
487
508
  @live_video_analytics_stub.list_operators request, options do |result, operation|
488
509
  yield result, operation if block_given?
489
- return result
490
510
  end
491
511
  rescue ::Gapic::Rest::Error => e
492
512
  raise ::Google::Cloud::Error.from_error(e)
@@ -565,7 +585,6 @@ module Google
565
585
 
566
586
  @live_video_analytics_stub.get_operator request, options do |result, operation|
567
587
  yield result, operation if block_given?
568
- return result
569
588
  end
570
589
  rescue ::Gapic::Rest::Error => e
571
590
  raise ::Google::Cloud::Error.from_error(e)
@@ -670,7 +689,7 @@ module Google
670
689
  @live_video_analytics_stub.create_operator request, options do |result, operation|
671
690
  result = ::Gapic::Operation.new result, @operations_client, options: options
672
691
  yield result, operation if block_given?
673
- return result
692
+ throw :response, result
674
693
  end
675
694
  rescue ::Gapic::Rest::Error => e
676
695
  raise ::Google::Cloud::Error.from_error(e)
@@ -777,7 +796,7 @@ module Google
777
796
  @live_video_analytics_stub.update_operator request, options do |result, operation|
778
797
  result = ::Gapic::Operation.new result, @operations_client, options: options
779
798
  yield result, operation if block_given?
780
- return result
799
+ throw :response, result
781
800
  end
782
801
  rescue ::Gapic::Rest::Error => e
783
802
  raise ::Google::Cloud::Error.from_error(e)
@@ -878,7 +897,7 @@ module Google
878
897
  @live_video_analytics_stub.delete_operator request, options do |result, operation|
879
898
  result = ::Gapic::Operation.new result, @operations_client, options: options
880
899
  yield result, operation if block_given?
881
- return result
900
+ throw :response, result
882
901
  end
883
902
  rescue ::Gapic::Rest::Error => e
884
903
  raise ::Google::Cloud::Error.from_error(e)
@@ -970,7 +989,6 @@ module Google
970
989
 
971
990
  @live_video_analytics_stub.list_analyses request, options do |result, operation|
972
991
  yield result, operation if block_given?
973
- return result
974
992
  end
975
993
  rescue ::Gapic::Rest::Error => e
976
994
  raise ::Google::Cloud::Error.from_error(e)
@@ -1049,7 +1067,6 @@ module Google
1049
1067
 
1050
1068
  @live_video_analytics_stub.get_analysis request, options do |result, operation|
1051
1069
  yield result, operation if block_given?
1052
- return result
1053
1070
  end
1054
1071
  rescue ::Gapic::Rest::Error => e
1055
1072
  raise ::Google::Cloud::Error.from_error(e)
@@ -1154,7 +1171,7 @@ module Google
1154
1171
  @live_video_analytics_stub.create_analysis request, options do |result, operation|
1155
1172
  result = ::Gapic::Operation.new result, @operations_client, options: options
1156
1173
  yield result, operation if block_given?
1157
- return result
1174
+ throw :response, result
1158
1175
  end
1159
1176
  rescue ::Gapic::Rest::Error => e
1160
1177
  raise ::Google::Cloud::Error.from_error(e)
@@ -1261,7 +1278,7 @@ module Google
1261
1278
  @live_video_analytics_stub.update_analysis request, options do |result, operation|
1262
1279
  result = ::Gapic::Operation.new result, @operations_client, options: options
1263
1280
  yield result, operation if block_given?
1264
- return result
1281
+ throw :response, result
1265
1282
  end
1266
1283
  rescue ::Gapic::Rest::Error => e
1267
1284
  raise ::Google::Cloud::Error.from_error(e)
@@ -1362,7 +1379,7 @@ module Google
1362
1379
  @live_video_analytics_stub.delete_analysis request, options do |result, operation|
1363
1380
  result = ::Gapic::Operation.new result, @operations_client, options: options
1364
1381
  yield result, operation if block_given?
1365
- return result
1382
+ throw :response, result
1366
1383
  end
1367
1384
  rescue ::Gapic::Rest::Error => e
1368
1385
  raise ::Google::Cloud::Error.from_error(e)
@@ -1454,7 +1471,6 @@ module Google
1454
1471
 
1455
1472
  @live_video_analytics_stub.list_processes request, options do |result, operation|
1456
1473
  yield result, operation if block_given?
1457
- return result
1458
1474
  end
1459
1475
  rescue ::Gapic::Rest::Error => e
1460
1476
  raise ::Google::Cloud::Error.from_error(e)
@@ -1533,7 +1549,6 @@ module Google
1533
1549
 
1534
1550
  @live_video_analytics_stub.get_process request, options do |result, operation|
1535
1551
  yield result, operation if block_given?
1536
- return result
1537
1552
  end
1538
1553
  rescue ::Gapic::Rest::Error => e
1539
1554
  raise ::Google::Cloud::Error.from_error(e)
@@ -1638,7 +1653,7 @@ module Google
1638
1653
  @live_video_analytics_stub.create_process request, options do |result, operation|
1639
1654
  result = ::Gapic::Operation.new result, @operations_client, options: options
1640
1655
  yield result, operation if block_given?
1641
- return result
1656
+ throw :response, result
1642
1657
  end
1643
1658
  rescue ::Gapic::Rest::Error => e
1644
1659
  raise ::Google::Cloud::Error.from_error(e)
@@ -1745,7 +1760,7 @@ module Google
1745
1760
  @live_video_analytics_stub.update_process request, options do |result, operation|
1746
1761
  result = ::Gapic::Operation.new result, @operations_client, options: options
1747
1762
  yield result, operation if block_given?
1748
- return result
1763
+ throw :response, result
1749
1764
  end
1750
1765
  rescue ::Gapic::Rest::Error => e
1751
1766
  raise ::Google::Cloud::Error.from_error(e)
@@ -1846,7 +1861,7 @@ module Google
1846
1861
  @live_video_analytics_stub.delete_process request, options do |result, operation|
1847
1862
  result = ::Gapic::Operation.new result, @operations_client, options: options
1848
1863
  yield result, operation if block_given?
1849
- return result
1864
+ throw :response, result
1850
1865
  end
1851
1866
  rescue ::Gapic::Rest::Error => e
1852
1867
  raise ::Google::Cloud::Error.from_error(e)
@@ -1938,7 +1953,7 @@ module Google
1938
1953
  @live_video_analytics_stub.batch_run_process request, options do |result, operation|
1939
1954
  result = ::Gapic::Operation.new result, @operations_client, options: options
1940
1955
  yield result, operation if block_given?
1941
- return result
1956
+ throw :response, result
1942
1957
  end
1943
1958
  rescue ::Gapic::Rest::Error => e
1944
1959
  raise ::Google::Cloud::Error.from_error(e)
@@ -2018,6 +2033,11 @@ module Google
2018
2033
  # default endpoint URL. The default value of nil uses the environment
2019
2034
  # universe (usually the default "googleapis.com" universe).
2020
2035
  # @return [::String,nil]
2036
+ # @!attribute [rw] logger
2037
+ # A custom logger to use for request/response debug logging, or the value
2038
+ # `:default` (the default) to construct a default logger, or `nil` to
2039
+ # explicitly disable logging.
2040
+ # @return [::Logger,:default,nil]
2021
2041
  #
2022
2042
  class Configuration
2023
2043
  extend ::Gapic::Config
@@ -2039,6 +2059,7 @@ module Google
2039
2059
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2040
2060
  config_attr :quota_project, nil, ::String, nil
2041
2061
  config_attr :universe_domain, nil, ::String, nil
2062
+ config_attr :logger, :default, ::Logger, nil, :default
2042
2063
 
2043
2064
  # @private
2044
2065
  def initialize parent_config = nil
@@ -115,14 +115,6 @@ module Google
115
115
  # Lists operations that match the specified filter in the request. If the
116
116
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
117
117
  #
118
- # NOTE: the `name` binding allows API services to override the binding
119
- # to use different resource name schemes, such as `users/*/operations`. To
120
- # override the binding, API services can add a binding such as
121
- # `"/v1/{name=users/*}/operations"` to their service configuration.
122
- # For backwards compatibility, the default name includes the operations
123
- # collection id, however overriding users must ensure the name binding
124
- # is the parent resource, without the operations collection id.
125
- #
126
118
  # @overload list_operations(request, options = nil)
127
119
  # Pass arguments to `list_operations` via a request object, either of type
128
120
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -204,7 +196,7 @@ module Google
204
196
  @operations_stub.list_operations request, options do |result, operation|
205
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
206
198
  yield result, operation if block_given?
207
- return result
199
+ throw :response, result
208
200
  end
209
201
  rescue ::Gapic::Rest::Error => e
210
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -293,7 +285,7 @@ module Google
293
285
  @operations_stub.get_operation request, options do |result, operation|
294
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
295
287
  yield result, operation if block_given?
296
- return result
288
+ throw :response, result
297
289
  end
298
290
  rescue ::Gapic::Rest::Error => e
299
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -375,7 +367,6 @@ module Google
375
367
 
376
368
  @operations_stub.delete_operation request, options do |result, operation|
377
369
  yield result, operation if block_given?
378
- return result
379
370
  end
380
371
  rescue ::Gapic::Rest::Error => e
381
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -390,8 +381,9 @@ module Google
390
381
  # other methods to check whether the cancellation succeeded or whether the
391
382
  # operation completed despite cancellation. On successful cancellation,
392
383
  # the operation is not deleted; instead, it becomes an operation with
393
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
394
- # corresponding to `Code.CANCELLED`.
384
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
385
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
386
+ # `Code.CANCELLED`.
395
387
  #
396
388
  # @overload cancel_operation(request, options = nil)
397
389
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -463,7 +455,6 @@ module Google
463
455
 
464
456
  @operations_stub.cancel_operation request, options do |result, operation|
465
457
  yield result, operation if block_given?
466
- return result
467
458
  end
468
459
  rescue ::Gapic::Rest::Error => e
469
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,6 +534,11 @@ module Google
543
534
  # default endpoint URL. The default value of nil uses the environment
544
535
  # universe (usually the default "googleapis.com" universe).
545
536
  # @return [::String,nil]
537
+ # @!attribute [rw] logger
538
+ # A custom logger to use for request/response debug logging, or the value
539
+ # `:default` (the default) to construct a default logger, or `nil` to
540
+ # explicitly disable logging.
541
+ # @return [::Logger,:default,nil]
546
542
  #
547
543
  class Configuration
548
544
  extend ::Gapic::Config
@@ -564,6 +560,7 @@ module Google
564
560
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
565
561
  config_attr :quota_project, nil, ::String, nil
566
562
  config_attr :universe_domain, nil, ::String, nil
563
+ config_attr :logger, :default, ::Logger, nil, :default
567
564
 
568
565
  # @private
569
566
  def initialize parent_config = nil
@@ -683,16 +680,18 @@ module Google
683
680
 
684
681
  response = @client_stub.make_http_request(
685
682
  verb,
686
- uri: uri,
687
- body: body || "",
688
- params: query_string_params,
683
+ uri: uri,
684
+ body: body || "",
685
+ params: query_string_params,
686
+ method_name: "list_operations",
689
687
  options: options
690
688
  )
691
689
  operation = ::Gapic::Rest::TransportOperation.new response
692
690
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
693
-
694
- yield result, operation if block_given?
695
- result
691
+ catch :response do
692
+ yield result, operation if block_given?
693
+ result
694
+ end
696
695
  end
697
696
 
698
697
  ##
@@ -721,16 +720,18 @@ module Google
721
720
 
722
721
  response = @client_stub.make_http_request(
723
722
  verb,
724
- uri: uri,
725
- body: body || "",
726
- params: query_string_params,
723
+ uri: uri,
724
+ body: body || "",
725
+ params: query_string_params,
726
+ method_name: "get_operation",
727
727
  options: options
728
728
  )
729
729
  operation = ::Gapic::Rest::TransportOperation.new response
730
730
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
731
-
732
- yield result, operation if block_given?
733
- result
731
+ catch :response do
732
+ yield result, operation if block_given?
733
+ result
734
+ end
734
735
  end
735
736
 
736
737
  ##
@@ -759,16 +760,18 @@ module Google
759
760
 
760
761
  response = @client_stub.make_http_request(
761
762
  verb,
762
- uri: uri,
763
- body: body || "",
764
- params: query_string_params,
763
+ uri: uri,
764
+ body: body || "",
765
+ params: query_string_params,
766
+ method_name: "delete_operation",
765
767
  options: options
766
768
  )
767
769
  operation = ::Gapic::Rest::TransportOperation.new response
768
770
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
769
-
770
- yield result, operation if block_given?
771
- result
771
+ catch :response do
772
+ yield result, operation if block_given?
773
+ result
774
+ end
772
775
  end
773
776
 
774
777
  ##
@@ -797,16 +800,18 @@ module Google
797
800
 
798
801
  response = @client_stub.make_http_request(
799
802
  verb,
800
- uri: uri,
801
- body: body || "",
802
- params: query_string_params,
803
+ uri: uri,
804
+ body: body || "",
805
+ params: query_string_params,
806
+ method_name: "cancel_operation",
803
807
  options: options
804
808
  )
805
809
  operation = ::Gapic::Rest::TransportOperation.new response
806
810
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
807
-
808
- yield result, operation if block_given?
809
- result
811
+ catch :response do
812
+ yield result, operation if block_given?
813
+ result
814
+ end
810
815
  end
811
816
 
812
817
  ##