google-cloud-vision-v1 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/vision/v1/geometry_pb.rb +24 -18
  5. data/lib/google/cloud/vision/v1/image_annotator/client.rb +10 -10
  6. data/lib/google/cloud/vision/v1/image_annotator/operations.rb +14 -16
  7. data/lib/google/cloud/vision/v1/image_annotator/rest/client.rb +662 -0
  8. data/lib/google/cloud/vision/v1/image_annotator/rest/operations.rb +814 -0
  9. data/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb +344 -0
  10. data/lib/google/cloud/vision/v1/image_annotator/rest.rb +55 -0
  11. data/lib/google/cloud/vision/v1/image_annotator.rb +7 -1
  12. data/lib/google/cloud/vision/v1/image_annotator_pb.rb +32 -273
  13. data/lib/google/cloud/vision/v1/product_search/client.rb +26 -34
  14. data/lib/google/cloud/vision/v1/product_search/operations.rb +14 -16
  15. data/lib/google/cloud/vision/v1/product_search/rest/client.rb +1970 -0
  16. data/lib/google/cloud/vision/v1/product_search/rest/operations.rb +814 -0
  17. data/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb +1178 -0
  18. data/lib/google/cloud/vision/v1/product_search/rest.rb +66 -0
  19. data/lib/google/cloud/vision/v1/product_search.rb +7 -1
  20. data/lib/google/cloud/vision/v1/product_search_pb.rb +27 -28
  21. data/lib/google/cloud/vision/v1/product_search_service_pb.rb +28 -148
  22. data/lib/google/cloud/vision/v1/rest.rb +38 -0
  23. data/lib/google/cloud/vision/v1/text_annotation_pb.rb +25 -65
  24. data/lib/google/cloud/vision/v1/version.rb +1 -1
  25. data/lib/google/cloud/vision/v1/web_detection_pb.rb +24 -29
  26. data/lib/google/cloud/vision/v1.rb +7 -2
  27. data/proto_docs/google/api/client.rb +381 -0
  28. data/proto_docs/google/api/launch_stage.rb +71 -0
  29. data/proto_docs/google/cloud/vision/v1/image_annotator.rb +2 -1
  30. data/proto_docs/google/protobuf/any.rb +7 -4
  31. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  32. data/proto_docs/google/rpc/status.rb +4 -2
  33. metadata +21 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90af1ca7ee6c5b4733fb24cfd3d3ae2a4fce345688247d5a8c2b813f40d5e7b9
4
- data.tar.gz: fe441dd14da1bd0a73e284c800ea5480169ffc60157e88a57dfa7bb355803d32
3
+ metadata.gz: 40df20aa44564c2dfe57aecdada11ba4de2e85f3a6f3acc1c418ac8900a92684
4
+ data.tar.gz: 1fd2c2cda39b61034b7f4763905bff6fe8d63557b879f335ca3589e0aa582e68
5
5
  SHA512:
6
- metadata.gz: 6e7b766a0709037d15aed5ba3fe90b33bd548f44f6e4c8c459a8abab8f4cf642a9a29ccbd6713d9d45106a88ad78e7075ad8b72200161e42c74b400df38f1a3c
7
- data.tar.gz: cec8cc37fdd096e2c19182c90faef35a9f37a133a6491cd55d94bcc2d7e6b3aa14511764be26b6fc3a36431b2d2687147b6ae36175ba45f6c159399b2de481bc
6
+ metadata.gz: c7194614df273eaa6c5b5ac5a4c0704b3f53426f697b6c7baa7d1d955b71c8edbc949a838c63d22a0e8ddbd0af5455ee0a094dd943b41216b05f7fba6c7e5bc5
7
+ data.tar.gz: f8430ac20d35108d533686ff2fb0eda2427ab8a8688039efe9a364ce64cb1843e3de09dc7e1fa898dbd9a55112527808cf4da26c1a35d0d91e72104d76592356
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Vision V1 API
2
2
 
3
- API Client library for the Cloud Vision V1 API
3
+ Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.
4
4
 
5
5
  Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
6
6
 
@@ -46,8 +46,8 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -1,28 +1,34 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/vision/v1/geometry.proto
3
4
 
4
5
  require 'google/protobuf'
