google-cloud-vision-v1 0.11.0 → 0.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40df20aa44564c2dfe57aecdada11ba4de2e85f3a6f3acc1c418ac8900a92684
4
- data.tar.gz: 1fd2c2cda39b61034b7f4763905bff6fe8d63557b879f335ca3589e0aa582e68
3
+ metadata.gz: 5729acc4d540d8055498b926244b558ce721ca1b75424c82629a0c21829383c2
4
+ data.tar.gz: 4f3aab1c61292457b7e4d102746c8d0e2fb929a1039fc775c513251b950a5daf
5
5
  SHA512:
6
- metadata.gz: c7194614df273eaa6c5b5ac5a4c0704b3f53426f697b6c7baa7d1d955b71c8edbc949a838c63d22a0e8ddbd0af5455ee0a094dd943b41216b05f7fba6c7e5bc5
7
- data.tar.gz: f8430ac20d35108d533686ff2fb0eda2427ab8a8688039efe9a364ce64cb1843e3de09dc7e1fa898dbd9a55112527808cf4da26c1a35d0d91e72104d76592356
6
+ metadata.gz: ae16871a03bdd149a474ac48648941b1773db36b25635d02d57889e337df210c50506ab66c881553aae468e45daf3b27b05c8eca5a09f2341b11772a28a0852f
7
+ data.tar.gz: d7bdcffb2f7c306a6600a7d968ef979a56d774eeda707bd402431d0502fc232f3243642b2cef7ebaa0e892a343d0e67703dcbfd99b660b5e89875e372c664f3a
@@ -145,7 +145,7 @@ module Google
145
145
  credentials = @config.credentials
146
146
  # Use self-signed JWT if the endpoint is unchanged from default,
147
147
  # but only if the default endpoint does not have a region prefix.
148
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
148
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
149
  !@config.endpoint.split(".").first.include?("-")
150
150
  credentials ||= Credentials.default scope: @config.scope,
151
151
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -166,7 +166,8 @@ module Google
166
166
  credentials: credentials,
167
167
  endpoint: @config.endpoint,
168
168
  channel_args: @config.channel_args,
169
- interceptors: @config.interceptors
169
+ interceptors: @config.interceptors,
170
+ channel_pool_config: @config.channel_pool
170
171
  )
171
172
  end
172
173
 
@@ -659,7 +660,9 @@ module Google
659
660
  class Configuration
660
661
  extend ::Gapic::Config
661
662
 
662
- config_attr :endpoint, "vision.googleapis.com", ::String
663
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
664
+
665
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
663
666
  config_attr :credentials, nil do |value|
664
667
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
665
668
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -694,6 +697,14 @@ module Google
694
697
  end
695
698
  end
696
699
 
700
+ ##
701
+ # Configuration for the channel pool
702
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
703
+ #
704
+ def channel_pool
705
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
706
+ end
707
+
697
708
  ##
698
709
  # Configuration RPC class for the ImageAnnotator API.
699
710
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -664,7 +665,9 @@ module Google
664
665
  class Configuration
665
666
  extend ::Gapic::Config
666
667
 
667
- config_attr :endpoint, "vision.googleapis.com", ::String
668
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
669
+
670
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
668
671
  config_attr :credentials, nil do |value|
669
672
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
673
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -699,6 +702,14 @@ module Google
699
702
  end
700
703
  end
701
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
702
713
  ##
703
714
  # Configuration RPC class for the Operations API.
704
715
  #
@@ -141,7 +141,7 @@ module Google
141
141
  credentials = @config.credentials
142
142
  # Use self-signed JWT if the endpoint is unchanged from default,
143
143
  # but only if the default endpoint does not have a region prefix.
144
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
144
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
145
  !@config.endpoint.split(".").first.include?("-")
146
146
  credentials ||= Credentials.default scope: @config.scope,
147
147
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -210,6 +210,22 @@ module Google
210
210
  # @return [::Google::Cloud::Vision::V1::BatchAnnotateImagesResponse]
