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
@@ -0,0 +1,116 @@
1
+ {
2
+ "interfaces": {
3
+ "google.cloud.vision.v1.ProductSearch": {
4
+ "retry_codes": {
5
+ "idempotent": [
6
+ "DEADLINE_EXCEEDED",
7
+ "UNAVAILABLE"
8
+ ],
9
+ "non_idempotent": []
10
+ },
11
+ "retry_params": {
12
+ "default": {
13
+ "initial_retry_delay_millis": 100,
14
+ "retry_delay_multiplier": 1.3,
15
+ "max_retry_delay_millis": 60000,
16
+ "initial_rpc_timeout_millis": 60000,
17
+ "rpc_timeout_multiplier": 1.0,
18
+ "max_rpc_timeout_millis": 60000,
19
+ "total_timeout_millis": 600000
20
+ }
21
+ },
22
+ "methods": {
23
+ "CreateProduct": {
24
+ "timeout_millis": 60000,
25
+ "retry_codes_name": "non_idempotent",
26
+ "retry_params_name": "default"
27
+ },
28
+ "ListProducts": {
29
+ "timeout_millis": 60000,
30
+ "retry_codes_name": "idempotent",
31
+ "retry_params_name": "default"
32
+ },
33
+ "GetProduct": {
34
+ "timeout_millis": 60000,
35
+ "retry_codes_name": "idempotent",
36
+ "retry_params_name": "default"
37
+ },
38
+ "UpdateProduct": {
39
+ "timeout_millis": 60000,
40
+ "retry_codes_name": "idempotent",
41
+ "retry_params_name": "default"
42
+ },
43
+ "DeleteProduct": {
44
+ "timeout_millis": 60000,
45
+ "retry_codes_name": "idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "ListReferenceImages": {
49
+ "timeout_millis": 60000,
50
+ "retry_codes_name": "idempotent",
51
+ "retry_params_name": "default"
52
+ },
53
+ "GetReferenceImage": {
54
+ "timeout_millis": 60000,
55
+ "retry_codes_name": "idempotent",
56
+ "retry_params_name": "default"
57
+ },
58
+ "DeleteReferenceImage": {
59
+ "timeout_millis": 60000,
60
+ "retry_codes_name": "idempotent",
61
+ "retry_params_name": "default"
62
+ },
63
+ "CreateReferenceImage": {
64
+ "timeout_millis": 60000,
65
+ "retry_codes_name": "non_idempotent",
66
+ "retry_params_name": "default"
67
+ },
68
+ "CreateProductSet": {
69
+ "timeout_millis": 60000,
70
+ "retry_codes_name": "non_idempotent",
71
+ "retry_params_name": "default"
72
+ },
73
+ "ListProductSets": {
74
+ "timeout_millis": 60000,
75
+ "retry_codes_name": "idempotent",
76
+ "retry_params_name": "default"
77
+ },
78
+ "GetProductSet": {
79
+ "timeout_millis": 60000,
80
+ "retry_codes_name": "idempotent",
81
+ "retry_params_name": "default"
82
+ },
83
+ "UpdateProductSet": {
84
+ "timeout_millis": 60000,
85
+ "retry_codes_name": "idempotent",
86
+ "retry_params_name": "default"
87
+ },
88
+ "DeleteProductSet": {
89
+ "timeout_millis": 60000,
90
+ "retry_codes_name": "idempotent",
91
+ "retry_params_name": "default"
92
+ },
93
+ "AddProductToProductSet": {
94
+ "timeout_millis": 60000,
95
+ "retry_codes_name": "idempotent",
96
+ "retry_params_name": "default"
97
+ },
98
+ "RemoveProductFromProductSet": {
99
+ "timeout_millis": 60000,
100
+ "retry_codes_name": "idempotent",
101
+ "retry_params_name": "default"
102
+ },
103
+ "ListProductsInProductSet": {
104
+ "timeout_millis": 60000,
105
+ "retry_codes_name": "idempotent",
106
+ "retry_params_name": "default"
107
+ },
108
+ "ImportProductSets": {
109
+ "timeout_millis": 60000,
110
+ "retry_codes_name": "non_idempotent",
111
+ "retry_params_name": "default"
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,45 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/vision/v1/product_search.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/cloud/vision/v1/geometry_pb'
9
+ require 'google/cloud/vision/v1/product_search_service_pb'
10
+ require 'google/protobuf/timestamp_pb'
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_message "google.cloud.vision.v1.ProductSearchParams" do
13
+ optional :bounding_poly, :message, 9, "google.cloud.vision.v1.BoundingPoly"
14
+ optional :product_set, :string, 6
15
+ repeated :product_categories, :string, 7
16
+ optional :filter, :string, 8
17
+ end
18
+ add_message "google.cloud.vision.v1.ProductSearchResults" do
19
+ optional :index_time, :message, 2, "google.protobuf.Timestamp"
20
+ repeated :results, :message, 5, "google.cloud.vision.v1.ProductSearchResults.Result"
21
+ repeated :product_grouped_results, :message, 6, "google.cloud.vision.v1.ProductSearchResults.GroupedResult"
22
+ end
23
+ add_message "google.cloud.vision.v1.ProductSearchResults.Result" do
24
+ optional :product, :message, 1, "google.cloud.vision.v1.Product"
25
+ optional :score, :float, 2
26
+ optional :image, :string, 3
27
+ end
28
+ add_message "google.cloud.vision.v1.ProductSearchResults.GroupedResult" do
29
+ optional :bounding_poly, :message, 1, "google.cloud.vision.v1.BoundingPoly"
30
+ repeated :results, :message, 2, "google.cloud.vision.v1.ProductSearchResults.Result"
31
+ end
32
+ end
33
+
34
+ module Google
35
+ module Cloud
36
+ module Vision
37
+ module V1
38
+ ProductSearchParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchParams").msgclass
39
+ ProductSearchResults = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults").msgclass
40
+ ProductSearchResults::Result = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults.Result").msgclass
41
+ ProductSearchResults::GroupedResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSearchResults.GroupedResult").msgclass
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,191 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/vision/v1/product_search_service.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/cloud/vision/v1/geometry_pb'
9
+ require 'google/longrunning/operations_pb'
10
+ require 'google/protobuf/empty_pb'
11
+ require 'google/protobuf/field_mask_pb'
12
+ require 'google/protobuf/timestamp_pb'
13
+ require 'google/rpc/status_pb'
14
+ Google::Protobuf::DescriptorPool.generated_pool.build do
15
+ add_message "google.cloud.vision.v1.Product" do
16
+ optional :name, :string, 1
17
+ optional :display_name, :string, 2
18
+ optional :description, :string, 3
19
+ optional :product_category, :string, 4
20
+ repeated :product_labels, :message, 5, "google.cloud.vision.v1.Product.KeyValue"
21
+ end
22
+ add_message "google.cloud.vision.v1.Product.KeyValue" do
23
+ optional :key, :string, 1
24
+ optional :value, :string, 2
25
+ end
26
+ add_message "google.cloud.vision.v1.ProductSet" do
27
+ optional :name, :string, 1
28
+ optional :display_name, :string, 2
29
+ optional :index_time, :message, 3, "google.protobuf.Timestamp"
30
+ optional :index_error, :message, 4, "google.rpc.Status"
31
+ end
32
+ add_message "google.cloud.vision.v1.ReferenceImage" do
33
+ optional :name, :string, 1
34
+ optional :uri, :string, 2
35
+ repeated :bounding_polys, :message, 3, "google.cloud.vision.v1.BoundingPoly"
36
+ end
37
+ add_message "google.cloud.vision.v1.CreateProductRequest" do
38
+ optional :parent, :string, 1
39
+ optional :product, :message, 2, "google.cloud.vision.v1.Product"
40
+ optional :product_id, :string, 3
41
+ end
42
+ add_message "google.cloud.vision.v1.ListProductsRequest" do
43
+ optional :parent, :string, 1
44
+ optional :page_size, :int32, 2
45
+ optional :page_token, :string, 3
46
+ end
47
+ add_message "google.cloud.vision.v1.ListProductsResponse" do
48
+ repeated :products, :message, 1, "google.cloud.vision.v1.Product"
49
+ optional :next_page_token, :string, 2
50
+ end
51
+ add_message "google.cloud.vision.v1.GetProductRequest" do
52
+ optional :name, :string, 1
53
+ end
54
+ add_message "google.cloud.vision.v1.UpdateProductRequest" do
55
+ optional :product, :message, 1, "google.cloud.vision.v1.Product"
56
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
57
+ end
58
+ add_message "google.cloud.vision.v1.DeleteProductRequest" do
59
+ optional :name, :string, 1
60
+ end
61
+ add_message "google.cloud.vision.v1.CreateProductSetRequest" do
62
+ optional :parent, :string, 1
63
+ optional :product_set, :message, 2, "google.cloud.vision.v1.ProductSet"
64
+ optional :product_set_id, :string, 3
65
+ end
66
+ add_message "google.cloud.vision.v1.ListProductSetsRequest" do
67
+ optional :parent, :string, 1
68
+ optional :page_size, :int32, 2
69
+ optional :page_token, :string, 3
70
+ end
71
+ add_message "google.cloud.vision.v1.ListProductSetsResponse" do
72
+ repeated :product_sets, :message, 1, "google.cloud.vision.v1.ProductSet"
73
+ optional :next_page_token, :string, 2
74
+ end
75
+ add_message "google.cloud.vision.v1.GetProductSetRequest" do
76
+ optional :name, :string, 1
77
+ end
78
+ add_message "google.cloud.vision.v1.UpdateProductSetRequest" do
79
+ optional :product_set, :message, 1, "google.cloud.vision.v1.ProductSet"
80
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
81
+ end
82
+ add_message "google.cloud.vision.v1.DeleteProductSetRequest" do
83
+ optional :name, :string, 1
84
+ end
85
+ add_message "google.cloud.vision.v1.CreateReferenceImageRequest" do
86
+ optional :parent, :string, 1
87
+ optional :reference_image, :message, 2, "google.cloud.vision.v1.ReferenceImage"
88
+ optional :reference_image_id, :string, 3
89
+ end
90
+ add_message "google.cloud.vision.v1.ListReferenceImagesRequest" do
91
+ optional :parent, :string, 1
92
+ optional :page_size, :int32, 2
93
+ optional :page_token, :string, 3
94
+ end
95
+ add_message "google.cloud.vision.v1.ListReferenceImagesResponse" do
96
+ repeated :reference_images, :message, 1, "google.cloud.vision.v1.ReferenceImage"
97
+ optional :page_size, :int32, 2
98
+ optional :next_page_token, :string, 3
99
+ end
100
+ add_message "google.cloud.vision.v1.GetReferenceImageRequest" do
101
+ optional :name, :string, 1
102
+ end
103
+ add_message "google.cloud.vision.v1.DeleteReferenceImageRequest" do
104
+ optional :name, :string, 1
105
+ end
106
+ add_message "google.cloud.vision.v1.AddProductToProductSetRequest" do
107
+ optional :name, :string, 1
108
+ optional :product, :string, 2
109
+ end
110
+ add_message "google.cloud.vision.v1.RemoveProductFromProductSetRequest" do
111
+ optional :name, :string, 1
112
+ optional :product, :string, 2
113
+ end
114
+ add_message "google.cloud.vision.v1.ListProductsInProductSetRequest" do
115
+ optional :name, :string, 1
116
+ optional :page_size, :int32, 2
117
+ optional :page_token, :string, 3
118
+ end
119
+ add_message "google.cloud.vision.v1.ListProductsInProductSetResponse" do
120
+ repeated :products, :message, 1, "google.cloud.vision.v1.Product"
121
+ optional :next_page_token, :string, 2
122
+ end
123
+ add_message "google.cloud.vision.v1.ImportProductSetsGcsSource" do
124
+ optional :csv_file_uri, :string, 1
125
+ end
126
+ add_message "google.cloud.vision.v1.ImportProductSetsInputConfig" do
127
+ oneof :source do
128
+ optional :gcs_source, :message, 1, "google.cloud.vision.v1.ImportProductSetsGcsSource"
129
+ end
130
+ end
131
+ add_message "google.cloud.vision.v1.ImportProductSetsRequest" do
132
+ optional :parent, :string, 1
133
+ optional :input_config, :message, 2, "google.cloud.vision.v1.ImportProductSetsInputConfig"
134
+ end
135
+ add_message "google.cloud.vision.v1.ImportProductSetsResponse" do
136
+ repeated :reference_images, :message, 1, "google.cloud.vision.v1.ReferenceImage"
137
+ repeated :statuses, :message, 2, "google.rpc.Status"
138
+ end
139
+ add_message "google.cloud.vision.v1.BatchOperationMetadata" do
140
+ optional :state, :enum, 1, "google.cloud.vision.v1.BatchOperationMetadata.State"
141
+ optional :submit_time, :message, 2, "google.protobuf.Timestamp"
142
+ optional :end_time, :message, 3, "google.protobuf.Timestamp"
143
+ end
144
+ add_enum "google.cloud.vision.v1.BatchOperationMetadata.State" do
145
+ value :STATE_UNSPECIFIED, 0
146
+ value :PROCESSING, 1
147
+ value :SUCCESSFUL, 2
148
+ value :FAILED, 3
149
+ value :CANCELLED, 4
150
+ end
151
+ end
152
+
153
+ module Google
154
+ module Cloud
155
+ module Vision
156
+ module V1
157
+ Product = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.Product").msgclass
158
+ Product::KeyValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.Product.KeyValue").msgclass
159
+ ProductSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ProductSet").msgclass
160
+ ReferenceImage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ReferenceImage").msgclass
161
+ CreateProductRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateProductRequest").msgclass
162
+ ListProductsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsRequest").msgclass
163
+ ListProductsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsResponse").msgclass
164
+ GetProductRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetProductRequest").msgclass
165
+ UpdateProductRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.UpdateProductRequest").msgclass
166
+ DeleteProductRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteProductRequest").msgclass
167
+ CreateProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateProductSetRequest").msgclass
168
+ ListProductSetsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductSetsRequest").msgclass
169
+ ListProductSetsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductSetsResponse").msgclass
170
+ GetProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetProductSetRequest").msgclass
171
+ UpdateProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.UpdateProductSetRequest").msgclass
172
+ DeleteProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteProductSetRequest").msgclass
173
+ CreateReferenceImageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.CreateReferenceImageRequest").msgclass
174
+ ListReferenceImagesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListReferenceImagesRequest").msgclass
175
+ ListReferenceImagesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListReferenceImagesResponse").msgclass
176
+ GetReferenceImageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.GetReferenceImageRequest").msgclass
177
+ DeleteReferenceImageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.DeleteReferenceImageRequest").msgclass
178
+ AddProductToProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.AddProductToProductSetRequest").msgclass
179
+ RemoveProductFromProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.RemoveProductFromProductSetRequest").msgclass
180
+ ListProductsInProductSetRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsInProductSetRequest").msgclass
181
+ ListProductsInProductSetResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ListProductsInProductSetResponse").msgclass
182
+ ImportProductSetsGcsSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsGcsSource").msgclass
183
+ ImportProductSetsInputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsInputConfig").msgclass
184
+ ImportProductSetsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsRequest").msgclass
185
+ ImportProductSetsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.ImportProductSetsResponse").msgclass
186
+ BatchOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.BatchOperationMetadata").msgclass
187
+ BatchOperationMetadata::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1.BatchOperationMetadata.State").enummodule
188
+ end
189
+ end
190
+ end
191
+ end
@@ -0,0 +1,224 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/vision/v1/product_search_service.proto for package 'google.cloud.vision.v1'
3
+ # Original file comments:
4
+ # Copyright 2018 Google LLC.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #
19
+
20
+
21
+ require 'grpc'
22
+ require 'google/cloud/vision/v1/product_search_service_pb'
23
+
24
+ module Google
25
+ module Cloud
26
+ module Vision
27
+ module V1
28
+ module ProductSearch
29
+ # Manages Products and ProductSets of reference images for use in product
30
+ # search. It uses the following resource model:
31
+ #
32
+ # - The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet] resources, named
33
+ # `projects/*/locations/*/productSets/*`, which acts as a way to put different
34
+ # products into groups to limit identification.
35
+ #
36
+ # In parallel,
37
+ #
38
+ # - The API has a collection of [Product][google.cloud.vision.v1.Product] resources, named
39
+ # `projects/*/locations/*/products/*`
40
+ #
41
+ # - Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
42
+ # `projects/*/locations/*/products/*/referenceImages/*`
43
+ class Service
44
+
45
+ include GRPC::GenericService
46
+
47
+ self.marshal_class_method = :encode
48
+ self.unmarshal_class_method = :decode
49
+ self.service_name = 'google.cloud.vision.v1.ProductSearch'
50
+
51
+ # Creates and returns a new ProductSet resource.
52
+ #
53
+ # Possible errors:
54
+ #
55
+ # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
56
+ # 4096 characters.
57
+ rpc :CreateProductSet, CreateProductSetRequest, ProductSet
58
+ # Lists ProductSets in an unspecified order.
59
+ #
60
+ # Possible errors:
61
+ #
62
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
63
+ # than 1.
64
+ rpc :ListProductSets, ListProductSetsRequest, ListProductSetsResponse
65
+ # Gets information associated with a ProductSet.
66
+ #
67
+ # Possible errors:
68
+ #
69
+ # * Returns NOT_FOUND if the ProductSet does not exist.
70
+ rpc :GetProductSet, GetProductSetRequest, ProductSet
71
+ # Makes changes to a ProductSet resource.
72
+ # Only display_name can be updated currently.
73
+ #
74
+ # Possible errors:
75
+ #
76
+ # * Returns NOT_FOUND if the ProductSet does not exist.
77
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but
78
+ # missing from the request or longer than 4096 characters.
79
+ rpc :UpdateProductSet, UpdateProductSetRequest, ProductSet
80
+ # Permanently deletes a ProductSet. Products and ReferenceImages in the
81
+ # ProductSet are not deleted.
82
+ #
83
+ # The actual image files are not deleted from Google Cloud Storage.
84
+ #
85
+ # Possible errors:
86
+ #
87
+ # * Returns NOT_FOUND if the ProductSet does not exist.
88
+ rpc :DeleteProductSet, DeleteProductSetRequest, Google::Protobuf::Empty
89
+ # Creates and returns a new product resource.
90
+ #
91
+ # Possible errors:
92
+ #
93
+ # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
94
+ # characters.
95
+ # * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
96
+ # * Returns INVALID_ARGUMENT if product_category is missing or invalid.
97
+ rpc :CreateProduct, CreateProductRequest, Product
98
+ # Lists products in an unspecified order.
99
+ #
100
+ # Possible errors:
101
+ #
102
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
103
+ rpc :ListProducts, ListProductsRequest, ListProductsResponse
104
+ # Gets information associated with a Product.
105
+ #
106
+ # Possible errors:
107
+ #
108
+ # * Returns NOT_FOUND if the Product does not exist.
109
+ rpc :GetProduct, GetProductRequest, Product
110
+ # Makes changes to a Product resource.
111
+ # Only the `display_name`, `description`, and `labels` fields can be updated
112
+ # right now.
113
+ #
114
+ # If labels are updated, the change will not be reflected in queries until
115
+ # the next index time.
116
+ #
117
+ # Possible errors:
118
+ #
119
+ # * Returns NOT_FOUND if the Product does not exist.
120
+ # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
121
+ # missing from the request or longer than 4096 characters.
122
+ # * Returns INVALID_ARGUMENT if description is present in update_mask but is
123
+ # longer than 4096 characters.
124
+ # * Returns INVALID_ARGUMENT if product_category is present in update_mask.
125
+ rpc :UpdateProduct, UpdateProductRequest, Product
126
+ # Permanently deletes a product and its reference images.
127
+ #
128
+ # Metadata of the product and all its images will be deleted right away, but
129
+ # search queries against ProductSets containing the product may still work
130
+ # until all related caches are refreshed.
131
+ #
132
+ # Possible errors:
133
+ #
134
+ # * Returns NOT_FOUND if the product does not exist.
135
+ rpc :DeleteProduct, DeleteProductRequest, Google::Protobuf::Empty
136
+ # Creates and returns a new ReferenceImage resource.
137
+ #
138
+ # The `bounding_poly` field is optional. If `bounding_poly` is not specified,
139
+ # the system will try to detect regions of interest in the image that are
140
+ # compatible with the product_category on the parent product. If it is
141
+ # specified, detection is ALWAYS skipped. The system converts polygons into
142
+ # non-rotated rectangles.
143
+ #
144
+ # Note that the pipeline will resize the image if the image resolution is too
145
+ # large to process (above 50MP).
146
+ #
147
+ # Possible errors:
148
+ #
149
+ # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
150
+ # characters.
151
+ # * Returns INVALID_ARGUMENT if the product does not exist.
152
+ # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
153
+ # compatible with the parent product's product_category is detected.
154
+ # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
155
+ rpc :CreateReferenceImage, CreateReferenceImageRequest, ReferenceImage
156
+ # Permanently deletes a reference image.
157
+ #
158
+ # The image metadata will be deleted right away, but search queries
159
+ # against ProductSets containing the image may still work until all related
160
+ # caches are refreshed.
161
+ #
162
+ # The actual image files are not deleted from Google Cloud Storage.
163
+ #
164
+ # Possible errors:
165
+ #
166
+ # * Returns NOT_FOUND if the reference image does not exist.
167
+ rpc :DeleteReferenceImage, DeleteReferenceImageRequest, Google::Protobuf::Empty
168
+ # Lists reference images.
169
+ #
170
+ # Possible errors:
171
+ #
172
+ # * Returns NOT_FOUND if the parent product does not exist.
173
+ # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
174
+ # than 1.
175
+ rpc :ListReferenceImages, ListReferenceImagesRequest, ListReferenceImagesResponse
176
+ # Gets information associated with a ReferenceImage.
177
+ #
178
+ # Possible errors:
179
+ #
180
+ # * Returns NOT_FOUND if the specified image does not exist.
181
+ rpc :GetReferenceImage, GetReferenceImageRequest, ReferenceImage
182
+ # Adds a Product to the specified ProductSet. If the Product is already
183
+ # present, no change is made.
184
+ #
185
+ # One Product can be added to at most 100 ProductSets.
186
+ #
187
+ # Possible errors:
188
+ #
189
+ # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
190
+ rpc :AddProductToProductSet, AddProductToProductSetRequest, Google::Protobuf::Empty
191
+ # Removes a Product from the specified ProductSet.
192
+ #
193
+ # Possible errors:
194
+ #
195
+ # * Returns NOT_FOUND If the Product is not found under the ProductSet.
196
+ rpc :RemoveProductFromProductSet, RemoveProductFromProductSetRequest, Google::Protobuf::Empty
197
+ # Lists the Products in a ProductSet, in an unspecified order. If the
198
+ # ProductSet does not exist, the products field of the response will be
199
+ # empty.
200
+ #
201
+ # Possible errors:
202
+ #
203
+ # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
204
+ rpc :ListProductsInProductSet, ListProductsInProductSetRequest, ListProductsInProductSetResponse
205
+ # Asynchronous API that imports a list of reference images to specified
206
+ # product sets based on a list of image information.
207
+ #
208
+ # The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the
209
+ # progress and results of the request.
210
+ # `Operation.metadata` contains `BatchOperationMetadata`. (progress)
211
+ # `Operation.response` contains `ImportProductSetsResponse`. (results)
212
+ #
213
+ # The input source of this method is a csv file on Google Cloud Storage.
214
+ # For the format of the csv file please see
215
+ # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
216
+ rpc :ImportProductSets, ImportProductSetsRequest, Google::Longrunning::Operation
217
+ end
218
+
219
+ Stub = Service.rpc_stub_class
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end