aspose_imaging_cloud 1.0.0 → 19.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +224 -61
  3. data/lib/aspose-imaging-cloud.rb +161 -0
  4. data/lib/aspose-imaging-cloud/api/imaging_api.rb +684 -0
  5. data/lib/aspose-imaging-cloud/api_client.rb +357 -0
  6. data/lib/aspose-imaging-cloud/api_error.rb +42 -0
  7. data/lib/{aspose_imaging_cloud → aspose-imaging-cloud}/configuration.rb +236 -166
  8. data/lib/aspose-imaging-cloud/models/big_rectangular_filter_properties.rb +206 -0
  9. data/lib/aspose-imaging-cloud/models/bilateral_smoothing_filter_properties.rb +281 -0
  10. data/lib/aspose-imaging-cloud/models/bmp_properties.rb +202 -0
  11. data/lib/aspose-imaging-cloud/models/convolution_filter_properties.rb +236 -0
  12. data/lib/aspose-imaging-cloud/models/deconvolution_filter_properties.rb +266 -0
  13. data/lib/aspose-imaging-cloud/models/dicom_properties.rb +584 -0
  14. data/lib/aspose-imaging-cloud/models/disc_usage.rb +222 -0
  15. data/lib/aspose-imaging-cloud/models/djvu_properties.rb +232 -0
  16. data/lib/aspose-imaging-cloud/models/dng_properties.rb +329 -0
  17. data/lib/aspose-imaging-cloud/models/error.rb +232 -0
  18. data/lib/aspose-imaging-cloud/models/error_details.rb +217 -0
  19. data/lib/aspose-imaging-cloud/models/exif_data.rb +1560 -0
  20. data/lib/aspose-imaging-cloud/models/file_version.rb +277 -0
  21. data/lib/aspose-imaging-cloud/models/file_versions.rb +204 -0
  22. data/lib/aspose-imaging-cloud/models/files_list.rb +204 -0
  23. data/lib/aspose-imaging-cloud/models/files_upload_result.rb +216 -0
  24. data/lib/aspose-imaging-cloud/models/filter_properties_base.rb +206 -0
  25. data/lib/aspose-imaging-cloud/models/gauss_wiener_filter_properties.rb +296 -0
  26. data/lib/aspose-imaging-cloud/models/gaussian_blur_filter_properties.rb +266 -0
  27. data/lib/aspose-imaging-cloud/models/gif_properties.rb +247 -0
  28. data/lib/aspose-imaging-cloud/models/image_duplicates.rb +204 -0
  29. data/lib/aspose-imaging-cloud/models/image_duplicates_set.rb +204 -0
  30. data/lib/aspose-imaging-cloud/models/image_features.rb +257 -0
  31. data/lib/aspose-imaging-cloud/models/imaging_response.rb +412 -0
  32. data/lib/aspose-imaging-cloud/models/jfif_data.rb +247 -0
  33. data/lib/aspose-imaging-cloud/models/jpeg2000_properties.rb +214 -0
  34. data/lib/aspose-imaging-cloud/models/jpeg_exif_data.rb +1738 -0
  35. data/lib/aspose-imaging-cloud/models/jpeg_properties.rb +222 -0
  36. data/lib/aspose-imaging-cloud/models/median_filter_properties.rb +221 -0
  37. data/lib/aspose-imaging-cloud/models/motion_wiener_filter_properties.rb +311 -0
  38. data/lib/aspose-imaging-cloud/models/object_exist.rb +222 -0
  39. data/lib/aspose-imaging-cloud/models/odg_metadata.rb +372 -0
  40. data/lib/aspose-imaging-cloud/models/odg_page.rb +222 -0
  41. data/lib/aspose-imaging-cloud/models/odg_properties.rb +229 -0
  42. data/lib/aspose-imaging-cloud/models/png_properties.rb +192 -0
  43. data/lib/aspose-imaging-cloud/models/psd_properties.rb +242 -0
  44. data/lib/aspose-imaging-cloud/models/requests/add_search_image_request.rb +91 -0
  45. data/lib/aspose-imaging-cloud/models/requests/append_tiff_request.rb +88 -0
  46. data/lib/aspose-imaging-cloud/models/requests/compare_images_request.rb +94 -0
  47. data/lib/aspose-imaging-cloud/models/requests/convert_tiff_to_fax_request.rb +80 -0
  48. data/lib/aspose-imaging-cloud/models/requests/copy_file_request.rb +91 -0
  49. data/lib/aspose-imaging-cloud/models/requests/copy_folder_request.rb +88 -0
  50. data/lib/aspose-imaging-cloud/models/requests/create_cropped_image_request.rb +121 -0
  51. data/lib/aspose-imaging-cloud/models/requests/create_folder_request.rb +77 -0
  52. data/lib/aspose-imaging-cloud/models/requests/create_image_features_request.rb +89 -0
  53. data/lib/aspose-imaging-cloud/models/requests/create_image_frame_request.rb +112 -0
  54. data/lib/aspose-imaging-cloud/models/requests/create_image_search_request.rb +79 -0
  55. data/lib/aspose-imaging-cloud/models/requests/create_image_tag_request.rb +96 -0
  56. data/lib/aspose-imaging-cloud/models/requests/create_modified_bmp_request.rb +108 -0
  57. data/lib/aspose-imaging-cloud/models/requests/create_modified_emf_request.rb +127 -0
  58. data/lib/aspose-imaging-cloud/models/requests/create_modified_gif_request.rb +102 -0
  59. data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg2000_request.rb +95 -0
  60. data/lib/aspose-imaging-cloud/models/requests/create_modified_jpeg_request.rb +90 -0
  61. data/lib/aspose-imaging-cloud/models/requests/create_modified_psd_request.rb +90 -0
  62. data/lib/aspose-imaging-cloud/models/requests/create_modified_svg_request.rb +114 -0
  63. data/lib/aspose-imaging-cloud/models/requests/create_modified_tiff_request.rb +104 -0
  64. data/lib/aspose-imaging-cloud/models/requests/create_modified_web_p_request.rb +116 -0
  65. data/lib/aspose-imaging-cloud/models/requests/create_modified_wmf_request.rb +127 -0
  66. data/lib/aspose-imaging-cloud/models/requests/create_resized_image_request.rb +105 -0
  67. data/lib/aspose-imaging-cloud/models/requests/create_rotate_flipped_image_request.rb +97 -0
  68. data/lib/aspose-imaging-cloud/models/requests/create_saved_image_as_request.rb +89 -0
  69. data/lib/aspose-imaging-cloud/models/requests/create_updated_image_request.rb +145 -0
  70. data/lib/aspose-imaging-cloud/models/requests/create_web_site_image_features_request.rb +88 -0
  71. data/lib/aspose-imaging-cloud/models/requests/crop_image_request.rb +120 -0
  72. data/lib/aspose-imaging-cloud/models/requests/delete_file_request.rb +80 -0
  73. data/lib/aspose-imaging-cloud/models/requests/delete_folder_request.rb +80 -0
  74. data/lib/aspose-imaging-cloud/models/requests/delete_image_features_request.rb +88 -0
  75. data/lib/aspose-imaging-cloud/models/requests/delete_image_search_request.rb +80 -0
  76. data/lib/aspose-imaging-cloud/models/requests/delete_search_image_request.rb +88 -0
  77. data/lib/aspose-imaging-cloud/models/requests/download_file_request.rb +80 -0
  78. data/lib/aspose-imaging-cloud/models/requests/extract_image_features_request.rb +91 -0
  79. data/lib/aspose-imaging-cloud/models/requests/extract_image_frame_properties_request.rb +82 -0
  80. data/lib/aspose-imaging-cloud/models/requests/extract_image_properties_request.rb +75 -0
  81. data/lib/aspose-imaging-cloud/models/requests/filter_effect_image_request.rb +103 -0
  82. data/lib/aspose-imaging-cloud/models/requests/find_image_duplicates_request.rb +88 -0
  83. data/lib/aspose-imaging-cloud/models/requests/find_images_by_tags_request.rb +104 -0
  84. data/lib/aspose-imaging-cloud/models/requests/find_similar_images_request.rb +102 -0
  85. data/lib/aspose-imaging-cloud/models/requests/get_disc_usage_request.rb +70 -0
  86. data/lib/aspose-imaging-cloud/models/requests/get_file_versions_request.rb +77 -0
  87. data/lib/aspose-imaging-cloud/models/requests/get_files_list_request.rb +77 -0
  88. data/lib/aspose-imaging-cloud/models/requests/get_image_features_request.rb +88 -0
  89. data/lib/aspose-imaging-cloud/models/requests/get_image_frame_properties_request.rb +87 -0
  90. data/lib/aspose-imaging-cloud/models/requests/get_image_frame_request.rb +111 -0
  91. data/lib/aspose-imaging-cloud/models/requests/get_image_properties_request.rb +80 -0
  92. data/lib/aspose-imaging-cloud/models/requests/get_image_search_status_request.rb +80 -0
  93. data/lib/aspose-imaging-cloud/models/requests/get_search_image_request.rb +88 -0
  94. data/lib/aspose-imaging-cloud/models/requests/http_request.rb +50 -0
  95. data/lib/aspose-imaging-cloud/models/requests/imaging_request.rb +101 -0
  96. data/lib/aspose-imaging-cloud/models/requests/modify_bmp_request.rb +107 -0
  97. data/lib/aspose-imaging-cloud/models/requests/modify_emf_request.rb +126 -0
  98. data/lib/aspose-imaging-cloud/models/requests/modify_gif_request.rb +101 -0
  99. data/lib/aspose-imaging-cloud/models/requests/modify_jpeg2000_request.rb +94 -0
  100. data/lib/aspose-imaging-cloud/models/requests/modify_jpeg_request.rb +89 -0
  101. data/lib/aspose-imaging-cloud/models/requests/modify_psd_request.rb +89 -0
  102. data/lib/aspose-imaging-cloud/models/requests/modify_svg_request.rb +113 -0
  103. data/lib/aspose-imaging-cloud/models/requests/modify_tiff_request.rb +103 -0
  104. data/lib/aspose-imaging-cloud/models/requests/modify_web_p_request.rb +115 -0
  105. data/lib/aspose-imaging-cloud/models/requests/modify_wmf_request.rb +126 -0
  106. data/lib/aspose-imaging-cloud/models/requests/move_file_request.rb +91 -0
  107. data/lib/aspose-imaging-cloud/models/requests/move_folder_request.rb +88 -0
  108. data/lib/aspose-imaging-cloud/models/requests/object_exists_request.rb +80 -0
  109. data/lib/aspose-imaging-cloud/models/requests/resize_image_request.rb +104 -0
  110. data/lib/aspose-imaging-cloud/models/requests/rotate_flip_image_request.rb +96 -0
  111. data/lib/aspose-imaging-cloud/models/requests/save_image_as_request.rb +88 -0
  112. data/lib/aspose-imaging-cloud/models/requests/storage_exists_request.rb +74 -0
  113. data/lib/aspose-imaging-cloud/models/requests/update_image_features_request.rb +91 -0
  114. data/lib/aspose-imaging-cloud/models/requests/update_image_request.rb +144 -0
  115. data/lib/aspose-imaging-cloud/models/requests/update_search_image_request.rb +91 -0
  116. data/lib/aspose-imaging-cloud/models/requests/upload_file_request.rb +86 -0
  117. data/lib/aspose-imaging-cloud/models/search_context_status.rb +212 -0
  118. data/lib/aspose-imaging-cloud/models/search_result.rb +217 -0
  119. data/lib/aspose-imaging-cloud/models/search_results_set.rb +204 -0
  120. data/lib/aspose-imaging-cloud/models/sharpen_filter_properties.rb +266 -0
  121. data/lib/aspose-imaging-cloud/models/small_rectangular_filter_properties.rb +206 -0
  122. data/lib/aspose-imaging-cloud/models/storage_exist.rb +207 -0
  123. data/lib/aspose-imaging-cloud/models/storage_file.rb +252 -0
  124. data/lib/aspose-imaging-cloud/models/svg_properties.rb +202 -0
  125. data/lib/aspose-imaging-cloud/models/tiff_frame.rb +242 -0
  126. data/lib/aspose-imaging-cloud/models/tiff_options.rb +734 -0
  127. data/lib/aspose-imaging-cloud/models/tiff_properties.rb +224 -0
  128. data/lib/aspose-imaging-cloud/models/web_p_properties.rb +252 -0
  129. data/lib/aspose-imaging-cloud/version.rb +15 -0
  130. metadata +149 -129
  131. data/LICENSE +0 -22
  132. data/aspose_imaging_cloud.gemspec +0 -26
  133. data/lib/aspose_imaging_cloud.rb +0 -43
  134. data/lib/aspose_imaging_cloud/api/imaging_api.rb +0 -1776
  135. data/lib/aspose_imaging_cloud/api_client.rb +0 -335
  136. data/lib/aspose_imaging_cloud/api_error.rb +0 -24
  137. data/lib/aspose_imaging_cloud/models/base_object.rb +0 -86
  138. data/lib/aspose_imaging_cloud/models/base_response.rb +0 -53
  139. data/lib/aspose_imaging_cloud/models/bmp_properties.rb +0 -37
  140. data/lib/aspose_imaging_cloud/models/exif_data.rb +0 -855
  141. data/lib/aspose_imaging_cloud/models/gif_properties.rb +0 -53
  142. data/lib/aspose_imaging_cloud/models/imaging_response.rb +0 -149
  143. data/lib/aspose_imaging_cloud/models/jfif_data.rb +0 -61
  144. data/lib/aspose_imaging_cloud/models/jpeg_exif_data.rb +0 -991
  145. data/lib/aspose_imaging_cloud/models/jpeg_properties.rb +0 -53
  146. data/lib/aspose_imaging_cloud/models/psd_properties.rb +0 -61
  147. data/lib/aspose_imaging_cloud/models/tiff_frame.rb +0 -61
  148. data/lib/aspose_imaging_cloud/models/tiff_options.rb +0 -419
  149. data/lib/aspose_imaging_cloud/models/tiff_properties.rb +0 -55
  150. data/lib/aspose_imaging_cloud/version.rb +0 -3
  151. data/test/data/TestDemo.tif +0 -0
  152. data/test/data/aspose.jpg +0 -0
  153. data/test/data/aspose_imaging_for_cloud.png +0 -0
  154. data/test/data/demo.tif +0 -0
  155. data/test/data/sample-multi.tif +0 -0
  156. data/test/data/sample.bmp +0 -0
  157. data/test/data/sample.gif +0 -0
  158. data/test/data/sample.psd +0 -0
  159. data/test/data/sample.tif +0 -0
  160. data/test/data/test.bmp +0 -0
  161. data/test/imaging_tests.rb +0 -291