211
211
  #
212
212
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
213
+ #
214
+ # @example Basic example
215
+ # require "google/cloud/vision/v1"
216
+ #
217
+ # # Create a client object. The client can be reused for multiple calls.
218
+ # client = Google::Cloud::Vision::V1::ImageAnnotator::Rest::Client.new
219
+ #
220
+ # # Create a request. To set request fields, pass in keyword arguments.
221
+ # request = Google::Cloud::Vision::V1::BatchAnnotateImagesRequest.new
222
+ #
223
+ # # Call the batch_annotate_images method.
224
+ # result = client.batch_annotate_images request
225
+ #
226
+ # # The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateImagesResponse.
227
+ # p result
228
+ #
213
229
  def batch_annotate_images request, options = nil
214
230
  raise ::ArgumentError, "request must be provided" if request.nil?
215
231
 
@@ -292,6 +308,22 @@ module Google
292
308
  # @return [::Google::Cloud::Vision::V1::BatchAnnotateFilesResponse]
293
309
  #
294
310
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
311
+ #
312
+ # @example Basic example
313
+ # require "google/cloud/vision/v1"
314
+ #
315
+ # # Create a client object. The client can be reused for multiple calls.
316
+ # client = Google::Cloud::Vision::V1::ImageAnnotator::Rest::Client.new
317
+ #
318
+ # # Create a request. To set request fields, pass in keyword arguments.
319
+ # request = Google::Cloud::Vision::V1::BatchAnnotateFilesRequest.new
320
+ #
321
+ # # Call the batch_annotate_files method.
322
+ # result = client.batch_annotate_files request
323
+ #
324
+ # # The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateFilesResponse.
325
+ # p result
326
+ #
295
327
  def batch_annotate_files request, options = nil
296
328
  raise ::ArgumentError, "request must be provided" if request.nil?
297
329
 
@@ -377,6 +409,29 @@ module Google
377
409
  # @return [::Gapic::Operation]
378
410
  #
379
411
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
412
+ #
413
+ # @example Basic example
414
+ # require "google/cloud/vision/v1"
415
+ #
416
+ # # Create a client object. The client can be reused for multiple calls.
417
+ # client = Google::Cloud::Vision::V1::ImageAnnotator::Rest::Client.new
418
+ #
419
+ # # Create a request. To set request fields, pass in keyword arguments.
420
+ # request = Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest.new
421
+ #
422
+ # # Call the async_batch_annotate_images method.
423
+ # result = client.async_batch_annotate_images request
424
+ #
425
+ # # The returned object is of type Gapic::Operation. You can use it to
426
+ # # check the status of an operation, cancel it, or wait for results.
427
+ # # Here is how to wait for a response.
428
+ # result.wait_until_done! timeout: 60
429
+ # if result.response?
430
+ # p result.response
431
+ # else
432
+ # puts "No response received."
433
+ # end
434
+ #
380
435
  def async_batch_annotate_images request, options = nil
381
436
  raise ::ArgumentError, "request must be provided" if request.nil?
382
437
 
@@ -458,6 +513,29 @@ module Google
458
513
  # @return [::Gapic::Operation]
459
514
  #
460
515
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
516
+ #
517
+ # @example Basic example
518
+ # require "google/cloud/vision/v1"
519
+ #
520
+ # # Create a client object. The client can be reused for multiple calls.
521
+ # client = Google::Cloud::Vision::V1::ImageAnnotator::Rest::Client.new
522
+ #
523
+ # # Create a request. To set request fields, pass in keyword arguments.
524
+ # request = Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest.new
525
+ #
526
+ # # Call the async_batch_annotate_files method.
527
+ # result = client.async_batch_annotate_files request
528
+ #
529
+ # # The returned object is of type Gapic::Operation. You can use it to
530
+ # # check the status of an operation, cancel it, or wait for results.
531
+ # # Here is how to wait for a response.
532
+ # result.wait_until_done! timeout: 60
533
+ # if result.response?
534
+ # p result.response
535
+ # else
536
+ # puts "No response received."
537
+ # end
538
+ #
461
539
  def async_batch_annotate_files request, options = nil
