google-cloud-vision-v1 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f6c632a7255364d370fbc4df649a6314d2752c61f70efd14ac60b27c961fa5e
4
- data.tar.gz: 2f010109632d052bc968b3c238143883ea96f8e179b700ae7284e6fea3c84f32
3
+ metadata.gz: 5a3c9ebef2896d55b17cff05339936083b3b4ec22edbca16053c54eb39fa7874
4
+ data.tar.gz: ebc0237ffc4dcdcbdce65e7e9b8df7fa280e7675813d6b2d368fa8e94fca9db9
5
5
  SHA512:
6
- metadata.gz: 970349693ace803333a0991a2315bf51024ec5c1aa1362a2581eb68e1a1107cdcbd9844184043af8c72507122043f88c8b90f7d8642958374a8db60ac286a5a2
7
- data.tar.gz: d001ecac5f76e67dd866047e1c5c4a8a8a758a9f6920cd4454a160cc552fb9744d2eaf5daa693dff8fd9663a67f7a4ea2bb571565eae9406d998b47d40933a76
6
+ metadata.gz: 93ce5266be80fca58013099e590816764f8bc2e1dd35927125530a28ce855b2fb3aa2909838ea60c2179595c2c543ccdc312a1ff3044c3a31b3371f0e7b57783
7
+ data.tar.gz: 183d6b758a9f0d75e1135df7ecccd3e1560a02ffc641790f70454b91a5cb9445be33d218b08a085315afee9493c613e4d26541794fd9a8a0c80f14e3531aa6a0
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-vision-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Vision::V1::ProductSearch::Credentials}):
68
68
 
69
- 1. `VISION_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `VISION_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `VISION_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `VISION_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/vision/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/vision/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/vision/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/vision/v1"
34
34
 
35
35
  client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Vision::V1::CreateProductSetRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_product_set request
