aspose_imaging_cloud 20.5 → 20.12

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.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -7
  3. data/lib/aspose-imaging-cloud.rb +5 -4
  4. data/lib/aspose-imaging-cloud/api/imaging_api.rb +34 -27
  5. data/lib/aspose-imaging-cloud/api_client.rb +5 -5
  6. data/lib/aspose-imaging-cloud/configuration.rb +6 -6
  7. data/lib/aspose-imaging-cloud/models/available_labels_list.rb +204 -0
  8. data/lib/aspose-imaging-cloud/models/detected_object_list.rb +3 -3
  9. data/lib/aspose-imaging-cloud/models/dicom_properties.rb +4 -64
  10. data/lib/aspose-imaging-cloud/models/eps_properties.rb +241 -0
  11. data/lib/aspose-imaging-cloud/models/imaging_response.rb +11 -1
  12. data/lib/aspose-imaging-cloud/models/requests/{save_image_as_request.rb → convert_image_request.rb} +7 -7
  13. data/lib/aspose-imaging-cloud/models/requests/{create_saved_image_as_request.rb → create_converted_image_request.rb} +7 -7
  14. data/lib/aspose-imaging-cloud/models/requests/create_image_frame_range_request.rb +1 -1
  15. data/lib/aspose-imaging-cloud/models/requests/create_object_bounds_request.rb +7 -1
  16. data/lib/aspose-imaging-cloud/models/requests/create_visual_object_bounds_request.rb +7 -1
  17. data/lib/aspose-imaging-cloud/models/requests/{object_bounds_request.rb → get_available_labels_request.rb} +9 -28
  18. data/lib/aspose-imaging-cloud/models/requests/get_object_bounds_request.rb +7 -1
  19. data/lib/aspose-imaging-cloud/models/requests/get_visual_object_bounds_request.rb +7 -1
  20. data/lib/aspose-imaging-cloud/models/requests/upload_file_request.rb +1 -0
  21. metadata +9 -7
  22. data/lib/aspose-imaging-cloud/models/requests/visual_object_bounds_request.rb +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2857535b2bf1f5bd09cb9635e1d8fcf407854d9288d1cc9a227f7f9928b3fae
4
- data.tar.gz: 751c33587e825c4ebb37f24cfe2f5e485e3205659bf62b015c50baa9303e729e
3
+ metadata.gz: 0d6816eba3a25ceba438ca3924b7c310ff12e5f2b2e47c8bc703d3d9257a1c52
4
+ data.tar.gz: de86e95f334dc7a041df9ba867f51b5a2230f6e84a0c98320443180e7e13a951
5
5
  SHA512:
