cloudmersive-image-recognition-api-client 1.4.5 → 2.0.4
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 +12 -6
- data/cloudmersive-image-recognition-api-client.gemspec +3 -3
- data/docs/ArtisticApi.md +2 -2
- data/docs/ConvertApi.md +7 -7
- data/docs/CreateHandwritingRequest.md +11 -0
- data/docs/DrawTextInstance.md +1 -1
- data/docs/EditApi.md +255 -9
- data/docs/FaceApi.md +8 -8
- data/docs/FilterApi.md +8 -8
- data/docs/InfoApi.md +2 -2
- data/docs/NsfwApi.md +1 -1
- data/docs/RecognizeApi.md +11 -11
- data/docs/ResizeApi.md +4 -4
- data/docs/TextGenerationApi.md +63 -0
- data/lib/cloudmersive-image-recognition-api-client.rb +3 -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 +30 -37
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +300 -47
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +31 -38
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +34 -42
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +10 -12
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +6 -7
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +37 -45
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +14 -16
- data/lib/cloudmersive-image-recognition-api-client/api/text_generation_api.rb +77 -0
- 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/create_handwriting_request.rb +216 -0
- 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 +7 -10
- 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 +7 -10
- 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 +8 -8
- data/spec/api/edit_api_spec.rb +69 -11
- data/spec/api/face_api_spec.rb +8 -8
- data/spec/api/filter_api_spec.rb +9 -9
- data/spec/api/info_api_spec.rb +3 -3
- data/spec/api/nsfw_api_spec.rb +2 -2
- data/spec/api/recognize_api_spec.rb +10 -10
- data/spec/api/resize_api_spec.rb +5 -5
- data/spec/api/text_generation_api_spec.rb +47 -0
- 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/create_handwriting_request_spec.rb +59 -0
- 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 +5 -6
- 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 +11 -12
- 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 +8 -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 = {}
|
@@ -70,7 +69,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
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,9 +86,8 @@ 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
|
90
|
+
# Resize an image to a specific width and specific height. Resize is EXIF-aware.
|
93
91
|
# @param width Width of the output image - final image will be exactly this width
|
94
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.
|
@@ -97,11 +95,11 @@ module CloudmersiveImageRecognitionApiClient
|
|
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
|
102
|
+
# Resize an image to a specific width and specific height. Resize is EXIF-aware.
|
105
103
|
# @param width Width of the output image - final image will be exactly this width
|
106
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.
|
@@ -109,7 +107,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
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 = {}
|
@@ -138,7 +136,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
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
|
@@ -0,0 +1,77 @@
|
|
1
|
+
=begin
|
2
|
+
#imageapi
|
3
|
+
|
4
|
+
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
5
|
+
|
6
|
+
OpenAPI spec version: v1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module CloudmersiveImageRecognitionApiClient
|
16
|
+
class TextGenerationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create an image of handwriting in PNG format
|
23
|
+
# Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
24
|
+
# @param request Draw text parameters
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Object]
|
27
|
+
def text_generation_create_handwriting_png(request, opts = {})
|
28
|
+
data, _status_code, _headers = text_generation_create_handwriting_png_with_http_info(request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create an image of handwriting in PNG format
|
33
|
+
# Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
34
|
+
# @param request Draw text parameters
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
37
|
+
def text_generation_create_handwriting_png_with_http_info(request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: TextGenerationApi.text_generation_create_handwriting_png ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'request' is set
|
42
|
+
if @api_client.config.client_side_validation && request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling TextGenerationApi.text_generation_create_handwriting_png"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/image/text/create/handwriting/png'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = @api_client.object_to_http_body(request)
|
63
|
+
auth_names = ['Apikey']
|
64
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
65
|
+
:header_params => header_params,
|
66
|
+
:query_params => query_params,
|
67
|
+
:form_params => form_params,
|
68
|
+
:body => post_body,
|
69
|
+
:auth_names => auth_names,
|
70
|
+
:return_type => 'Object')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: TextGenerationApi#text_generation_create_handwriting_png\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
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
|
|
@@ -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
|