38
38
  ```
39
39
 
@@ -69,34 +69,22 @@ module Google
69
69
 
70
70
  default_config.rpcs.batch_annotate_images.timeout = 600.0
71
71
  default_config.rpcs.batch_annotate_images.retry_policy = {
72
- initial_delay: 0.1,
73
- max_delay: 60.0,
74
- multiplier: 1.3,
75
- retry_codes: [4, 14]
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
73
  }
77
74
 
78
75
  default_config.rpcs.batch_annotate_files.timeout = 600.0
79
76
  default_config.rpcs.batch_annotate_files.retry_policy = {
80
- initial_delay: 0.1,
81
- max_delay: 60.0,
82
- multiplier: 1.3,
83
- retry_codes: [4, 14]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
78
  }
85
79
 
86
80
  default_config.rpcs.async_batch_annotate_images.timeout = 600.0
87
81
  default_config.rpcs.async_batch_annotate_images.retry_policy = {
88
- initial_delay: 0.1,
89
- max_delay: 60.0,
90
- multiplier: 1.3,
91
- retry_codes: [4, 14]
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
92
83
  }
93
84
 
94
85
  default_config.rpcs.async_batch_annotate_files.timeout = 600.0
95
86
  default_config.rpcs.async_batch_annotate_files.retry_policy = {
96
- initial_delay: 0.1,
97
- max_delay: 60.0,
98
- multiplier: 1.3,
99
- retry_codes: [4, 14]
87
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
100
88
  }
101
89
 
102
90
  default_config
@@ -167,7 +155,7 @@ module Google
167
155
  !@config.endpoint.split(".").first.include?("-")
168
156
  credentials ||= Credentials.default scope: @config.scope,
169
157
  enable_self_signed_jwt: enable_self_signed_jwt
170
- if credentials.is_a?(String) || credentials.is_a?(Hash)
158
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
171
159
  credentials = Credentials.new credentials, scope: @config.scope
172
160
  end
173
161
  @quota_project_id = @config.quota_project
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -396,9 +396,9 @@ module Google
396
396
  end
397
397
 
398
398
  ##
399
- # Waits for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
399
+ # Waits until the specified long-running operation is done or reaches at most
400
+ # a specified timeout, returning the latest state. If the operation is
401
+ # already done, the latest state is immediately returned. If the timeout
402
402
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
403
  # timeout is used. If the server does not support this method, it returns
404
404
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -29,7 +29,7 @@ module Google
29
29
  # ImageAnnotator service returns detected entities from the images.
30
30
  class Service
31
31
 
32
- include ::GRPC::GenericService
32
+ include GRPC::GenericService
33
33
 
34
34
  self.marshal_class_method = :encode
35
35
  self.unmarshal_class_method = :decode
@@ -80,154 +80,97 @@ module Google
80
80
 
81
81
  default_config.rpcs.create_product_set.timeout = 600.0
82
82
  default_config.rpcs.create_product_set.retry_policy = {
83
- initial_delay: 0.1,
84
- max_delay: 60.0,
85
- multiplier: 1.3,
86
- retry_codes: []
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
87
84
  }
88
85
 
89
86
  default_config.rpcs.list_product_sets.timeout = 600.0
90
87
  default_config.rpcs.list_product_sets.retry_policy = {
91
- initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
89
  }
96
90
 
97
91
  default_config.rpcs.get_product_set.timeout = 600.0
98
92
  default_config.rpcs.get_product_set.retry_policy = {
99
- initial_delay: 0.1,
100
- max_delay: 60.0,
101
- multiplier: 1.3,
102
- retry_codes: [4, 14]
93
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
103
94
  }
104
95
 
105
96
  default_config.rpcs.update_product_set.timeout = 600.0
106
97
  default_config.rpcs.update_product_set.retry_policy = {
107
- initial_delay: 0.1,
108
- max_delay: 60.0,
109
- multiplier: 1.3,
110
- retry_codes: [4, 14]
98
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
111
99
  }
112
100
 
113
101
  default_config.rpcs.delete_product_set.timeout = 600.0
114
102
  default_config.rpcs.delete_product_set.retry_policy = {
115
- initial_delay: 0.1,
116
- max_delay: 60.0,
117
- multiplier: 1.3,
118
- retry_codes: [4, 14]
103
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
119
104
  }
120
105
 
121
106
  default_config.rpcs.create_product.timeout = 600.0
122
107
  default_config.rpcs.create_product.retry_policy = {
123
- initial_delay: 0.1,
124
- max_delay: 60.0,
125
- multiplier: 1.3,
126
- retry_codes: []
108
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
127
109
  }
128
110
 
129
111
  default_config.rpcs.list_products.timeout = 600.0
130
112
  default_config.rpcs.list_products.retry_policy = {
131
- initial_delay: 0.1,
132
- max_delay: 60.0,
133
- multiplier: 1.3,
134
- retry_codes: [4, 14]
113
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
135
114
  }
136
115
 
137
116
  default_config.rpcs.get_product.timeout = 600.0
138
117
  default_config.rpcs.get_product.retry_policy = {
139
- initial_delay: 0.1,
140
- max_delay: 60.0,
141
- multiplier: 1.3,
142
- retry_codes: [4, 14]
118
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
143
119
  }
144
120
 
145
121
  default_config.rpcs.update_product.timeout = 600.0
146
122
  default_config.rpcs.update_product.retry_policy = {
147
- initial_delay: 0.1,
148
- max_delay: 60.0,
149
- multiplier: 1.3,
150
- retry_codes: [4, 14]
123
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
151
124
  }
152
125
 
153
126
  default_config.rpcs.delete_product.timeout = 600.0
154
127
  default_config.rpcs.delete_product.retry_policy = {
155
- initial_delay: 0.1,
156
- max_delay: 60.0,
157
- multiplier: 1.3,
158
- retry_codes: [4, 14]
128
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
159
129
  }
160
130
 
161
131
  default_config.rpcs.create_reference_image.timeout = 600.0
162
132
  default_config.rpcs.create_reference_image.retry_policy = {
163
- initial_delay: 0.1,
164
- max_delay: 60.0,
165
- multiplier: 1.3,
166
- retry_codes: []
133
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
167
134
  }
168
135
 
169
136
  default_config.rpcs.delete_reference_image.timeout = 600.0
170
137
  default_config.rpcs.delete_reference_image.retry_policy = {
171
- initial_delay: 0.1,
172
- max_delay: 60.0,
173
- multiplier: 1.3,
174
- retry_codes: [4, 14]
138
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
175
139
  }
176
140
 
177
141
  default_config.rpcs.list_reference_images.timeout = 600.0
178
142
  default_config.rpcs.list_reference_images.retry_policy = {
179
- initial_delay: 0.1,
180
- max_delay: 60.0,
181
- multiplier: 1.3,
182
- retry_codes: [4, 14]
143
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
183
144
  }
184
145
 
185
146
  default_config.rpcs.get_reference_image.timeout = 600.0
186
147
  default_config.rpcs.get_reference_image.retry_policy = {
187
- initial_delay: 0.1,
188
- max_delay: 60.0,
189
- multiplier: 1.3,
190
- retry_codes: [4, 14]
148
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
191
149
  }
192
150
 
193
151
  default_config.rpcs.add_product_to_product_set.timeout = 600.0
194
152
  default_config.rpcs.add_product_to_product_set.retry_policy = {
195
- initial_delay: 0.1,
196
- max_delay: 60.0,
197
- multiplier: 1.3,
198
- retry_codes: [4, 14]
153
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
199
154
  }
200
155
 
201
156
  default_config.rpcs.remove_product_from_product_set.timeout = 600.0
202
157
  default_config.rpcs.remove_product_from_product_set.retry_policy = {
203
- initial_delay: 0.1,
204
- max_delay: 60.0,
205
- multiplier: 1.3,
206
- retry_codes: [4, 14]
158
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
207
159
  }
208
160
 
209
161
  default_config.rpcs.list_products_in_product_set.timeout = 600.0
210
162
  default_config.rpcs.list_products_in_product_set.retry_policy = {
211
- initial_delay: 0.1,
212
- max_delay: 60.0,
213
- multiplier: 1.3,
214
- retry_codes: [4, 14]
163
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
215
164
  }
216
165
 
217
166
  default_config.rpcs.import_product_sets.timeout = 600.0
218
167
  default_config.rpcs.import_product_sets.retry_policy = {
219
- initial_delay: 0.1,
220
- max_delay: 60.0,
221
- multiplier: 1.3,
222
- retry_codes: []
168
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
223
169
  }
224
170
 
225
171
  default_config.rpcs.purge_products.timeout = 600.0
226
172
  default_config.rpcs.purge_products.retry_policy = {
227
- initial_delay: 0.1,
228
- max_delay: 60.0,
229
- multiplier: 1.3,
230
- retry_codes: []
173
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
231
174
  }
232
175
 
233
176
  default_config
@@ -298,7 +241,7 @@ module Google
298
241
  !@config.endpoint.split(".").first.include?("-")
299
242
  credentials ||= Credentials.default scope: @config.scope,
300
243
  enable_self_signed_jwt: enable_self_signed_jwt
301
- if credentials.is_a?(String) || credentials.is_a?(Hash)
244
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
302
245
  credentials = Credentials.new credentials, scope: @config.scope
303
246
  end
304
247
  @quota_project_id = @config.quota_project
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -396,9 +396,9 @@ module Google
396
396
  end
397
397
 
398
398
  ##
399
- # Waits for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
399
+ # Waits until the specified long-running operation is done or reaches at most
400
+ # a specified timeout, returning the latest state. If the operation is
401
+ # already done, the latest state is immediately returned. If the timeout
402
402
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
403
  # timeout is used. If the server does not support this method, it returns
404
404
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -40,7 +40,7 @@ module Google
40
40
  # `projects/*/locations/*/products/*/referenceImages/*`
41
41
  class Service
42
42
 
43
- include ::GRPC::GenericService
43
+ include GRPC::GenericService
44
44
 
45
45
  self.marshal_class_method = :encode
46
46
  self.unmarshal_class_method = :decode
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Vision
23
23
  module V1
24
- VERSION = "0.6.1"
24
+ VERSION = "0.6.2"
25
25
  end
26
26
  end
27
27
  end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -21,17 +21,22 @@ module Google
21
21
  module Type
22
22
  # Represents a color in the RGBA color space. This representation is designed
23
23
  # for simplicity of conversion to/from color representations in various
24
- # languages over compactness; for example, the fields of this representation
25
- # can be trivially provided to the constructor of "java.awt.Color" in Java; it
26
- # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24
+ # languages over compactness. For example, the fields of this representation
25
+ # can be trivially provided to the constructor of `java.awt.Color` in Java; it
26
+ # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
27
27
  # method in iOS; and, with just a little work, it can be easily formatted into
28
- # a CSS "rgba()" string in JavaScript, as well.
28
+ # a CSS `rgba()` string in JavaScript.
29
29
  #
30
- # Note: this proto does not carry information about the absolute color space
30
+ # This reference page doesn't carry information about the absolute color
31
+ # space
31
32
  # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
32
- # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
33
+ # DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
33
34
  # space.
34
35
  #
36
+ # When color equality needs to be decided, implementations, unless
37
+ # documented otherwise, treat two colors as equal if all their red,
38
+ # green, blue, and alpha values each differ by at most 1e-5.
39
+ #
35
40
  # Example (Java):
36
41
  #
37
42
  # import com.google.type.Color;
@@ -117,7 +122,7 @@ module Google
117
122
  # var blue = Math.floor(blueFrac * 255);
118
123
  #
119
124
  # if (!('alpha' in rgb_color)) {
120
- # return rgbToCssColor_(red, green, blue);
125
+ # return rgbToCssColor(red, green, blue);
121
126
  # }
122
127
  #
123
128
  # var alphaFrac = rgb_color.alpha.value || 0.0;
@@ -125,7 +130,7 @@ module Google
125
130
  # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
126
131
  # };
127
132
  #
128
- # var rgbToCssColor_ = function(red, green, blue) {
133
+ # var rgbToCssColor = function(red, green, blue) {
129
134
  # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
130
135
  # var hexString = rgbNumber.toString(16);
131
136
  # var missingZeros = 6 - hexString.length;
@@ -152,14 +157,14 @@ module Google
152
157
  # The fraction of this color that should be applied to the pixel. That is,
153
158
  # the final pixel color is defined by the equation:
154
159
  #
155
- # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
160
+ # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
156
161
  #
157
162
  # This means that a value of 1.0 corresponds to a solid color, whereas
158
163
  # a value of 0.0 corresponds to a completely transparent color. This
159
164
  # uses a wrapper message rather than a simple float scalar so that it is
160
165
  # possible to distinguish between a default value and the value being unset.
161
- # If omitted, this color object is to be rendered as a solid color
162
- # (as if the alpha value had been explicitly given with a value of 1.0).
166
+ # If omitted, this color object is rendered as a solid color
167
+ # (as if the alpha value had been explicitly given a value of 1.0).
163
168
  class Color
164
169
  include ::Google::Protobuf::MessageExts
165
170
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-vision-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common