google-cloud-vision 0.31.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -9
  3. data/LICENSE +1 -1
  4. data/README.md +94 -0
  5. data/lib/google/cloud/vision.rb +200 -535
  6. data/lib/google/cloud/vision/v1.rb +129 -55
  7. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/image_annotator.rb +9 -0
  8. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search.rb +88 -0
  9. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/product_search_service.rb +539 -0
  10. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb +3 -3
  11. data/lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/web_detection.rb +2 -1
  12. data/lib/google/cloud/vision/{version.rb → v1/doc/google/protobuf/empty.rb} +13 -6
  13. data/lib/google/cloud/vision/v1/doc/google/protobuf/field_mask.rb +230 -0
  14. data/lib/google/cloud/vision/v1/doc/google/protobuf/timestamp.rb +109 -0
  15. data/lib/google/cloud/vision/v1/geometry_pb.rb +1 -0
  16. data/lib/google/cloud/vision/v1/helpers.rb +972 -0
  17. data/lib/google/cloud/vision/v1/image_annotator_client.rb +4 -4
  18. data/lib/google/cloud/vision/v1/image_annotator_pb.rb +5 -0
  19. data/lib/google/cloud/vision/v1/image_annotator_services_pb.rb +2 -1
  20. data/lib/google/cloud/vision/v1/product_search_client.rb +1337 -0
  21. data/lib/google/cloud/vision/v1/product_search_client_config.json +116 -0
  22. data/lib/google/cloud/vision/v1/product_search_pb.rb +45 -0
  23. data/lib/google/cloud/vision/v1/product_search_service_pb.rb +191 -0
  24. data/lib/google/cloud/vision/v1/product_search_service_services_pb.rb +224 -0
  25. data/lib/google/cloud/vision/v1p3beta1.rb +233 -0
  26. data/lib/google/cloud/vision/v1p3beta1/credentials.rb +42 -0
  27. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/geometry.rb +72 -0
  28. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/image_annotator.rb +763 -0
  29. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search.rb +154 -0
  30. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/product_search_service.rb +533 -0
  31. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/text_annotation.rb +254 -0
  32. data/lib/google/cloud/vision/v1p3beta1/doc/google/cloud/vision/v1p3beta1/web_detection.rb +101 -0
  33. data/lib/google/cloud/vision/v1p3beta1/doc/google/longrunning/operations.rb +93 -0
  34. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/any.rb +130 -0
  35. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/empty.rb +29 -0
  36. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/field_mask.rb +230 -0
  37. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/timestamp.rb +109 -0
  38. data/lib/google/cloud/vision/v1p3beta1/doc/google/protobuf/wrappers.rb +90 -0
  39. data/lib/google/cloud/vision/v1p3beta1/doc/google/rpc/status.rb +84 -0
  40. data/lib/google/cloud/vision/v1p3beta1/doc/google/type/color.rb +156 -0
  41. data/lib/google/cloud/vision/v1p3beta1/doc/google/type/latlng.rb +65 -0
  42. data/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +43 -0
  43. data/lib/google/cloud/vision/v1p3beta1/helpers.rb +972 -0
  44. data/lib/google/cloud/vision/v1p3beta1/image_annotator_client.rb +302 -0
  45. data/lib/google/cloud/vision/v1p3beta1/image_annotator_client_config.json +36 -0
  46. data/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +304 -0
  47. data/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +55 -0
  48. data/lib/google/cloud/vision/v1p3beta1/product_search_client.rb +1351 -0
  49. data/lib/google/cloud/vision/v1p3beta1/product_search_client_config.json +116 -0
  50. data/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +64 -0
  51. data/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +191 -0
  52. data/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +222 -0
  53. data/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +94 -0
  54. data/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb +51 -0
  55. metadata +53 -122
  56. data/AUTHENTICATION.md +0 -179
  57. data/CHANGELOG.md +0 -109
  58. data/CODE_OF_CONDUCT.md +0 -40
  59. data/CONTRIBUTING.md +0 -188
  60. data/LOGGING.md +0 -32
  61. data/OVERVIEW.md +0 -202
  62. data/TROUBLESHOOTING.md +0 -37
  63. data/lib/google-cloud-vision.rb +0 -146
  64. data/lib/google/cloud/vision/annotate.rb +0 -303
  65. data/lib/google/cloud/vision/annotation.rb +0 -553
  66. data/lib/google/cloud/vision/annotation/crop_hint.rb +0 -126
  67. data/lib/google/cloud/vision/annotation/entity.rb +0 -225
  68. data/lib/google/cloud/vision/annotation/face.rb +0 -1497
  69. data/lib/google/cloud/vision/annotation/normalized_vertex.rb +0 -76
  70. data/lib/google/cloud/vision/annotation/object_localization.rb +0 -115
  71. data/lib/google/cloud/vision/annotation/properties.rb +0 -220
  72. data/lib/google/cloud/vision/annotation/safe_search.rb +0 -153
  73. data/lib/google/cloud/vision/annotation/text.rb +0 -1015
  74. data/lib/google/cloud/vision/annotation/vertex.rb +0 -91
  75. data/lib/google/cloud/vision/annotation/web.rb +0 -420
  76. data/lib/google/cloud/vision/credentials.rb +0 -57
  77. data/lib/google/cloud/vision/image.rb +0 -832
  78. data/lib/google/cloud/vision/location.rb +0 -98
  79. data/lib/google/cloud/vision/project.rb +0 -367
  80. data/lib/google/cloud/vision/service.rb +0 -83
@@ -1,83 +0,0 @@
1
- # Copyright 2016 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/errors"
17
- require "google/cloud/vision/version"
18
- require "google/cloud/vision/v1"
19
- require "google/gax/errors"
20
-
21
- module Google
22
- module Cloud
23
- module Vision
24
- ##
25
- # @private
26
- # Represents the service to Vision, exposing the API calls.
27
- class Service
28
- attr_accessor :project, :credentials, :timeout, :client_config
29
-
30
- ##
31
- # Creates a new Service instance.
32
- def initialize project, credentials, timeout: nil, client_config: nil
33
- @project = project
34
- @credentials = credentials
35
- @timeout = timeout
36
- @client_config = client_config || {}
37
- end
38
-
39
- def service
40
- return mocked_service if mocked_service
41
- @service ||= \
42
- V1::ImageAnnotatorClient.new(
43
- credentials: credentials,
44
- timeout: timeout,
45
- client_config: client_config,
46
- lib_name: "gccl",
47
- lib_version: Google::Cloud::Vision::VERSION
48
- )
49
- end
50
- attr_accessor :mocked_service
51
-
52
- ##
53
- # Returns API::BatchAnnotateImagesResponse
54
- def annotate requests
55
- execute do
56
- service.batch_annotate_images requests, options: default_options
57
- end
58
- end
59
-
60
- def inspect
61
- "#{self.class}(#{@project})"
62
- end
63
-
64
- protected
65
-
66
- def default_headers
67
- { "google-cloud-resource-prefix" => "projects/#{@project}" }
68
- end
69
-
70
- def default_options
71
- Google::Gax::CallOptions.new kwargs: default_headers
72
- end
73
-
74
- def execute
75
- yield
76
- rescue Google::Gax::GaxError => e
77
- # GaxError wraps BadStatus, but exposes it as #cause
78
- raise Google::Cloud::Error.from_error(e.cause)
79
- end
80
- end
81
- end
82
- end
83
- end