462
540
  raise ::ArgumentError, "request must be provided" if request.nil?
463
541
 
@@ -567,7 +645,9 @@ module Google
567
645
  class Configuration
568
646
  extend ::Gapic::Config
569
647
 
570
- config_attr :endpoint, "vision.googleapis.com", ::String
648
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
649
+
650
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
571
651
  config_attr :credentials, nil do |value|
572
652
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
573
653
  allowed.any? { |klass| klass === value }
@@ -136,6 +136,26 @@ module Google
136
136
  # @return [::Gapic::Operation]
137
137
  #
138
138
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
139
+ #
140
+ # @example Basic example
141
+ # require "google/longrunning"
142
+ #
143
+ # # Create a client object. The client can be reused for multiple calls.
144
+ # client = Google::Longrunning::Operations::Rest::Client.new
145
+ #
146
+ # # Create a request. To set request fields, pass in keyword arguments.
147
+ # request = Google::Longrunning::ListOperationsRequest.new
148
+ #
149
+ # # Call the list_operations method.
150
+ # result = client.list_operations request
151
+ #
152
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
153
+ # # over elements, and API calls will be issued to fetch pages as needed.
154
+ # result.each do |item|
155
+ # # Each element is of type ::Google::Longrunning::Operation.
156
+ # p item
157
+ # end
158
+ #
139
159
  def list_operations request, options = nil
140
160
  raise ::ArgumentError, "request must be provided" if request.nil?
141
161
 
@@ -201,6 +221,29 @@ module Google
201
221
  # @return [::Gapic::Operation]
202
222
  #
203
223
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/longrunning"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Longrunning::Operations::Rest::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Longrunning::GetOperationRequest.new
233
+ #
234
+ # # Call the get_operation method.
235
+ # result = client.get_operation request
236
+ #
237
+ # # The returned object is of type Gapic::Operation. You can use it to
238
+ # # check the status of an operation, cancel it, or wait for results.
239
+ # # Here is how to wait for a response.
240
+ # result.wait_until_done! timeout: 60
241
+ # if result.response?
242
+ # p result.response
243
+ # else
244
+ # puts "No response received."
245
+ # end
246
+ #
204
247
  def get_operation request, options = nil
205
248
  raise ::ArgumentError, "request must be provided" if request.nil?
206
249
 
@@ -267,6 +310,22 @@ module Google
267
310
  # @return [::Google::Protobuf::Empty]
268
311
  #
269
312
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ #
314
+ # @example Basic example
315
+ # require "google/longrunning"
316
+ #
317
+ # # Create a client object. The client can be reused for multiple calls.
318
+ # client = Google::Longrunning::Operations::Rest::Client.new
319
+ #
320
+ # # Create a request. To set request fields, pass in keyword arguments.
321
+ # request = Google::Longrunning::DeleteOperationRequest.new
322
+ #
323
+ # # Call the delete_operation method.
324
+ # result = client.delete_operation request
325
+ #
326
+ # # The returned object is of type Google::Protobuf::Empty.
327
+ # p result
328
+ #
270
329
  def delete_operation request, options = nil
271
330
  raise ::ArgumentError, "request must be provided" if request.nil?
272
331
 
@@ -338,6 +397,22 @@ module Google
338
397
  # @return [::Google::Protobuf::Empty]
339
398
  #
340
399
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ #
401
+ # @example Basic example
402
+ # require "google/longrunning"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Longrunning::Operations::Rest::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Longrunning::CancelOperationRequest.new
409
+ #
410
+ # # Call the cancel_operation method.
411
+ # result = client.cancel_operation request
412
+ #
413
+ # # The returned object is of type Google::Protobuf::Empty.
414
+ # p result
415
+ #
341
416
  def cancel_operation request, options = nil