6
- metadata.gz: 33afd3fdfaa74ff3ad5108128b22e86ef6442ddb5cccc8183cd80adf1aa3057708206c5641be8f9a71c43c772169c802b0e36131d8934ce9cee67d8113a9eefb
7
- data.tar.gz: 73f075fccc69946452f4aef137956e9bc4be8624124596324371ef1d7988aa217d3bce7953a7e77a14806de2a2e33ca6e9289ac5514e87ef55cd01f5c723c7ec
6
+ metadata.gz: 454f0f651f9d8b5b4c6988472d2541124a8a2241b5dccb70697fe8a3e41caa059104556b3c130561106c78890eb33b3e77ff04ac804ebaa45e58238f5a0379c0
7
+ data.tar.gz: 8accf5c6a46a8e8f215a3b3b6841bc4f44f6ba358b8e608d2d685e0e41b28cf885f26928d8559b9b94deb49b8ed3b6676ecb3dcc1afa7ff8e9568208242d7287
data/README.md CHANGED
@@ -31,7 +31,7 @@ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.or
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'aspose-imaging-cloud', '~> 20.5'
34
+ gem 'aspose-imaging-cloud', '~> 20.12'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -100,7 +100,7 @@ Class | Method | HTTP request | Description
100
100
  *AsposeImagingCloud::ImagingApi* | [**create_grayscaled_image**](docs/ImagingApi.md#create_grayscaled_image) | **POST** /imaging/grayscale | Grayscales an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
101
101
  *AsposeImagingCloud::ImagingApi* | [**create_image_features**](docs/ImagingApi.md#create_image_features) | **POST** /imaging/ai/imageSearch/{searchContextId}/features | 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.
102
102
  *AsposeImagingCloud::ImagingApi* | [**create_image_frame**](docs/ImagingApi.md#create_image_frame) | **POST** /imaging/frames/{frameId} | Get separate frame from existing image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
103
- *AsposeImagingCloud::ImagingApi* | [**create_image_frame_range**](docs/ImagingApi.md#create_image_frame_range) | **POST** /imaging/frames/range | Get separate frame from existing image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
103
+ *AsposeImagingCloud::ImagingApi* | [**create_image_frame_range**](docs/ImagingApi.md#create_image_frame_range) | **POST** /imaging/frames/range | Get frames range from existing image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
104
104
  *AsposeImagingCloud::ImagingApi* | [**create_image_search**](docs/ImagingApi.md#create_image_search) | **POST** /imaging/ai/imageSearch/create | Create new search context.
105
105
  *AsposeImagingCloud::ImagingApi* | [**create_image_tag**](docs/ImagingApi.md#create_image_tag) | **POST** /imaging/ai/imageSearch/{searchContextId}/addTag | Add tag and reference image to search context. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
106
106
  *AsposeImagingCloud::ImagingApi* | [**create_modified_bmp**](docs/ImagingApi.md#create_modified_bmp) | **POST** /imaging/bmp | Update parameters of BMP image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
@@ -116,9 +116,8 @@ Class | Method | HTTP request | Description
116
116
  *AsposeImagingCloud::ImagingApi* | [**create_object_bounds**](docs/ImagingApi.md#create_object_bounds) | **POST** /imaging/ai/objectdetection/bounds | Detects objects bounds. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
117
117
  *AsposeImagingCloud::ImagingApi* | [**create_resized_image**](docs/ImagingApi.md#create_resized_image) | **POST** /imaging/resize | Resize an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
118
118
  *AsposeImagingCloud::ImagingApi* | [**create_rotate_flipped_image**](docs/ImagingApi.md#create_rotate_flipped_image) | **POST** /imaging/rotateflip | Rotate and/or flip an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
119
- *AsposeImagingCloud::ImagingApi* | [**create_saved_image_as**](docs/ImagingApi.md#create_saved_image_as) | **POST** /imaging/saveAs | Export existing image to another format. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
120
119
  *AsposeImagingCloud::ImagingApi* | [**create_updated_image**](docs/ImagingApi.md#create_updated_image) | **POST** /imaging/updateImage | 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.
121
- *AsposeImagingCloud::ImagingApi* | [**create_visual_object_bounds**](docs/ImagingApi.md#create_visual_object_bounds) | **POST** /imaging/ai/objectdetection/visualbounds | Detect objects bounds and draw them on the original image
120
+ *AsposeImagingCloud::ImagingApi* | [**create_visual_object_bounds**](docs/ImagingApi.md#create_visual_object_bounds) | **POST** /imaging/ai/objectdetection/visualbounds | Detects objects bounds and draw them on the original image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream
122
121
  *AsposeImagingCloud::ImagingApi* | [**create_web_site_image_features**](docs/ImagingApi.md#create_web_site_image_features) | **POST** /imaging/ai/imageSearch/{searchContextId}/features/web | Extract images features from web page and add them to search context
123
122
  *AsposeImagingCloud::ImagingApi* | [**crop_image**](docs/ImagingApi.md#crop_image) | **GET** /imaging/{name}/crop | Crop an existing image.
124
123
  *AsposeImagingCloud::ImagingApi* | [**delete_file**](docs/ImagingApi.md#delete_file) | **DELETE** /imaging/storage/file/{path} | Delete file
@@ -144,7 +143,9 @@ Class | Method | HTTP request | Description
144
143
  *AsposeImagingCloud::ImagingApi* | [**get_image_frame_range**](docs/ImagingApi.md#get_image_frame_range) | **GET** /imaging/{name}/frames/range | Get frames range from existing image.
145
144
  *AsposeImagingCloud::ImagingApi* | [**get_image_properties**](docs/ImagingApi.md#get_image_properties) | **GET** /imaging/{name}/properties | Get properties of an image.
146
145
  *AsposeImagingCloud::ImagingApi* | [**get_image_search_status**](docs/ImagingApi.md#get_image_search_status) | **GET** /imaging/ai/imageSearch/{searchContextId}/status | Gets the search context status.
146
+ *AsposeImagingCloud::ImagingApi* | [**get_object_bounds**](docs/ImagingApi.md#get_object_bounds) | **GET** /imaging/ai/objectdetection/{name}/bounds | Detects objects' bounds
147
147
  *AsposeImagingCloud::ImagingApi* | [**get_search_image**](docs/ImagingApi.md#get_search_image) | **GET** /imaging/ai/imageSearch/{searchContextId}/image | Get image from search context
148
+ *AsposeImagingCloud::ImagingApi* | [**get_visual_object_bounds**](docs/ImagingApi.md#get_visual_object_bounds) | **GET** /imaging/ai/objectdetection/{name}/visualbounds | Detects objects bounds and draw them on the original image
148
149
  *AsposeImagingCloud::ImagingApi* | [**grayscale_image**](docs/ImagingApi.md#grayscale_image) | **GET** /imaging/{name}/grayscale | Grayscale an existing image.
149
150
  *AsposeImagingCloud::ImagingApi* | [**modify_bmp**](docs/ImagingApi.md#modify_bmp) | **GET** /imaging/{name}/bmp | Update parameters of existing BMP image.
150
151
  *AsposeImagingCloud::ImagingApi* | [**modify_emf**](docs/ImagingApi.md#modify_emf) | **GET** /imaging/{name}/emf | Process existing EMF imaging using given parameters.
@@ -158,17 +159,14 @@ Class | Method | HTTP request | Description
158
159
  *AsposeImagingCloud::ImagingApi* | [**modify_wmf**](docs/ImagingApi.md#modify_wmf) | **GET** /imaging/{name}/wmf | Process existing WMF image using given parameters.
159
160
  *AsposeImagingCloud::ImagingApi* | [**move_file**](docs/ImagingApi.md#move_file) | **PUT** /imaging/storage/file/move/{srcPath} | Move file
160
161
  *AsposeImagingCloud::ImagingApi* | [**move_folder**](docs/ImagingApi.md#move_folder) | **PUT** /imaging/storage/folder/move/{srcPath} | Move folder
161
- *AsposeImagingCloud::ImagingApi* | [**object_bounds**](docs/ImagingApi.md#object_bounds) | **GET** /imaging/ai/objectdetection/bounds | Detect objects' bounds
162
162
  *AsposeImagingCloud::ImagingApi* | [**object_exists**](docs/ImagingApi.md#object_exists) | **GET** /imaging/storage/exist/{path} | Check if file or folder exists
163
163
  *AsposeImagingCloud::ImagingApi* | [**resize_image**](docs/ImagingApi.md#resize_image) | **GET** /imaging/{name}/resize | Resize an existing image.
164
164
  *AsposeImagingCloud::ImagingApi* | [**rotate_flip_image**](docs/ImagingApi.md#rotate_flip_image) | **GET** /imaging/{name}/rotateflip | Rotate and/or flip an existing image.
165
- *AsposeImagingCloud::ImagingApi* | [**save_image_as**](docs/ImagingApi.md#save_image_as) | **GET** /imaging/{name}/saveAs | Export existing image to another format.
166
165
  *AsposeImagingCloud::ImagingApi* | [**storage_exists**](docs/ImagingApi.md#storage_exists) | **GET** /imaging/storage/{storageName}/exist | Check if storage exists
167
166
  *AsposeImagingCloud::ImagingApi* | [**update_image**](docs/ImagingApi.md#update_image) | **GET** /imaging/{name}/updateImage | Perform scaling, cropping and flipping of an existing image in a single request.
168
167
  *AsposeImagingCloud::ImagingApi* | [**update_image_features**](docs/ImagingApi.md#update_image_features) | **PUT** /imaging/ai/imageSearch/{searchContextId}/features | Update images features in search context. Image data may be passed as zero-indexed multipart/form-data content or as raw body stream.
169
168
  *AsposeImagingCloud::ImagingApi* | [**update_search_image**](docs/ImagingApi.md#update_search_image) | **PUT** /imaging/ai/imageSearch/{searchContextId}/image | 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.
170
169
  *AsposeImagingCloud::ImagingApi* | [**upload_file**](docs/ImagingApi.md#upload_file) | **PUT** /imaging/storage/file/{path} | Upload file
171
- *AsposeImagingCloud::ImagingApi* | [**visual_object_bounds**](docs/ImagingApi.md#visual_object_bounds) | **GET** /imaging/ai/objectdetection/visualbounds | Detect objects bounds and draw them on the original image
172
170
 
173
171
 
174
172
  ## Documentation for Models
@@ -31,6 +31,7 @@ require_relative './aspose-imaging-cloud/version'
31
31
  require_relative './aspose-imaging-cloud/configuration'
32
32
 
33
33
  # Models
34
+ require_relative './aspose-imaging-cloud/models/available_labels_list'
34
35
  require_relative './aspose-imaging-cloud/models/bmp_properties'
35
36
  require_relative './aspose-imaging-cloud/models/detected_object'
36
37
  require_relative './aspose-imaging-cloud/models/detected_object_list'
@@ -38,6 +39,7 @@ require_relative './aspose-imaging-cloud/models/dicom_properties'
38
39
  require_relative './aspose-imaging-cloud/models/disc_usage'
39
40
  require_relative './aspose-imaging-cloud/models/djvu_properties'
40
41
  require_relative './aspose-imaging-cloud/models/dng_properties'
42
+ require_relative './aspose-imaging-cloud/models/eps_properties'
41
43
  require_relative './aspose-imaging-cloud/models/error'
42
44
  require_relative './aspose-imaging-cloud/models/error_details'
43
45
  require_relative './aspose-imaging-cloud/models/exif_data'
@@ -91,9 +93,11 @@ require_relative 'aspose-imaging-cloud/api/imaging_api'
91
93
  require_relative './aspose-imaging-cloud/models/requests/add_search_image_request'
92
94
  require_relative './aspose-imaging-cloud/models/requests/append_tiff_request'
93
95
  require_relative './aspose-imaging-cloud/models/requests/compare_images_request'
96
+ require_relative './aspose-imaging-cloud/models/requests/convert_image_request'
94
97
  require_relative './aspose-imaging-cloud/models/requests/convert_tiff_to_fax_request'
95
98
  require_relative './aspose-imaging-cloud/models/requests/copy_file_request'
96
99
  require_relative './aspose-imaging-cloud/models/requests/copy_folder_request'
100
+ require_relative './aspose-imaging-cloud/models/requests/create_converted_image_request'
97
101
  require_relative './aspose-imaging-cloud/models/requests/create_cropped_image_request'
98
102
  require_relative './aspose-imaging-cloud/models/requests/create_deskewed_image_request'
99
103
  require_relative './aspose-imaging-cloud/models/requests/create_fax_tiff_request'
@@ -117,7 +121,6 @@ require_relative './aspose-imaging-cloud/models/requests/create_modified_wmf_req
117
121
  require_relative './aspose-imaging-cloud/models/requests/create_object_bounds_request'
118
122
  require_relative './aspose-imaging-cloud/models/requests/create_resized_image_request'
119
123
  require_relative './aspose-imaging-cloud/models/requests/create_rotate_flipped_image_request'
120
- require_relative './aspose-imaging-cloud/models/requests/create_saved_image_as_request'
121
124
  require_relative './aspose-imaging-cloud/models/requests/create_updated_image_request'
122
125
  require_relative './aspose-imaging-cloud/models/requests/create_visual_object_bounds_request'
123
126
  require_relative './aspose-imaging-cloud/models/requests/create_web_site_image_features_request'
@@ -136,6 +139,7 @@ require_relative './aspose-imaging-cloud/models/requests/filter_effect_image_req
136
139
  require_relative './aspose-imaging-cloud/models/requests/find_images_by_tags_request'
137
140
  require_relative './aspose-imaging-cloud/models/requests/find_image_duplicates_request'
138
141
  require_relative './aspose-imaging-cloud/models/requests/find_similar_images_request'
142
+ require_relative './aspose-imaging-cloud/models/requests/get_available_labels_request'
139
143
  require_relative './aspose-imaging-cloud/models/requests/get_disc_usage_request'
140
144
  require_relative './aspose-imaging-cloud/models/requests/get_files_list_request'
141
145
  require_relative './aspose-imaging-cloud/models/requests/get_file_versions_request'
@@ -163,15 +167,12 @@ require_relative './aspose-imaging-cloud/models/requests/modify_web_p_request'
163
167
  require_relative './aspose-imaging-cloud/models/requests/modify_wmf_request'
164
168
  require_relative './aspose-imaging-cloud/models/requests/move_file_request'
165
169
  require_relative './aspose-imaging-cloud/models/requests/move_folder_request'
166
- require_relative './aspose-imaging-cloud/models/requests/object_bounds_request'
167
170
  require_relative './aspose-imaging-cloud/models/requests/object_exists_request'
168
171
  require_relative './aspose-imaging-cloud/models/requests/resize_image_request'
169
172
  require_relative './aspose-imaging-cloud/models/requests/rotate_flip_image_request'
170
- require_relative './aspose-imaging-cloud/models/requests/save_image_as_request'
171
173
  require_relative './aspose-imaging-cloud/models/requests/storage_exists_request'
172
174
  require_relative './aspose-imaging-cloud/models/requests/update_image_features_request'
173
175
  require_relative './aspose-imaging-cloud/models/requests/update_image_request'
174
176
  require_relative './aspose-imaging-cloud/models/requests/update_search_image_request'
175
177
  require_relative './aspose-imaging-cloud/models/requests/upload_file_request'
176
- require_relative './aspose-imaging-cloud/models/requests/visual_object_bounds_request'
177
178
 
@@ -32,13 +32,13 @@ module AsposeImagingCloud
32
32
  attr_accessor :api_client
33
33
 
34
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.
35
+ # @param [String] client_secret Key to access the server.
36
+ # @param [String] client_id ID to access the server.
37
37
  # @param [String] base_url Server URL.
38
38
  # @param [String] api_version Api version.
39
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)
40
+ def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
41
+ @api_client = ApiClient.new(client_secret, client_id, base_url, api_version, debug)
42
42
  end
43
43
 
44
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.
@@ -67,6 +67,14 @@ module AsposeImagingCloud
67
67
  make_request(http_request, :POST, 'SearchResultsSet')
68
68
  end
69
69
 
70
+ # Convert existing image to another format.
71
+ # @param [convert_imageRequest] request Request object.
72
+ # @return [File]
73
+ def convert_image(request)
74
+ http_request = request.to_http_info(@api_client.config)
75
+ make_request(http_request, :GET, 'File')
76
+ end
77
+
70
78
  # Update parameters of existing TIFF image accordingly to fax parameters.
71
79
  # @param [convert_tiff_to_faxRequest] request Request object.
72
80
  # @return [File]
@@ -93,6 +101,14 @@ module AsposeImagingCloud
93
101
  nil
94
102
  end
95
103
 
104
+ # Convert existing image to another format. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
105
+ # @param [create_converted_imageRequest] request Request object.
106
+ # @return [File]
107
+ def create_converted_image(request)
108
+ http_request = request.to_http_info(@api_client.config)
109
+ make_request(http_request, :POST, 'File')
110
+ end
111
+
96
112
  # Crop an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
97
113
  # @param [create_cropped_imageRequest] request Request object.
98
114
  # @return [File]
@@ -280,14 +296,6 @@ module AsposeImagingCloud
280
296
  make_request(http_request, :POST, 'File')
281
297
  end
282
298
 
283
- # Export existing image to another format. Image data is passed as zero-indexed multipart/form-data content or as raw body stream.
284
- # @param [create_saved_image_asRequest] request Request object.
285
- # @return [File]
286
- def create_saved_image_as(request)
287
- http_request = request.to_http_info(@api_client.config)
288
- make_request(http_request, :POST, 'File')
289
- end
290
-
291
299
  # 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.
292
300
  # @param [create_updated_imageRequest] request Request object.
293
301
  # @return [File]
@@ -438,6 +446,14 @@ module AsposeImagingCloud
438
446
  make_request(http_request, :GET, 'SearchResultsSet')
439
447
  end
440
448
 
449
+ # Gets available labels for selected object detection method.
450
+ # @param [get_available_labelsRequest] request Request object.
451
+ # @return [AvailableLabelsList]
452
+ def get_available_labels(request)
453
+ http_request = request.to_http_info(@api_client.config)
454
+ make_request(http_request, :GET, 'AvailableLabelsList')
455
+ end
456
+
441
457
  # Get disc usage
442
458
  # @param [get_disc_usageRequest] request Request object.
443
459
  # @return [DiscUsage]
@@ -664,14 +680,6 @@ module AsposeImagingCloud
664
680
  make_request(http_request, :GET, 'File')
665
681
  end
666
682
 
667
- # Export existing image to another format.
668
- # @param [save_image_asRequest] request Request object.
669
- # @return [File]
670
- def save_image_as(request)
671
- http_request = request.to_http_info(@api_client.config)
672
- make_request(http_request, :GET, 'File')
673
- end
674
-
675
683
  # Check if storage exists
676
684
  # @param [storage_existsRequest] request Request object.
677
685
  # @return [StorageExist]
@@ -717,13 +725,8 @@ module AsposeImagingCloud
717
725
  private
718
726
 
719
727
  def make_request(http_request, method, return_type)
728
+ ensure_token
720
729
  call_api(http_request, method, return_type)
721
- rescue ApiError => e
722
- if e.code.equal? 401
723
- request_token
724
- return call_api(http_request, method, return_type)
725
- end
726
- raise
727
730
 
728
731
  end
729
732
 
@@ -739,13 +742,17 @@ module AsposeImagingCloud
739
742
  response[0]
740
743
  end
741
744
 
745
+ def ensure_token
746
+ request_token unless @api_client.config.access_token
747
+ end
748
+
742
749
  def request_token
743
750
  config = @api_client.config
744
751
  request_url = '/connect/token'
745
752
  form_params =
746
753
  {
747
754
  'grant_type': 'client_credentials',
748
- 'client_id': config.api_key[:app_sid],
755
+ 'client_id': config.api_key[:client_id],
749
756
  'client_secret': config.api_key[:api_key]
750
757
  }
751
758
 
@@ -45,16 +45,16 @@ module AsposeImagingCloud
45
45
  attr_accessor :default_headers
46
46
 
47
47
  # Initializes the ApiClient
48
- # @param [String] app_key Key to access the server.
49
- # @param [String] app_sid ID to access the server.
48
+ # @param [String] client_secret Key to access the server.
49
+ # @param [String] client_id ID to access the server.
50
50
  # @param [String] base_url Server URL.
51
51
  # @param [String] api_version Api version.
52
52
  # @param [Object] debug Debug switch [true, false].
53
- def initialize(app_key = nil, app_sid = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
54
- @config = Configuration.new(app_key, app_sid, base_url, api_version, debug)
53
+ def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
54
+ @config = Configuration.new(client_secret, client_id, base_url, api_version, debug)
55
55
  @default_headers = {
56
56
  'x-aspose-client' => 'ruby sdk',
57
- 'x-aspose-version' => '20.5'
57
+ 'x-aspose-version' => '20.12'
58
58
  }
59
59
  end
60
60
 
@@ -149,18 +149,18 @@ module AsposeImagingCloud
149
149
  attr_accessor :force_ending_format
150
150
 
151
151
  # Initializes a new instance.
152
- # @param [String] app_key Key to access the server.
153
- # @param [String] app_sid ID to access the server.
152
+ # @param [String] client_secret Key to access the server.
153
+ # @param [String] client_id ID to access the server.
154
154
  # @param [String] base_url Server URL.
155
155
  # @param [String] api_version Api version.
156
156
  # @param [Object] debug Debug switch [true, false].
157
- def initialize(app_key = nil, app_sid = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
157
+ def initialize(client_secret = nil, client_id = nil, base_url = 'api-qa.aspose.cloud', api_version = 'v3.0', debug = false)
158
158
  @scheme = 'https'
159
159
  self.host = base_url
160
160
  @api_version = api_version
161
161
  self.base_path = @api_version
162
- @api_key = { 'api_key': app_key || '',
163
- 'app_sid': app_sid || '' }
162
+ @api_key = { 'api_key': client_secret || '',
163
+ 'client_id': client_id || '' }
164
164
  @api_key_prefix = {}
165
165
  @timeout = 0
166
166
  @client_side_validation = true
@@ -173,7 +173,7 @@ module AsposeImagingCloud
173
173
  @inject_format = false
174
174
  @force_ending_format = false
175
175
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
176
- @on_premise = (!(app_key || app_sid) && base_url)
176
+ @on_premise = (!(client_secret || client_id) && base_url)
177
177
 
178
178
  yield(self) if block_given?
179
179
  end
@@ -0,0 +1,204 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="available_labels_list.rb">
3
+ # Copyright (c) 2018-2020 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 'date'
28
+
29
+ module AsposeImagingCloud
30
+ # AvailableLabelsList
31
+ class AvailableLabelsList
32
+ # detected objects
33
+ attr_accessor :available_labels
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'available_labels' => :'availableLabels'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'available_labels' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'availableLabels')
58
+ if (value = attributes[:'availableLabels']).is_a?(Array)
59
+ self.available_labels = value
60
+ end
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ available_labels == o.available_labels
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Fixnum] Hash code
93
+ def hash
94
+ [available_labels].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ attribute_key = self.class.attribute_map[key]
104
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[attribute_key].is_a?(Array)
109
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[attribute_key].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ temp_model = AsposeImagingCloud.const_get(type).new
157
+ temp_model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ next if value.nil?
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+ end