5
6
 
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_file("google/cloud/vision/v1/geometry.proto", :syntax => :proto3) do
8
- add_message "google.cloud.vision.v1.Vertex" do
9
- optional :x, :int32, 1
10
- optional :y, :int32, 2
11
- end
12
- add_message "google.cloud.vision.v1.NormalizedVertex" do
13
- optional :x, :float, 1
14
- optional :y, :float, 2
15
- end
16
- add_message "google.cloud.vision.v1.BoundingPoly" do
17
- repeated :vertices, :message, 1, "google.cloud.vision.v1.Vertex"
18
- repeated :normalized_vertices, :message, 2, "google.cloud.vision.v1.NormalizedVertex"
19
- end
20
- add_message "google.cloud.vision.v1.Position" do
21
- optional :x, :float, 1
22
- optional :y, :float, 2
23
- optional :z, :float, 3
7
+
8
+ descriptor_data = "\n%google/cloud/vision/v1/geometry.proto\x12\x16google.cloud.vision.v1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x87\x01\n\x0c\x42oundingPoly\x12\x30\n\x08vertices\x18\x01 \x03(\x0b\x32\x1e.google.cloud.vision.v1.Vertex\x12\x45\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32(.google.cloud.vision.v1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42n\n\x1a\x63om.google.cloud.vision.v1B\rGeometryProtoP\x01Z5cloud.google.com/go/vision/v2/apiv1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3"
9
+
10
+ pool = Google::Protobuf::DescriptorPool.generated_pool
11
+
12
+ begin
13
+ pool.add_serialized_file(descriptor_data)
14
+ rescue TypeError => e
15
+ # Compatibility code: will be removed in the next major version.
16
+ require 'google/protobuf/descriptor_pb'
17
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
18
+ parsed.clear_dependency
19
+ serialized = parsed.class.encode(parsed)
20
+ file = pool.add_serialized_file(serialized)
21
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
22
+ imports = [
23
+ ]
24
+ imports.each do |type_name, expected_filename|
25
+ import_file = pool.lookup(type_name).file_descriptor
26
+ if import_file.name != expected_filename
27
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
24
28
  end
25
29
  end
30
+ warn "Each proto file must use a consistent fully-qualified name."
31
+ warn "This will become an error in the next major version."
26
32
  end
27
33
 
28
34
  module Google
@@ -430,14 +430,14 @@ module Google
430
430
  # # Call the async_batch_annotate_images method.
431
431
  # result = client.async_batch_annotate_images request
432
432
  #
433
- # # The returned object is of type Gapic::Operation. You can use this
434
- # # object to check the status of an operation, cancel it, or wait
435
- # # for results. Here is how to block until completion:
433
+ # # The returned object is of type Gapic::Operation. You can use it to
434
+ # # check the status of an operation, cancel it, or wait for results.
435
+ # # Here is how to wait for a response.
436
436
  # result.wait_until_done! timeout: 60
437
437
  # if result.response?
438
438
  # p result.response
439
439
  # else
440
- # puts "Error!"
440
+ # puts "No response received."
441
441
  # end
442
442
  #
443
443
  def async_batch_annotate_images request, options = nil
@@ -533,14 +533,14 @@ module Google
533
533
  # # Call the async_batch_annotate_files method.
534
534
  # result = client.async_batch_annotate_files request
535
535
  #
536
- # # The returned object is of type Gapic::Operation. You can use this
537
- # # object to check the status of an operation, cancel it, or wait
538
- # # for results. Here is how to block until completion:
536
+ # # The returned object is of type Gapic::Operation. You can use it to
537
+ # # check the status of an operation, cancel it, or wait for results.
538
+ # # Here is how to wait for a response.
539
539
  # result.wait_until_done! timeout: 60
540
540
  # if result.response?
541
541
  # p result.response
542
542
  # else
543
- # puts "Error!"
543
+ # puts "No response received."
544
544
  # end
545
545
  #
546
546
  def async_batch_annotate_files request, options = nil
@@ -615,9 +615,9 @@ module Google
615
615
  # * (`String`) The path to a service account key file in JSON format
616
616
  # * (`Hash`) A service account key as a Hash
617
617
  # * (`Google::Auth::Credentials`) A googleauth credentials object
618
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
618
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
619
619
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
620
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
620
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
621
621
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
622
622
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
623
623
  # * (`nil`) indicating no credentials
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -622,9 +620,9 @@ module Google
622
620
  # * (`String`) The path to a service account key file in JSON format
623
621
  # * (`Hash`) A service account key as a Hash
624
622
  # * (`Google::Auth::Credentials`) A googleauth credentials object
625
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
623
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
626
624
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
627
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
625
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
628
626
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
629
627
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
630
628
  # * (`nil`) indicating no credentials