342
417
  raise ::ArgumentError, "request must be provided" if request.nil?
343
418
 
@@ -446,7 +521,9 @@ module Google
446
521
  class Configuration
447
522
  extend ::Gapic::Config
448
523
 
449
- config_attr :endpoint, "vision.googleapis.com", ::String
524
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
525
+
526
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
527
  config_attr :credentials, nil do |value|
451
528
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
529
  allowed.any? { |klass| klass === value }
@@ -567,7 +644,7 @@ module Google
567
644
 
568
645
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
569
646
  query_string_params = if query_string_params.any?
570
- query_string_params.to_h { |p| p.split("=", 2) }
647
+ query_string_params.to_h { |p| p.split "=", 2 }
571
648
  else
572
649
  {}
573
650
  end
@@ -605,7 +682,7 @@ module Google
605
682
 
606
683
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
607
684
  query_string_params = if query_string_params.any?
608
- query_string_params.to_h { |p| p.split("=", 2) }
685
+ query_string_params.to_h { |p| p.split "=", 2 }
609
686
  else
610
687
  {}
611
688
  end
@@ -643,7 +720,7 @@ module Google
643
720
 
644
721
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
645
722
  query_string_params = if query_string_params.any?
646
- query_string_params.to_h { |p| p.split("=", 2) }
723
+ query_string_params.to_h { |p| p.split "=", 2 }
647
724
  else
648
725
  {}
649
726
  end
@@ -681,7 +758,7 @@ module Google
681
758
 
682
759
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
683
760
  query_string_params = if query_string_params.any?
684
- query_string_params.to_h { |p| p.split("=", 2) }
761
+ query_string_params.to_h { |p| p.split "=", 2 }
685
762
  else
686
763
  {}
687
764
  end
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_files_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_images_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -231,7 +231,7 @@ module Google
231
231
  credentials = @config.credentials
232
232
  # Use self-signed JWT if the endpoint is unchanged from default,
233
233
  # but only if the default endpoint does not have a region prefix.
234
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
234
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
235
235
  !@config.endpoint.split(".").first.include?("-")
236
236
  credentials ||= Credentials.default scope: @config.scope,
237
237
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -252,7 +252,8 @@ module Google
252
252
  credentials: credentials,
253
253
  endpoint: @config.endpoint,
254
254
  channel_args: @config.channel_args,
255
- interceptors: @config.interceptors
255
+ interceptors: @config.interceptors,
256
+ channel_pool_config: @config.channel_pool
256
257
  )
257
258
  end
258
259
 
@@ -2255,7 +2256,9 @@ module Google
2255
2256
  class Configuration
2256
2257
  extend ::Gapic::Config
2257
2258
 
2258
- config_attr :endpoint, "vision.googleapis.com", ::String
2259
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
2260
+
2261
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2259
2262
  config_attr :credentials, nil do |value|
2260
2263
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2261
2264
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -2290,6 +2293,14 @@ module Google
2290
2293
  end
2291
2294
  end
2292
2295
 
2296
+ ##
2297
+ # Configuration for the channel pool
2298
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2299
+ #
2300
+ def channel_pool
2301
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2302
+ end
2303
+
2293
2304
  ##
2294
2305
  # Configuration RPC class for the ProductSearch API.
2295
2306
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -664,7 +665,9 @@ module Google
664
665
  class Configuration
665
666
  extend ::Gapic::Config
666
667
 
667
- config_attr :endpoint, "vision.googleapis.com", ::String
668
+ DEFAULT_ENDPOINT = "vision.googleapis.com"
669
+
670
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
668
671
  config_attr :credentials, nil do |value|
669
672
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
673
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -699,6 +702,14 @@ module Google
699
702
  end
700
703
  end
701
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
702
713
  ##
703
714
  # Configuration RPC class for the Operations API.
704
715
  #