cloudmersive-image-recognition-api-client 1.4.3 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +19 -16
- data/cloudmersive-image-recognition-api-client.gemspec +3 -3
- data/docs/ArtisticApi.md +2 -2
- data/docs/ConvertApi.md +13 -13
- data/docs/DrawTextInstance.md +1 -1
- data/docs/EditApi.md +188 -23
- data/docs/FaceApi.md +20 -20
- data/docs/FaceLocateResponse.md +1 -1
- data/docs/FilterApi.md +11 -11
- data/docs/ImageMetadata.md +2 -0
- data/docs/InfoApi.md +5 -5
- data/docs/NsfwApi.md +4 -4
- data/docs/RecognizeApi.md +17 -17
- data/docs/ResizeApi.md +10 -10
- data/lib/cloudmersive-image-recognition-api-client.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +6 -7
- data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +35 -42
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +215 -59
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +39 -46
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +36 -44
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +12 -14
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +8 -9
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +41 -49
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +20 -22
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +2 -2
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +8 -11
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +19 -21
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +28 -11
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/version.rb +2 -2
- data/spec/api/artistic_api_spec.rb +2 -2
- data/spec/api/convert_api_spec.rb +9 -9
- data/spec/api/edit_api_spec.rb +51 -15
- data/spec/api/face_api_spec.rb +12 -12
- data/spec/api/filter_api_spec.rb +10 -10
- data/spec/api/info_api_spec.rb +4 -4
- data/spec/api/nsfw_api_spec.rb +3 -3
- data/spec/api/recognize_api_spec.rb +12 -12
- data/spec/api/resize_api_spec.rb +7 -7
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/age_detection_result_spec.rb +4 -5
- data/spec/models/color_result_spec.rb +4 -5
- data/spec/models/detected_license_plate_spec.rb +8 -9
- data/spec/models/detected_object_spec.rb +7 -8
- data/spec/models/dominant_color_result_spec.rb +3 -4
- data/spec/models/draw_polygon_instance_spec.rb +5 -6
- data/spec/models/draw_polygon_request_spec.rb +4 -5
- data/spec/models/draw_rectangle_instance_spec.rb +8 -9
- data/spec/models/draw_rectangle_request_spec.rb +4 -5
- data/spec/models/draw_text_instance_spec.rb +9 -10
- data/spec/models/draw_text_request_spec.rb +4 -5
- data/spec/models/face_compare_response_spec.rb +5 -6
- data/spec/models/face_locate_response_spec.rb +9 -10
- data/spec/models/face_locate_with_landmarks_response_spec.rb +5 -6
- data/spec/models/face_match_spec.rb +7 -8
- data/spec/models/face_point_spec.rb +3 -4
- data/spec/models/face_spec.rb +5 -6
- data/spec/models/face_with_landmarks_spec.rb +14 -15
- data/spec/models/find_symbol_result_spec.rb +7 -8
- data/spec/models/fine_text_detection_result_spec.rb +4 -5
- data/spec/models/fine_text_item_spec.rb +12 -13
- data/spec/models/gender_detection_result_spec.rb +4 -5
- data/spec/models/image_description_response_spec.rb +5 -6
- data/spec/models/image_metadata_exif_value_spec.rb +4 -5
- data/spec/models/image_metadata_spec.rb +21 -10
- data/spec/models/nsfw_result_spec.rb +4 -5
- data/spec/models/object_detection_result_spec.rb +4 -5
- data/spec/models/person_with_age_spec.rb +5 -6
- data/spec/models/person_with_gender_spec.rb +4 -5
- data/spec/models/polygon_point_spec.rb +3 -4
- data/spec/models/recognition_outcome_spec.rb +3 -4
- data/spec/models/text_detection_result_spec.rb +4 -5
- data/spec/models/text_item_spec.rb +5 -6
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +4 -5
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
@@ -6,11 +6,11 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module CloudmersiveImageRecognitionApiClient
|
16
16
|
class ResizeApi
|
@@ -19,9 +19,8 @@ module CloudmersiveImageRecognitionApiClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
|
23
22
|
# Resize an image while preserving aspect ratio
|
24
|
-
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio
|
23
|
+
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio. Resize is EXIF-aware.
|
25
24
|
# @param max_width Maximum width of the output image - final image will be as large as possible while less than or equial to this width
|
26
25
|
# @param max_height Maximum height of the output image - final image will be as large as possible while less than or equial to this height
|
27
26
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
@@ -29,11 +28,11 @@ module CloudmersiveImageRecognitionApiClient
|
|
29
28
|
# @return [String]
|
30
29
|
def resize_post(max_width, max_height, image_file, opts = {})
|
31
30
|
data, _status_code, _headers = resize_post_with_http_info(max_width, max_height, image_file, opts)
|
32
|
-
|
31
|
+
data
|
33
32
|
end
|
34
33
|
|
35
34
|
# Resize an image while preserving aspect ratio
|
36
|
-
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio
|
35
|
+
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio. Resize is EXIF-aware.
|
37
36
|
# @param max_width Maximum width of the output image - final image will be as large as possible while less than or equial to this width
|
38
37
|
# @param max_height Maximum height of the output image - final image will be as large as possible while less than or equial to this height
|
39
38
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
@@ -41,7 +40,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
41
40
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
42
41
|
def resize_post_with_http_info(max_width, max_height, image_file, opts = {})
|
43
42
|
if @api_client.config.debugging
|
44
|
-
@api_client.config.logger.debug
|
43
|
+
@api_client.config.logger.debug 'Calling API: ResizeApi.resize_post ...'
|
45
44
|
end
|
46
45
|
# verify the required parameter 'max_width' is set
|
47
46
|
if @api_client.config.client_side_validation && max_width.nil?
|
@@ -56,7 +55,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
56
55
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ResizeApi.resize_post"
|
57
56
|
end
|
58
57
|
# resource path
|
59
|
-
local_var_path =
|
58
|
+
local_var_path = '/image/resize/preserveAspectRatio/{maxWidth}/{maxHeight}'.sub('{' + 'maxWidth' + '}', max_width.to_s).sub('{' + 'maxHeight' + '}', max_height.to_s)
|
60
59
|
|
61
60
|
# query parameters
|
62
61
|
query_params = {}
|
@@ -64,13 +63,13 @@ module CloudmersiveImageRecognitionApiClient
|
|
64
63
|
# header parameters
|
65
64
|
header_params = {}
|
66
65
|
# HTTP header 'Accept' (if needed)
|
67
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
68
67
|
# HTTP header 'Content-Type'
|
69
68
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
70
69
|
|
71
70
|
# form parameters
|
72
71
|
form_params = {}
|
73
|
-
form_params[
|
72
|
+
form_params['imageFile'] = image_file
|
74
73
|
|
75
74
|
# http body (model)
|
76
75
|
post_body = nil
|
@@ -87,29 +86,28 @@ module CloudmersiveImageRecognitionApiClient
|
|
87
86
|
end
|
88
87
|
return data, status_code, headers
|
89
88
|
end
|
90
|
-
|
91
89
|
# Resize an image
|
92
|
-
# Resize an image to a specific width and specific height
|
93
|
-
# @param width
|
94
|
-
# @param height
|
90
|
+
# Resize an image to a specific width and specific height. Resize is EXIF-aware.
|
91
|
+
# @param width Width of the output image - final image will be exactly this width
|
92
|
+
# @param height Height of the output image - final image will be exactly this height
|
95
93
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
96
94
|
# @param [Hash] opts the optional parameters
|
97
95
|
# @return [String]
|
98
96
|
def resize_resize_simple(width, height, image_file, opts = {})
|
99
97
|
data, _status_code, _headers = resize_resize_simple_with_http_info(width, height, image_file, opts)
|
100
|
-
|
98
|
+
data
|
101
99
|
end
|
102
100
|
|
103
101
|
# Resize an image
|
104
|
-
# Resize an image to a specific width and specific height
|
105
|
-
# @param width
|
106
|
-
# @param height
|
102
|
+
# Resize an image to a specific width and specific height. Resize is EXIF-aware.
|
103
|
+
# @param width Width of the output image - final image will be exactly this width
|
104
|
+
# @param height Height of the output image - final image will be exactly this height
|
107
105
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
108
106
|
# @param [Hash] opts the optional parameters
|
109
107
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
110
108
|
def resize_resize_simple_with_http_info(width, height, image_file, opts = {})
|
111
109
|
if @api_client.config.debugging
|
112
|
-
@api_client.config.logger.debug
|
110
|
+
@api_client.config.logger.debug 'Calling API: ResizeApi.resize_resize_simple ...'
|
113
111
|
end
|
114
112
|
# verify the required parameter 'width' is set
|
115
113
|
if @api_client.config.client_side_validation && width.nil?
|
@@ -124,7 +122,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
124
122
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ResizeApi.resize_resize_simple"
|
125
123
|
end
|
126
124
|
# resource path
|
127
|
-
local_var_path =
|
125
|
+
local_var_path = '/image/resize/target/{width}/{height}'.sub('{' + 'width' + '}', width.to_s).sub('{' + 'height' + '}', height.to_s)
|
128
126
|
|
129
127
|
# query parameters
|
130
128
|
query_params = {}
|
@@ -132,13 +130,13 @@ module CloudmersiveImageRecognitionApiClient
|
|
132
130
|
# header parameters
|
133
131
|
header_params = {}
|
134
132
|
# HTTP header 'Accept' (if needed)
|
135
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
133
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
136
134
|
# HTTP header 'Content-Type'
|
137
135
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
138
136
|
|
139
137
|
# form parameters
|
140
138
|
form_params = {}
|
141
|
-
form_params[
|
139
|
+
form_params['imageFile'] = image_file
|
142
140
|
|
143
141
|
# http body (model)
|
144
142
|
post_body = nil
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -33,7 +33,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
33
33
|
@config = config
|
34
34
|
@user_agent = "Swagger-Codegen/#{VERSION}/ruby"
|
35
35
|
@default_headers = {
|
36
|
-
'Content-Type' =>
|
36
|
+
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
38
38
|
}
|
39
39
|
end
|
@@ -112,6 +112,8 @@ module CloudmersiveImageRecognitionApiClient
|
|
112
112
|
:verbose => @config.debugging
|
113
113
|
}
|
114
114
|
|
115
|
+
req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/"
|
116
|
+
|
115
117
|
# set custom cert, if provided
|
116
118
|
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
117
119
|
|
@@ -137,7 +139,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
137
139
|
# @param [String] mime MIME
|
138
140
|
# @return [Boolean] True if the MIME is application/json
|
139
141
|
def json_mime?(mime)
|
140
|
-
|
142
|
+
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
141
143
|
end
|
142
144
|
|
143
145
|
# Deserialize the response to the given return type.
|
@@ -201,12 +203,12 @@ module CloudmersiveImageRecognitionApiClient
|
|
201
203
|
when /\AArray<(.+)>\z/
|
202
204
|
# e.g. Array<Pet>
|
203
205
|
sub_type = $1
|
204
|
-
data.map {|item| convert_to_type(item, sub_type) }
|
206
|
+
data.map { |item| convert_to_type(item, sub_type) }
|
205
207
|
when /\AHash\<String, (.+)\>\z/
|
206
208
|
# e.g. Hash<String, Integer>
|
207
209
|
sub_type = $1
|
208
210
|
{}.tap do |hash|
|
209
|
-
data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
|
211
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
210
212
|
end
|
211
213
|
else
|
212
214
|
# models, e.g. Pet
|
@@ -228,7 +230,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
228
230
|
encoding = nil
|
229
231
|
request.on_headers do |response|
|
230
232
|
content_disposition = response.headers['Content-Disposition']
|
231
|
-
if content_disposition
|
233
|
+
if content_disposition && content_disposition =~ /filename=/i
|
232
234
|
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
233
235
|
prefix = sanitize_filename(filename)
|
234
236
|
else
|
@@ -327,7 +329,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
327
329
|
return nil if accepts.nil? || accepts.empty?
|
328
330
|
# use JSON when present, otherwise use all of the provided
|
329
331
|
json_accept = accepts.find { |s| json_mime?(s) }
|
330
|
-
|
332
|
+
json_accept || accepts.join(',')
|
331
333
|
end
|
332
334
|
|
333
335
|
# Return Content-Type header based on an array of content types provided.
|
@@ -338,7 +340,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
338
340
|
return 'application/json' if content_types.nil? || content_types.empty?
|
339
341
|
# use JSON when present, otherwise use the first one
|
340
342
|
json_content_type = content_types.find { |s| json_mime?(s) }
|
341
|
-
|
343
|
+
json_content_type || content_types.first
|
342
344
|
end
|
343
345
|
|
344
346
|
# Convert object (array, hash, object, etc) to JSON string.
|
@@ -348,7 +350,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
348
350
|
return model if model.nil? || model.is_a?(String)
|
349
351
|
local_body = nil
|
350
352
|
if model.is_a?(Array)
|
351
|
-
local_body = model.map{|m| object_to_hash(m) }
|
353
|
+
local_body = model.map { |m| object_to_hash(m) }
|
352
354
|
else
|
353
355
|
local_body = object_to_hash(model)
|
354
356
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -170,7 +170,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
170
170
|
def base_path=(base_path)
|
171
171
|
# Add leading and trailing slashes to base_path
|
172
172
|
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
173
|
-
@base_path =
|
173
|
+
@base_path = '' if @base_path == '/'
|
174
174
|
end
|
175
175
|
|
176
176
|
def base_url
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
24
24
|
# Number of people identified in the image with an age
|
25
25
|
attr_accessor :people_identified
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'Successful')
|
55
54
|
self.successful = attributes[:'Successful']
|
@@ -64,20 +63,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
64
63
|
if attributes.has_key?(:'PeopleIdentified')
|
65
64
|
self.people_identified = attributes[:'PeopleIdentified']
|
66
65
|
end
|
67
|
-
|
68
66
|
end
|
69
67
|
|
70
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
71
69
|
# @return Array for valid properties with the reasons
|
72
70
|
def list_invalid_properties
|
73
71
|
invalid_properties = Array.new
|
74
|
-
|
72
|
+
invalid_properties
|
75
73
|
end
|
76
74
|
|
77
75
|
# Check to see if the all the properties in the model are valid
|
78
76
|
# @return true if the model is valid
|
79
77
|
def valid?
|
80
|
-
|
78
|
+
true
|
81
79
|
end
|
82
80
|
|
83
81
|
# Checks equality by comparing each attribute.
|
@@ -109,10 +107,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
109
107
|
return nil unless attributes.is_a?(Hash)
|
110
108
|
self.class.swagger_types.each_pair do |key, type|
|
111
109
|
if type =~ /\AArray<(.*)>/i
|
112
|
-
# check to ensure the input is an array given that the
|
110
|
+
# check to ensure the input is an array given that the attribute
|
113
111
|
# is documented as an array but the input is not
|
114
112
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
114
|
end
|
117
115
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
116
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -194,7 +192,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
194
192
|
# @return [Hash] Returns the value in the form of hash
|
195
193
|
def _to_hash(value)
|
196
194
|
if value.is_a?(Array)
|
197
|
-
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
198
196
|
elsif value.is_a?(Hash)
|
199
197
|
{}.tap do |hash|
|
200
198
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -207,5 +205,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
207
205
|
end
|
208
206
|
|
209
207
|
end
|
210
|
-
|
211
208
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
24
24
|
# Blue (B) channel pixel value of this color
|
25
25
|
attr_accessor :b
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'R')
|
55
54
|
self.r = attributes[:'R']
|
@@ -62,20 +61,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
62
61
|
if attributes.has_key?(:'B')
|
63
62
|
self.b = attributes[:'B']
|
64
63
|
end
|
65
|
-
|
66
64
|
end
|
67
65
|
|
68
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
69
67
|
# @return Array for valid properties with the reasons
|
70
68
|
def list_invalid_properties
|
71
69
|
invalid_properties = Array.new
|
72
|
-
|
70
|
+
invalid_properties
|
73
71
|
end
|
74
72
|
|
75
73
|
# Check to see if the all the properties in the model are valid
|
76
74
|
# @return true if the model is valid
|
77
75
|
def valid?
|
78
|
-
|
76
|
+
true
|
79
77
|
end
|
80
78
|
|
81
79
|
# Checks equality by comparing each attribute.
|
@@ -107,10 +105,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
107
105
|
return nil unless attributes.is_a?(Hash)
|
108
106
|
self.class.swagger_types.each_pair do |key, type|
|
109
107
|
if type =~ /\AArray<(.*)>/i
|
110
|
-
# check to ensure the input is an array given that the
|
108
|
+
# check to ensure the input is an array given that the attribute
|
111
109
|
# is documented as an array but the input is not
|
112
110
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
114
112
|
end
|
115
113
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
114
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -192,7 +190,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
192
190
|
# @return [Hash] Returns the value in the form of hash
|
193
191
|
def _to_hash(value)
|
194
192
|
if value.is_a?(Array)
|
195
|
-
value.compact.map{ |v| _to_hash(v) }
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
196
194
|
elsif value.is_a?(Hash)
|
197
195
|
{}.tap do |hash|
|
198
196
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -205,5 +203,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
205
203
|
end
|
206
204
|
|
207
205
|
end
|
208
|
-
|
209
206
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -36,7 +36,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
36
36
|
# Confidence score on a range of 0.0 - 1.0 of the accuracy of the detected license plate, with higher scores being better; values about 0.75 are high confidence
|
37
37
|
attr_accessor :license_plate_recognition_confidence_level
|
38
38
|
|
39
|
-
|
40
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
40
|
def self.attribute_map
|
42
41
|
{
|
@@ -69,7 +68,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
69
68
|
return unless attributes.is_a?(Hash)
|
70
69
|
|
71
70
|
# convert string to symbol for hash key
|
72
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
73
72
|
|
74
73
|
if attributes.has_key?(:'LicensePlateText_BestMatch')
|
75
74
|
self.license_plate_text_best_match = attributes[:'LicensePlateText_BestMatch']
|
@@ -98,20 +97,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
98
97
|
if attributes.has_key?(:'LicensePlateRecognitionConfidenceLevel')
|
99
98
|
self.license_plate_recognition_confidence_level = attributes[:'LicensePlateRecognitionConfidenceLevel']
|
100
99
|
end
|
101
|
-
|
102
100
|
end
|
103
101
|
|
104
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
105
103
|
# @return Array for valid properties with the reasons
|
106
104
|
def list_invalid_properties
|
107
105
|
invalid_properties = Array.new
|
108
|
-
|
106
|
+
invalid_properties
|
109
107
|
end
|
110
108
|
|
111
109
|
# Check to see if the all the properties in the model are valid
|
112
110
|
# @return true if the model is valid
|
113
111
|
def valid?
|
114
|
-
|
112
|
+
true
|
115
113
|
end
|
116
114
|
|
117
115
|
# Checks equality by comparing each attribute.
|
@@ -147,10 +145,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
147
145
|
return nil unless attributes.is_a?(Hash)
|
148
146
|
self.class.swagger_types.each_pair do |key, type|
|
149
147
|
if type =~ /\AArray<(.*)>/i
|
150
|
-
# check to ensure the input is an array given that the
|
148
|
+
# check to ensure the input is an array given that the attribute
|
151
149
|
# is documented as an array but the input is not
|
152
150
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
153
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
151
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
154
152
|
end
|
155
153
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
156
154
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -232,7 +230,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
232
230
|
# @return [Hash] Returns the value in the form of hash
|
233
231
|
def _to_hash(value)
|
234
232
|
if value.is_a?(Array)
|
235
|
-
value.compact.map{ |v| _to_hash(v) }
|
233
|
+
value.compact.map { |v| _to_hash(v) }
|
236
234
|
elsif value.is_a?(Hash)
|
237
235
|
{}.tap do |hash|
|
238
236
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -245,5 +243,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
245
243
|
end
|
246
244
|
|
247
245
|
end
|
248
|
-
|
249
246
|
end
|