@@ -0,0 +1,684 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="imaging_api.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'uri'
28
+
29
+ module AsposeImagingCloud
30
+ # Aspose.Imaging Cloud API
31
+ class ImagingApi
32
+ attr_accessor :api_client
33
+
34
+ # Initializes a new instance of the ImagingApi class.
35
+ # @param [String] app_key Key to access the server.
36
+ # @param [String] app_sid ID to access the server.
37
+ # @param [String] base_url Server URL.
38
+ # @param [String] api_version Api version.
39
+ # @param [Object] debug Debug switch [true, false].
40
+ def initialize(app_key = nil, app_sid = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
41
+ @api_client = ApiClient.new(app_key, app_sid, base_url, api_version, debug)
42
+ end
43
+
44
+ # Add image and images features to search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
45
+ # @param [add_search_imageRequest] request Request object.
46
+ # @return [nil]
47
+ def add_search_image(request)
48
+ http_request = request.to_http_info(@api_client.config)
49
+ make_request(http_request, :POST, nil)
50
+ nil
51
+ end
52
+
53
+ # Appends existing TIFF image to another existing TIFF image (i.e. merges TIFF images).
54
+ # @param [append_tiffRequest] request Request object.
55
+ # @return [nil]
56
+ def append_tiff(request)
57
+ http_request = request.to_http_info(@api_client.config)
58
+ make_request(http_request, :POST, nil)
59
+ nil
60
+ end
61
+
62
+ # Compare two images. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
63
+ # @param [compare_imagesRequest] request Request object.
64
+ # @return [SearchResultsSet]
65
+ def compare_images(request)
66
+ http_request = request.to_http_info(@api_client.config)
67
+ make_request(http_request, :POST, 'SearchResultsSet')
68
+ end
69
+
70
+ # Update parameters of existing TIFF image accordingly to fax parameters.
71
+ # @param [convert_tiff_to_faxRequest] request Request object.
72
+ # @return [File]
73
+ def convert_tiff_to_fax(request)
74
+ http_request = request.to_http_info(@api_client.config)
75
+ make_request(http_request, :GET, 'File')
76
+ end
77
+
78
+ # Copy file
79
+ # @param [copy_fileRequest] request Request object.
80
+ # @return [nil]
81
+ def copy_file(request)
82
+ http_request = request.to_http_info(@api_client.config)
83
+ make_request(http_request, :PUT, nil)
84
+ nil
85
+ end
86
+
87
+ # Copy folder
88
+ # @param [copy_folderRequest] request Request object.
89
+ # @return [nil]
90
+ def copy_folder(request)
91
+ http_request = request.to_http_info(@api_client.config)
92
+ make_request(http_request, :PUT, nil)
93
+ nil
94
+ end
95
+
96
+ # Crop an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
97
+ # @param [create_cropped_imageRequest] request Request object.
98
+ # @return [File]
99
+ def create_cropped_image(request)
100
+ http_request = request.to_http_info(@api_client.config)
101
+ make_request(http_request, :POST, 'File')
102
+ end
103
+
104
+ # Create the folder
105
+ # @param [create_folderRequest] request Request object.
106
+ # @return [nil]
107
+ def create_folder(request)
108
+ http_request = request.to_http_info(@api_client.config)
109
+ make_request(http_request, :PUT, nil)
110
+ nil
111
+ end
112
+
113
+ # Extract images features and add them to search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
114
+ # @param [create_image_featuresRequest] request Request object.
115
+ # @return [nil]
116
+ def create_image_features(request)
117
+ http_request = request.to_http_info(@api_client.config)
118
+ make_request(http_request, :POST, nil)
119
+ nil
120
+ end
121
+
122
+ # Get separate frame from existing TIFF image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
123
+ # @param [create_image_frameRequest] request Request object.
124
+ # @return [File]
125
+ def create_image_frame(request)
126
+ http_request = request.to_http_info(@api_client.config)
127
+ make_request(http_request, :POST, 'File')
128
+ end
129
+
130
+ # Create new search context.
131
+ # @param [create_image_searchRequest] request Request object.
132
+ # @return [SearchContextStatus]
133
+ def create_image_search(request)
134
+ http_request = request.to_http_info(@api_client.config)
135
+ make_request(http_request, :POST, 'SearchContextStatus')
136
+ end
137
+
138
+ # Add tag and reference image to search context. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
139
+ # @param [create_image_tagRequest] request Request object.
140
+ # @return [nil]
141
+ def create_image_tag(request)
142
+ http_request = request.to_http_info(@api_client.config)
143
+ make_request(http_request, :POST, nil)
144
+ nil
145
+ end
146
+
147
+ # Update parameters of BMP image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
148
+ # @param [create_modified_bmpRequest] request Request object.
149
+ # @return [File]
150
+ def create_modified_bmp(request)
151
+ http_request = request.to_http_info(@api_client.config)
152
+ make_request(http_request, :POST, 'File')
153
+ end
154
+
155
+ # Process existing EMF imaging using given parameters. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
156
+ # @param [create_modified_emfRequest] request Request object.
157
+ # @return [File]
158
+ def create_modified_emf(request)
159
+ http_request = request.to_http_info(@api_client.config)
160
+ make_request(http_request, :POST, 'File')
161
+ end
162
+
163
+ # Update parameters of GIF image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
164
+ # @param [create_modified_gifRequest] request Request object.
165
+ # @return [File]
166
+ def create_modified_gif(request)
167
+ http_request = request.to_http_info(@api_client.config)
168
+ make_request(http_request, :POST, 'File')
169
+ end
170
+
171
+ # Update parameters of JPEG image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
172
+ # @param [create_modified_jpegRequest] request Request object.
173
+ # @return [File]
174
+ def create_modified_jpeg(request)
175
+ http_request = request.to_http_info(@api_client.config)
176
+ make_request(http_request, :POST, 'File')
177
+ end
178
+
179
+ # Update parameters of JPEG2000 image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
180
+ # @param [create_modified_jpeg2000Request] request Request object.
181
+ # @return [File]
182
+ def create_modified_jpeg2000(request)
183
+ http_request = request.to_http_info(@api_client.config)
184
+ make_request(http_request, :POST, 'File')
185
+ end
186
+
187
+ # Update parameters of PSD image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
188
+ # @param [create_modified_psdRequest] request Request object.
189
+ # @return [File]
190
+ def create_modified_psd(request)
191
+ http_request = request.to_http_info(@api_client.config)
192
+ make_request(http_request, :POST, 'File')
193
+ end
194
+
195
+ # Update parameters of SVG image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
196
+ # @param [create_modified_svgRequest] request Request object.
197
+ # @return [File]
198
+ def create_modified_svg(request)
199
+ http_request = request.to_http_info(@api_client.config)
200
+ make_request(http_request, :POST, 'File')
201
+ end
202
+
203
+ # Update parameters of TIFF image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
204
+ # @param [create_modified_tiffRequest] request Request object.
205
+ # @return [File]
206
+ def create_modified_tiff(request)
207
+ http_request = request.to_http_info(@api_client.config)
208
+ make_request(http_request, :POST, 'File')
209
+ end
210
+
211
+ # Update parameters of WEBP image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
212
+ # @param [create_modified_web_pRequest] request Request object.
213
+ # @return [File]
214
+ def create_modified_web_p(request)
215
+ http_request = request.to_http_info(@api_client.config)
216
+ make_request(http_request, :POST, 'File')
217
+ end
218
+
219
+ # Process existing WMF image using given parameters. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
220
+ # @param [create_modified_wmfRequest] request Request object.
221
+ # @return [File]
222
+ def create_modified_wmf(request)
223
+ http_request = request.to_http_info(@api_client.config)
224
+ make_request(http_request, :POST, 'File')
225
+ end
226
+
227
+ # Resize an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
228
+ # @param [create_resized_imageRequest] request Request object.
229
+ # @return [File]
230
+ def create_resized_image(request)
231
+ http_request = request.to_http_info(@api_client.config)
232
+ make_request(http_request, :POST, 'File')
233
+ end
234
+
235
+ # Rotate and/or flip an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
236
+ # @param [create_rotate_flipped_imageRequest] request Request object.
237
+ # @return [File]
238
+ def create_rotate_flipped_image(request)
239
+ http_request = request.to_http_info(@api_client.config)
240
+ make_request(http_request, :POST, 'File')
241
+ end
242
+
243
+ # Export existing image to another format. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
244
+ # @param [create_saved_image_asRequest] request Request object.
245
+ # @return [File]
246
+ def create_saved_image_as(request)
247
+ http_request = request.to_http_info(@api_client.config)
248
+ make_request(http_request, :POST, 'File')
249
+ end
250
+
251
+ # Perform scaling, cropping and flipping of an image in a single request. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
252
+ # @param [create_updated_imageRequest] request Request object.
253
+ # @return [File]
254
+ def create_updated_image(request)
255
+ http_request = request.to_http_info(@api_client.config)
256
+ make_request(http_request, :POST, 'File')
257
+ end
258
+
259
+ # Extract images features from web page and add them to search context
260
+ # @param [create_web_site_image_featuresRequest] request Request object.
261
+ # @return [nil]
262
+ def create_web_site_image_features(request)
263
+ http_request = request.to_http_info(@api_client.config)
264
+ make_request(http_request, :POST, nil)
265
+ nil
266
+ end
267
+
268
+ # Crop an existing image.
269
+ # @param [crop_imageRequest] request Request object.
270
+ # @return [File]
271
+ def crop_image(request)
272
+ http_request = request.to_http_info(@api_client.config)
273
+ make_request(http_request, :GET, 'File')
274
+ end
275
+
276
+ # Delete file
277
+ # @param [delete_fileRequest] request Request object.
278
+ # @return [nil]
279
+ def delete_file(request)
280
+ http_request = request.to_http_info(@api_client.config)
281
+ make_request(http_request, :DELETE, nil)
282
+ nil
283
+ end
284
+
285
+ # Delete folder
286
+ # @param [delete_folderRequest] request Request object.
287
+ # @return [nil]
288
+ def delete_folder(request)
289
+ http_request = request.to_http_info(@api_client.config)
290
+ make_request(http_request, :DELETE, nil)
291
+ nil
292
+ end
293
+
294
+ # Deletes image features from search context.
295
+ # @param [delete_image_featuresRequest] request Request object.
296
+ # @return [nil]
297
+ def delete_image_features(request)
298
+ http_request = request.to_http_info(@api_client.config)
299
+ make_request(http_request, :DELETE, nil)
300
+ nil
301
+ end
302
+
303
+ # Deletes the search context.
304
+ # @param [delete_image_searchRequest] request Request object.
305
+ # @return [nil]
306
+ def delete_image_search(request)
307
+ http_request = request.to_http_info(@api_client.config)
308
+ make_request(http_request, :DELETE, nil)
309
+ nil
310
+ end
311
+
312
+ # Delete image and images features from search context
313
+ # @param [delete_search_imageRequest] request Request object.
314
+ # @return [nil]
315
+ def delete_search_image(request)
316
+ http_request = request.to_http_info(@api_client.config)
317
+ make_request(http_request, :DELETE, nil)
318
+ nil
319
+ end
320
+
321
+ # Download file
322
+ # @param [download_fileRequest] request Request object.
323
+ # @return [File]
324
+ def download_file(request)
325
+ http_request = request.to_http_info(@api_client.config)
326
+ make_request(http_request, :GET, 'File')
327
+ end
328
+
329
+ # Extract features from image without adding to search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
330
+ # @param [extract_image_featuresRequest] request Request object.
331
+ # @return [ImageFeatures]
332
+ def extract_image_features(request)
333
+ http_request = request.to_http_info(@api_client.config)
334
+ make_request(http_request, :GET, 'ImageFeatures')
335
+ end
336
+
337
+ # Get separate frame properties of existing TIFF image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
338
+ # @param [extract_image_frame_propertiesRequest] request Request object.
339
+ # @return [ImagingResponse]
340
+ def extract_image_frame_properties(request)
341
+ http_request = request.to_http_info(@api_client.config)
342
+ make_request(http_request, :POST, 'ImagingResponse')
343
+ end
344
+
345
+ # Get properties of an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
346
+ # @param [extract_image_propertiesRequest] request Request object.
347
+ # @return [ImagingResponse]
348
+ def extract_image_properties(request)
349
+ http_request = request.to_http_info(@api_client.config)
350
+ make_request(http_request, :POST, 'ImagingResponse')
351
+ end
352
+
353
+ # Apply filtering effects to an existing image.
354
+ # @param [filter_effect_imageRequest] request Request object.
355
+ # @return [File]
356
+ def filter_effect_image(request)
357
+ http_request = request.to_http_info(@api_client.config)
358
+ make_request(http_request, :PUT, 'File')
359
+ end
360
+
361
+ # Find images duplicates.
362
+ # @param [find_image_duplicatesRequest] request Request object.
363
+ # @return [ImageDuplicatesSet]
364
+ def find_image_duplicates(request)
365
+ http_request = request.to_http_info(@api_client.config)
366
+ make_request(http_request, :GET, 'ImageDuplicatesSet')
367
+ end
368
+
369
+ # Find images by tags. Tags JSON string is passed as zero-indexed multipart/form-data content or as raw body stream.
370
+ # @param [find_images_by_tagsRequest] request Request object.
371
+ # @return [SearchResultsSet]
372
+ def find_images_by_tags(request)
373
+ http_request = request.to_http_info(@api_client.config)
374
+ make_request(http_request, :POST, 'SearchResultsSet')
375
+ end
376
+
377
+ # Find similar images. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
378
+ # @param [find_similar_imagesRequest] request Request object.
379
+ # @return [SearchResultsSet]
380
+ def find_similar_images(request)
381
+ http_request = request.to_http_info(@api_client.config)
382
+ make_request(http_request, :GET, 'SearchResultsSet')
383
+ end
384
+
385
+ # Get disc usage
386
+ # @param [get_disc_usageRequest] request Request object.
387
+ # @return [DiscUsage]
388
+ def get_disc_usage(request)
389
+ http_request = request.to_http_info(@api_client.config)
390
+ make_request(http_request, :GET, 'DiscUsage')
391
+ end
392
+
393
+ # Get file versions
394
+ # @param [get_file_versionsRequest] request Request object.
395
+ # @return [FileVersions]
396
+ def get_file_versions(request)
397
+ http_request = request.to_http_info(@api_client.config)
398
+ make_request(http_request, :GET, 'FileVersions')
399
+ end
400
+
401
+ # Get all files and folders within a folder
402
+ # @param [get_files_listRequest] request Request object.
403
+ # @return [FilesList]
404
+ def get_files_list(request)
405
+ http_request = request.to_http_info(@api_client.config)
406
+ make_request(http_request, :GET, 'FilesList')
407
+ end
408
+
409
+ # Gets image features from search context.
410
+ # @param [get_image_featuresRequest] request Request object.
411
+ # @return [ImageFeatures]
412
+ def get_image_features(request)
413
+ http_request = request.to_http_info(@api_client.config)
414
+ make_request(http_request, :GET, 'ImageFeatures')
415
+ end
416
+
417
+ # Get separate frame from existing TIFF image.
418
+ # @param [get_image_frameRequest] request Request object.
419
+ # @return [File]
420
+ def get_image_frame(request)
421
+ http_request = request.to_http_info(@api_client.config)
422
+ make_request(http_request, :GET, 'File')
423
+ end
424
+
425
+ # Get separate frame properties of existing TIFF image.
426
+ # @param [get_image_frame_propertiesRequest] request Request object.
427
+ # @return [ImagingResponse]
428
+ def get_image_frame_properties(request)
429
+ http_request = request.to_http_info(@api_client.config)
430
+ make_request(http_request, :GET, 'ImagingResponse')
431
+ end
432
+
433
+ # Get properties of an image.
434
+ # @param [get_image_propertiesRequest] request Request object.
435
+ # @return [ImagingResponse]
436
+ def get_image_properties(request)
437
+ http_request = request.to_http_info(@api_client.config)
438
+ make_request(http_request, :GET, 'ImagingResponse')
439
+ end
440
+
441
+ # Gets the search context status.
442
+ # @param [get_image_search_statusRequest] request Request object.
443
+ # @return [SearchContextStatus]
444
+ def get_image_search_status(request)
445
+ http_request = request.to_http_info(@api_client.config)
446
+ make_request(http_request, :GET, 'SearchContextStatus')
447
+ end
448
+
449
+ # Get image from search context
450
+ # @param [get_search_imageRequest] request Request object.
451
+ # @return [File]
452
+ def get_search_image(request)
453
+ http_request = request.to_http_info(@api_client.config)
454
+ make_request(http_request, :GET, 'File')
455
+ end
456
+
457
+ # Update parameters of existing BMP image.
458
+ # @param [modify_bmpRequest] request Request object.
459
+ # @return [File]
460
+ def modify_bmp(request)
461
+ http_request = request.to_http_info(@api_client.config)
462
+ make_request(http_request, :GET, 'File')
463
+ end
464
+
465
+ # Process existing EMF imaging using given parameters.
466
+ # @param [modify_emfRequest] request Request object.
467
+ # @return [File]
468
+ def modify_emf(request)
469
+ http_request = request.to_http_info(@api_client.config)
470
+ make_request(http_request, :GET, 'File')
471
+ end
472
+
473
+ # Update parameters of existing GIF image.
474
+ # @param [modify_gifRequest] request Request object.
475
+ # @return [File]
476
+ def modify_gif(request)
477
+ http_request = request.to_http_info(@api_client.config)
478
+ make_request(http_request, :GET, 'File')
479
+ end
480
+
481
+ # Update parameters of existing JPEG image.
482
+ # @param [modify_jpegRequest] request Request object.
483
+ # @return [File]
484
+ def modify_jpeg(request)
485
+ http_request = request.to_http_info(@api_client.config)
486
+ make_request(http_request, :GET, 'File')
487
+ end
488
+
489
+ # Update parameters of existing JPEG2000 image.
490
+ # @param [modify_jpeg2000Request] request Request object.
491
+ # @return [File]
492
+ def modify_jpeg2000(request)
493
+ http_request = request.to_http_info(@api_client.config)
494
+ make_request(http_request, :GET, 'File')
495
+ end
496
+
497
+ # Update parameters of existing PSD image.
498
+ # @param [modify_psdRequest] request Request object.
499
+ # @return [File]
500
+ def modify_psd(request)
501
+ http_request = request.to_http_info(@api_client.config)
502
+ make_request(http_request, :GET, 'File')
503
+ end
504
+
505
+ # Update parameters of existing SVG image.
506
+ # @param [modify_svgRequest] request Request object.
507
+ # @return [File]
508
+ def modify_svg(request)
509
+ http_request = request.to_http_info(@api_client.config)
510
+ make_request(http_request, :GET, 'File')
511
+ end
512
+
513
+ # Update parameters of existing TIFF image.
514
+ # @param [modify_tiffRequest] request Request object.
515
+ # @return [File]
516
+ def modify_tiff(request)
517
+ http_request = request.to_http_info(@api_client.config)
518
+ make_request(http_request, :GET, 'File')
519
+ end
520
+
521
+ # Update parameters of existing WEBP image.
522
+ # @param [modify_web_pRequest] request Request object.
523
+ # @return [File]
524
+ def modify_web_p(request)
525
+ http_request = request.to_http_info(@api_client.config)
526
+ make_request(http_request, :GET, 'File')
527
+ end
528
+
529
+ # Process existing WMF image using given parameters.
530
+ # @param [modify_wmfRequest] request Request object.
531
+ # @return [File]
532
+ def modify_wmf(request)
533
+ http_request = request.to_http_info(@api_client.config)
534
+ make_request(http_request, :GET, 'File')
535
+ end
536
+
537
+ # Move file
538
+ # @param [move_fileRequest] request Request object.
539
+ # @return [nil]
540
+ def move_file(request)
541
+ http_request = request.to_http_info(@api_client.config)
542
+ make_request(http_request, :PUT, nil)
543
+ nil
544
+ end
545
+
546
+ # Move folder
547
+ # @param [move_folderRequest] request Request object.
548
+ # @return [nil]
549
+ def move_folder(request)
550
+ http_request = request.to_http_info(@api_client.config)
551
+ make_request(http_request, :PUT, nil)
552
+ nil
553
+ end
554
+
555
+ # Check if file or folder exists
556
+ # @param [object_existsRequest] request Request object.
557
+ # @return [ObjectExist]
558
+ def object_exists(request)
559
+ http_request = request.to_http_info(@api_client.config)
560
+ make_request(http_request, :GET, 'ObjectExist')
561
+ end
562
+
563
+ # Resize an existing image.
564
+ # @param [resize_imageRequest] request Request object.
565
+ # @return [File]
566
+ def resize_image(request)
567
+ http_request = request.to_http_info(@api_client.config)
568
+ make_request(http_request, :GET, 'File')
569
+ end
570
+
571
+ # Rotate and/or flip an existing image.
572
+ # @param [rotate_flip_imageRequest] request Request object.
573
+ # @return [File]
574
+ def rotate_flip_image(request)
575
+ http_request = request.to_http_info(@api_client.config)
576
+ make_request(http_request, :GET, 'File')
577
+ end
578
+
579
+ # Export existing image to another format.
580
+ # @param [save_image_asRequest] request Request object.
581
+ # @return [File]
582
+ def save_image_as(request)
583
+ http_request = request.to_http_info(@api_client.config)
584
+ make_request(http_request, :GET, 'File')
585
+ end
586
+
587
+ # Check if storage exists
588
+ # @param [storage_existsRequest] request Request object.
589
+ # @return [StorageExist]
590
+ def storage_exists(request)
591
+ http_request = request.to_http_info(@api_client.config)
592
+ make_request(http_request, :GET, 'StorageExist')
593
+ end
594
+
595
+ # Perform scaling, cropping and flipping of an existing image in a single request.
596
+ # @param [update_imageRequest] request Request object.
597
+ # @return [File]
598
+ def update_image(request)
599
+ http_request = request.to_http_info(@api_client.config)
600
+ make_request(http_request, :GET, 'File')
601
+ end
602
+
603
+ # Update images features in search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
604
+ # @param [update_image_featuresRequest] request Request object.
605
+ # @return [nil]
606
+ def update_image_features(request)
607
+ http_request = request.to_http_info(@api_client.config)
608
+ make_request(http_request, :PUT, nil)
609
+ nil
610
+ end
611
+
612
+ # Update image and images features in search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
613
+ # @param [update_search_imageRequest] request Request object.
614
+ # @return [nil]
615
+ def update_search_image(request)
616
+ http_request = request.to_http_info(@api_client.config)
617
+ make_request(http_request, :PUT, nil)
618
+ nil
619
+ end
620
+
621
+ # Upload file
622
+ # @param [upload_fileRequest] request Request object.
623
+ # @return [FilesUploadResult]
624
+ def upload_file(request)
625
+ http_request = request.to_http_info(@api_client.config)
626
+ make_request(http_request, :PUT, 'FilesUploadResult')
627
+ end
628
+
629
+ private
630
+
631
+ def make_request(http_request, method, return_type)
632
+ call_api(http_request, method, return_type)
633
+ rescue ApiError => e
634
+ if e.code.equal? 401
635
+ request_token
636
+ return call_api(http_request, method, return_type)
637
+ end
638
+ raise
639
+
640
+ end
641
+
642
+ def call_api(http_request, method, return_type)
643
+ response = @api_client.call_api(method,
644
+ http_request.resource_path,
645
+ header_params: http_request.header_params,
646
+ query_params: http_request.query_params,
647
+ form_params: http_request.form_params,
648
+ body: http_request.body,
649
+ auth_names: http_request.auth_names,
650
+ return_type: return_type)
651
+ response[0]
652
+ end
653
+
654
+ def request_token
655
+ config = @api_client.config
656
+ request_url = '/connect/token'
657
+ form_params =
658
+ {
659
+ 'grant_type': 'client_credentials',
660
+ 'client_id': config.api_key[:app_sid],
661
+ 'client_secret': config.api_key[:api_key]
662
+ }
663
+
664
+ header_params =
665
+ {
666
+ 'Accept' => 'application/json',
667
+ 'Content-Type' =>'application/x-www-form-urlencoded'
668
+ }
669
+
670
+ base_path = @api_client.config.base_path
671
+ @api_client.config.base_path = ''
672
+
673
+ data = @api_client.call_api(:POST, request_url,
674
+ header_params: header_params,
675
+ form_params: form_params,
676
+ return_type: 'Object')
677
+ access_token = data[0]['access_token'.to_sym]
678
+
679
+ @api_client.config.base_path = base_path
680
+ @api_client.config.access_token = access_token
681
+ end
682
+ end
683
+ end
684
+