cloudmersive-image-recognition-api-client 1.4.4 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +20 -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 +270 -24
- 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 +315 -62
- 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 +74 -16
- 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
data/spec/api/filter_api_spec.rb
CHANGED
@@ -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
|
|
@@ -39,19 +39,19 @@ describe 'FilterApi' do
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [String]
|
41
41
|
describe 'filter_black_and_white test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
# unit tests for filter_despeckle
|
48
|
-
# Despeckle
|
48
|
+
# Despeckle to remove point noise from the image
|
49
49
|
# Remove point noise / despeckle the input image
|
50
50
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
52
|
# @return [String]
|
53
53
|
describe 'filter_despeckle test' do
|
54
|
-
it
|
54
|
+
it 'should work' do
|
55
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
56
|
end
|
57
57
|
end
|
@@ -64,7 +64,7 @@ describe 'FilterApi' do
|
|
64
64
|
# @param [Hash] opts the optional parameters
|
65
65
|
# @return [String]
|
66
66
|
describe 'filter_edge_detect test' do
|
67
|
-
it
|
67
|
+
it 'should work' do
|
68
68
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
69
|
end
|
70
70
|
end
|
@@ -78,7 +78,7 @@ describe 'FilterApi' do
|
|
78
78
|
# @param [Hash] opts the optional parameters
|
79
79
|
# @return [String]
|
80
80
|
describe 'filter_emboss test' do
|
81
|
-
it
|
81
|
+
it 'should work' do
|
82
82
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
83
83
|
end
|
84
84
|
end
|
@@ -92,7 +92,7 @@ describe 'FilterApi' do
|
|
92
92
|
# @param [Hash] opts the optional parameters
|
93
93
|
# @return [String]
|
94
94
|
describe 'filter_gaussian_blur test' do
|
95
|
-
it
|
95
|
+
it 'should work' do
|
96
96
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
97
|
end
|
98
98
|
end
|
@@ -107,7 +107,7 @@ describe 'FilterApi' do
|
|
107
107
|
# @param [Hash] opts the optional parameters
|
108
108
|
# @return [String]
|
109
109
|
describe 'filter_motion_blur test' do
|
110
|
-
it
|
110
|
+
it 'should work' do
|
111
111
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
112
112
|
end
|
113
113
|
end
|
@@ -120,7 +120,7 @@ describe 'FilterApi' do
|
|
120
120
|
# @param [Hash] opts the optional parameters
|
121
121
|
# @return [String]
|
122
122
|
describe 'filter_posterize test' do
|
123
|
-
it
|
123
|
+
it 'should work' do
|
124
124
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
125
125
|
end
|
126
126
|
end
|
@@ -133,7 +133,7 @@ describe 'FilterApi' do
|
|
133
133
|
# @param [Hash] opts the optional parameters
|
134
134
|
# @return [String]
|
135
135
|
describe 'filter_swirl test' do
|
136
|
-
it
|
136
|
+
it 'should work' do
|
137
137
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
138
138
|
end
|
139
139
|
end
|
data/spec/api/info_api_spec.rb
CHANGED
@@ -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
|
|
@@ -39,19 +39,19 @@ describe 'InfoApi' do
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [DominantColorResult]
|
41
41
|
describe 'info_get_dominant_color test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
# unit tests for info_get_metadata
|
48
|
-
# Returns the image metadata
|
48
|
+
# Returns the image metadata including EXIF and resolution
|
49
49
|
# Returns the metadata information on the image, including file type, EXIF (if available), and resolution.
|
50
50
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
51
51
|
# @param [Hash] opts the optional parameters
|
52
52
|
# @return [ImageMetadata]
|
53
53
|
describe 'info_get_metadata test' do
|
54
|
-
it
|
54
|
+
it 'should work' do
|
55
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
56
|
end
|
57
57
|
end
|
data/spec/api/nsfw_api_spec.rb
CHANGED
@@ -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,13 +33,13 @@ describe 'NsfwApi' do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# unit tests for nsfw_classify
|
36
|
-
# Not safe for work
|
36
|
+
# Not safe for work NSFW racy content classification
|
37
37
|
# Classify an image into Not Safe For Work (NSFW)/Porn/Racy content and Safe Content.
|
38
38
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [NsfwResult]
|
41
41
|
describe 'nsfw_classify test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
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
|
|
@@ -39,7 +39,7 @@ describe 'RecognizeApi' do
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [ImageDescriptionResponse]
|
41
41
|
describe 'recognize_describe test' do
|
42
|
-
it
|
42
|
+
it 'should work' do
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
44
|
end
|
45
45
|
end
|
@@ -52,31 +52,31 @@ describe 'RecognizeApi' do
|
|
52
52
|
# @option opts [String] :post_processing_effect Optional, post-processing effects to apply to the email, default is None. Possible values are None and BlackAndWhite (force the image into a black and white view to aid in OCR operations).
|
53
53
|
# @return [String]
|
54
54
|
describe 'recognize_detect_and_unskew_document test' do
|
55
|
-
it
|
55
|
+
it 'should work' do
|
56
56
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
# unit tests for recognize_detect_objects
|
61
|
-
# Detect objects
|
61
|
+
# Detect objects including types and locations in an image
|
62
62
|
# Identify the position, size and description of objects in an image, along with a recognition confidence level. Detects both human people and objects in an image.
|
63
63
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
64
64
|
# @param [Hash] opts the optional parameters
|
65
65
|
# @return [ObjectDetectionResult]
|
66
66
|
describe 'recognize_detect_objects test' do
|
67
|
-
it
|
67
|
+
it 'should work' do
|
68
68
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
72
|
# unit tests for recognize_detect_people
|
73
|
-
# Detect people
|
73
|
+
# Detect people including locations in an image
|
74
74
|
# Identify the position, and size of human people in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
|
75
75
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
76
76
|
# @param [Hash] opts the optional parameters
|
77
77
|
# @return [ObjectDetectionResult]
|
78
78
|
describe 'recognize_detect_people test' do
|
79
|
-
it
|
79
|
+
it 'should work' do
|
80
80
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
81
81
|
end
|
82
82
|
end
|
@@ -88,7 +88,7 @@ describe 'RecognizeApi' do
|
|
88
88
|
# @param [Hash] opts the optional parameters
|
89
89
|
# @return [FineTextDetectionResult]
|
90
90
|
describe 'recognize_detect_text_fine test' do
|
91
|
-
it
|
91
|
+
it 'should work' do
|
92
92
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
93
93
|
end
|
94
94
|
end
|
@@ -100,19 +100,19 @@ describe 'RecognizeApi' do
|
|
100
100
|
# @param [Hash] opts the optional parameters
|
101
101
|
# @return [TextDetectionResult]
|
102
102
|
describe 'recognize_detect_text_large test' do
|
103
|
-
it
|
103
|
+
it 'should work' do
|
104
104
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
# unit tests for recognize_detect_vehicle_license_plates
|
109
109
|
# Detect vehicle license plates in an image
|
110
|
-
# Identify the position, and size, and content of vehicle license plates in an image. License plates should be within 15-20 degrees on-axis to the camera.
|
110
|
+
# Identify the position, and size, and content of vehicle license plates in an image. License plates should be within 15-20 degrees on-axis to the camera. Supported image formats are JPG, PNG and BMP.
|
111
111
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
112
112
|
# @param [Hash] opts the optional parameters
|
113
113
|
# @return [VehicleLicensePlateDetectionResult]
|
114
114
|
describe 'recognize_detect_vehicle_license_plates test' do
|
115
|
-
it
|
115
|
+
it 'should work' do
|
116
116
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
117
117
|
end
|
118
118
|
end
|
@@ -125,7 +125,7 @@ describe 'RecognizeApi' do
|
|
125
125
|
# @param [Hash] opts the optional parameters
|
126
126
|
# @return [FindSymbolResult]
|
127
127
|
describe 'recognize_find_symbol test' do
|
128
|
-
it
|
128
|
+
it 'should work' do
|
129
129
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
130
130
|
end
|
131
131
|
end
|
data/spec/api/resize_api_spec.rb
CHANGED
@@ -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
|
|
@@ -34,28 +34,28 @@ describe 'ResizeApi' do
|
|
34
34
|
|
35
35
|
# unit tests for resize_post
|
36
36
|
# Resize an image while preserving aspect ratio
|
37
|
-
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio
|
37
|
+
# Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio. Resize is EXIF-aware.
|
38
38
|
# @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
|
39
39
|
# @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
|
40
40
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
41
41
|
# @param [Hash] opts the optional parameters
|
42
42
|
# @return [String]
|
43
43
|
describe 'resize_post test' do
|
44
|
-
it
|
44
|
+
it 'should work' do
|
45
45
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
# unit tests for resize_resize_simple
|
50
50
|
# Resize an image
|
51
|
-
# Resize an image to a specific width and specific height
|
52
|
-
# @param width
|
53
|
-
# @param height
|
51
|
+
# Resize an image to a specific width and specific height. Resize is EXIF-aware.
|
52
|
+
# @param width Width of the output image - final image will be exactly this width
|
53
|
+
# @param height Height of the output image - final image will be exactly this height
|
54
54
|
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
55
55
|
# @param [Hash] opts the optional parameters
|
56
56
|
# @return [String]
|
57
57
|
describe 'resize_resize_simple test' do
|
58
|
-
it
|
58
|
+
it 'should work' do
|
59
59
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
60
60
|
end
|
61
61
|
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -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
|
|
@@ -51,11 +51,11 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
describe
|
54
|
+
describe 'params_encoding in #build_request' do
|
55
55
|
let(:config) { CloudmersiveImageRecognitionApiClient::Configuration.new }
|
56
56
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new(config) }
|
57
57
|
|
58
|
-
it
|
58
|
+
it 'defaults to nil' do
|
59
59
|
expect(CloudmersiveImageRecognitionApiClient::Configuration.default.params_encoding).to eq(nil)
|
60
60
|
expect(config.params_encoding).to eq(nil)
|
61
61
|
|
@@ -63,18 +63,18 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
63
63
|
expect(request.options[:params_encoding]).to eq(nil)
|
64
64
|
end
|
65
65
|
|
66
|
-
it
|
66
|
+
it 'can be customized' do
|
67
67
|
config.params_encoding = :multi
|
68
68
|
request = api_client.build_request(:get, '/test')
|
69
69
|
expect(request.options[:params_encoding]).to eq(:multi)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
describe
|
73
|
+
describe 'timeout in #build_request' do
|
74
74
|
let(:config) { CloudmersiveImageRecognitionApiClient::Configuration.new }
|
75
75
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new(config) }
|
76
76
|
|
77
|
-
it
|
77
|
+
it 'defaults to 0' do
|
78
78
|
expect(CloudmersiveImageRecognitionApiClient::Configuration.default.timeout).to eq(0)
|
79
79
|
expect(config.timeout).to eq(0)
|
80
80
|
|
@@ -82,88 +82,105 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
82
82
|
expect(request.options[:timeout]).to eq(0)
|
83
83
|
end
|
84
84
|
|
85
|
-
it
|
85
|
+
it 'can be customized' do
|
86
86
|
config.timeout = 100
|
87
87
|
request = api_client.build_request(:get, '/test')
|
88
88
|
expect(request.options[:timeout]).to eq(100)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
92
|
+
describe '#build_request' do
|
93
|
+
let(:config) { CloudmersiveImageRecognitionApiClient::Configuration.new }
|
94
|
+
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new(config) }
|
95
|
+
|
96
|
+
it 'does not send multipart to request' do
|
97
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_not_including(:multipart))
|
98
|
+
api_client.build_request(:get, '/test')
|
99
|
+
end
|
100
|
+
|
101
|
+
context 'when the content type is multipart' do
|
102
|
+
it 'sends multipart to request' do
|
103
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_including(multipart: true))
|
104
|
+
api_client.build_request(:get, '/test', {header_params: { 'Content-Type' => 'multipart/form-data'}})
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe '#deserialize' do
|
93
110
|
it "handles Array<Integer>" do
|
94
111
|
api_client = CloudmersiveImageRecognitionApiClient::ApiClient.new
|
95
|
-
headers = {'Content-Type' => 'application/json'}
|
112
|
+
headers = { 'Content-Type' => 'application/json' }
|
96
113
|
response = double('response', headers: headers, body: '[12, 34]')
|
97
114
|
data = api_client.deserialize(response, 'Array<Integer>')
|
98
115
|
expect(data).to be_instance_of(Array)
|
99
116
|
expect(data).to eq([12, 34])
|
100
117
|
end
|
101
118
|
|
102
|
-
it
|
119
|
+
it 'handles Array<Array<Integer>>' do
|
103
120
|
api_client = CloudmersiveImageRecognitionApiClient::ApiClient.new
|
104
|
-
headers = {'Content-Type' => 'application/json'}
|
121
|
+
headers = { 'Content-Type' => 'application/json' }
|
105
122
|
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
123
|
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
124
|
expect(data).to be_instance_of(Array)
|
108
125
|
expect(data).to eq([[12, 34], [56]])
|
109
126
|
end
|
110
127
|
|
111
|
-
it
|
128
|
+
it 'handles Hash<String, String>' do
|
112
129
|
api_client = CloudmersiveImageRecognitionApiClient::ApiClient.new
|
113
|
-
headers = {'Content-Type' => 'application/json'}
|
130
|
+
headers = { 'Content-Type' => 'application/json' }
|
114
131
|
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
132
|
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
133
|
expect(data).to be_instance_of(Hash)
|
117
|
-
expect(data).to eq(
|
134
|
+
expect(data).to eq(:message => 'Hello')
|
118
135
|
end
|
119
136
|
end
|
120
137
|
|
121
138
|
describe "#object_to_hash" do
|
122
|
-
it
|
139
|
+
it 'ignores nils and includes empty arrays' do
|
123
140
|
# uncomment below to test object_to_hash for model
|
124
|
-
#api_client = CloudmersiveImageRecognitionApiClient::ApiClient.new
|
125
|
-
#_model = CloudmersiveImageRecognitionApiClient::ModelName.new
|
141
|
+
# api_client = CloudmersiveImageRecognitionApiClient::ApiClient.new
|
142
|
+
# _model = CloudmersiveImageRecognitionApiClient::ModelName.new
|
126
143
|
# update the model attribute below
|
127
|
-
#_model.id = 1
|
144
|
+
# _model.id = 1
|
128
145
|
# update the expected value (hash) below
|
129
|
-
#expected = {id: 1, name: '', tags: []}
|
130
|
-
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
146
|
+
# expected = {id: 1, name: '', tags: []}
|
147
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
148
|
end
|
132
149
|
end
|
133
150
|
|
134
|
-
describe
|
151
|
+
describe '#build_collection_param' do
|
135
152
|
let(:param) { ['aa', 'bb', 'cc'] }
|
136
153
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new }
|
137
154
|
|
138
|
-
it
|
155
|
+
it 'works for csv' do
|
139
156
|
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
157
|
end
|
141
158
|
|
142
|
-
it
|
159
|
+
it 'works for ssv' do
|
143
160
|
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
161
|
end
|
145
162
|
|
146
|
-
it
|
163
|
+
it 'works for tsv' do
|
147
164
|
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
165
|
end
|
149
166
|
|
150
|
-
it
|
167
|
+
it 'works for pipes' do
|
151
168
|
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
169
|
end
|
153
170
|
|
154
|
-
it
|
171
|
+
it 'works for multi' do
|
155
172
|
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
173
|
end
|
157
174
|
|
158
|
-
it
|
175
|
+
it 'fails for invalid collection format' do
|
159
176
|
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
177
|
end
|
161
178
|
end
|
162
179
|
|
163
|
-
describe
|
180
|
+
describe '#json_mime?' do
|
164
181
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new }
|
165
182
|
|
166
|
-
it
|
183
|
+
it 'works' do
|
167
184
|
expect(api_client.json_mime?(nil)).to eq false
|
168
185
|
expect(api_client.json_mime?('')).to eq false
|
169
186
|
|
@@ -177,10 +194,10 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
177
194
|
end
|
178
195
|
end
|
179
196
|
|
180
|
-
describe
|
197
|
+
describe '#select_header_accept' do
|
181
198
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new }
|
182
199
|
|
183
|
-
it
|
200
|
+
it 'works' do
|
184
201
|
expect(api_client.select_header_accept(nil)).to be_nil
|
185
202
|
expect(api_client.select_header_accept([])).to be_nil
|
186
203
|
|
@@ -193,10 +210,10 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
193
210
|
end
|
194
211
|
end
|
195
212
|
|
196
|
-
describe
|
213
|
+
describe '#select_header_content_type' do
|
197
214
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new }
|
198
215
|
|
199
|
-
it
|
216
|
+
it 'works' do
|
200
217
|
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
218
|
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
219
|
|
@@ -208,10 +225,10 @@ describe CloudmersiveImageRecognitionApiClient::ApiClient do
|
|
208
225
|
end
|
209
226
|
end
|
210
227
|
|
211
|
-
describe
|
228
|
+
describe '#sanitize_filename' do
|
212
229
|
let(:api_client) { CloudmersiveImageRecognitionApiClient::ApiClient.new }
|
213
230
|
|
214
|
-
it
|
231
|
+
it 'works' do
|
215
232
|
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
233
|
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
234
|
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|