aspose_slides_cloud 23.7.0 → 23.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2f0e7c91523f8b7f2bc27e74d7635f76133d738ab3903809c32626ed9acf7c3
4
- data.tar.gz: e11651c0270c55bbb7872908ef4795bad88db76489159f14b32f2e0318fcfc6f
3
+ metadata.gz: 9a41a0a352d4ed06aacdc85d71e640b75be6c90686c9b4e1f5adda2daa6df22a
4
+ data.tar.gz: a9315c7e5dbb2d6984427064200142917aa9251a70bcbb13613fcb58e3a2455e
5
5
  SHA512:
6
- metadata.gz: faef55cb3e345d6d9f99e61f4d9e1adf8063b3e6eb1ee5f097b3934271310f032222ab935ad13751b7f19fb61c7b7e718c5ee938b6d8bfa471ee9c9011245908
7
- data.tar.gz: 445d2f78ca1212c9cc35bdd95608a4d48488eebb27e241d848d31297ceadc14cb41ba1163d9e2a25077d89a5d7514bd9b1b707e948dca957690fb393e433ef86
6
+ metadata.gz: 9bb1a96e9c6dacffdad05685025efbf4f3ccb227c0ccdc5e880420413e9e22816b7b23771066a2e85b9438abb2df482b761fcec5f779cc88b8c8e24d9c5cd088
7
+ data.tar.gz: 39bef77e18cd0a00e6e501b763d65f98949406f828e637e8f7e9bca90ea625124fdcc893d7fff92a035e88fc60171a966a49db665d5348be39177547dececa4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aspose_slides_cloud (23.7.0)
4
+ aspose_slides_cloud (23.9.0)
5
5
  faraday (~> 1.0, >= 1.0.0)
6
6
  faraday-httpclient (~> 1.0, >= 1.0.0)
7
7
  httpclient (~> 2.2, >= 2.2.0)
@@ -11,7 +11,7 @@ GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
13
  ZenTest (4.12.1)
14
- addressable (2.8.4)
14
+ addressable (2.8.5)
15
15
  public_suffix (>= 2.0.2, < 6.0)
16
16
  autotest (4.4.6)
17
17
  ZenTest (>= 4.4.1)
@@ -45,14 +45,14 @@ GEM
45
45
  faraday-patron (1.0.0)
46
46
  faraday-rack (1.0.0)
47
47
  faraday-retry (1.0.3)
48
- ffi (1.15.5)
48
+ ffi (1.16.2)
49
49
  hashdiff (1.0.1)
50
50
  httpclient (2.8.3)
51
51
  json (2.6.3)
52
52
  multipart-post (2.3.0)
53
53
  public_suffix (5.0.3)
54
54
  rake (12.3.3)
55
- rexml (3.2.5)
55
+ rexml (3.2.6)
56
56
  rspec (3.12.0)
57
57
  rspec-core (~> 3.12.0)
58
58
  rspec-expectations (~> 3.12.0)
data/README.md CHANGED
@@ -27,6 +27,10 @@ You may want to check out Aspose free [Powerpoint to PDF](https://products.aspos
27
27
  **Web:** HTML/HTML5
28
28
  **Other:** MPEG4, SWF (export whole presentations)
29
29
 
30
+ ## Enhancements in Version 23.9
31
+
32
+ * Added **ReplaceImage** and **ReplaceImageOnline** methods that enable replacing images in a presentation.
33
+
30
34
  ## Enhancements in Version 23.7
31
35
 
32
36
  * New methods **ReplaceTextFormatting** and **ReplaceTextFormatting** allow to replace text with formatting.
@@ -2794,7 +2794,7 @@ module AsposeSlidesCloud
2794
2794
  # @param folder Document folder.
2795
2795
  # @param storage Document storage.
2796
2796
  # @param sub_shape Sub-shape path (e.g. \"3\", \"3/shapes/2).
2797
- def create_special_slide_shape(name, slide_index, slide_type, dto = nil, shape_to_clone = nil, position = nil, password = nil, folder = nil, storage = nil, sub_shape = nil)
2797
+ def create_special_slide_shape(name, slide_index, slide_type, dto, shape_to_clone = nil, position = nil, password = nil, folder = nil, storage = nil, sub_shape = nil)
2798
2798
  data, _status_code, _headers = create_special_slide_shape_with_http_info(name, slide_index, slide_type, dto, shape_to_clone, position, password, folder, storage, sub_shape)
2799
2799
  data
2800
2800
  end
@@ -2810,7 +2810,7 @@ module AsposeSlidesCloud
2810
2810
  # @param folder Document folder.
2811
2811
  # @param storage Document storage.
2812
2812
  # @param sub_shape Sub-shape path (e.g. \"3\", \"3/shapes/2).
2813
- def create_special_slide_shape_with_http_info(name, slide_index, slide_type, dto = nil, shape_to_clone = nil, position = nil, password = nil, folder = nil, storage = nil, sub_shape = nil)
2813
+ def create_special_slide_shape_with_http_info(name, slide_index, slide_type, dto, shape_to_clone = nil, position = nil, password = nil, folder = nil, storage = nil, sub_shape = nil)
2814
2814
  if @api_client.config.debugging
2815
2815
  @api_client.config.logger.debug 'Calling API: SlidesApi.create_special_slide_shape ...'
2816
2816
  end
@@ -2831,6 +2831,10 @@ module AsposeSlidesCloud
2831
2831
  if @api_client.config.client_side_validation && !['MasterSlide', 'LayoutSlide', 'NotesSlide'].any?{ |s| s.casecmp(slide_type)==0 }
2832
2832
  fail ArgumentError, "Invalid value for parameter slide_type: " + slide_type + ". Must be one of MasterSlide, LayoutSlide, NotesSlide"
2833
2833
  end
2834
+ # verify the required parameter 'dto' is set
2835
+ if @api_client.config.client_side_validation && dto.nil?
2836
+ fail ArgumentError, "Missing the required parameter 'dto' when calling SlidesApi.create_special_slide_shape"
2837
+ end
2834
2838
  # resource path
2835
2839
  local_var_path = '/slides/{name}/slides/{slideIndex}/{slideType}/shapes'
2836
2840
  local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)
@@ -4975,7 +4979,7 @@ module AsposeSlidesCloud
4975
4979
  # Resets all presentation protection settings.
4976
4980
  # @param document Document data.
4977
4981
  # @param password Presentation password.
4978
- def delete_protection_online(document, password)
4982
+ def delete_protection_online(document, password = nil)
4979
4983
  data, _status_code, _headers = delete_protection_online_with_http_info(document, password)
4980
4984
  data
4981
4985
  end
@@ -4983,7 +4987,7 @@ module AsposeSlidesCloud
4983
4987
  # Resets all presentation protection settings.
4984
4988
  # @param document Document data.
4985
4989
  # @param password Presentation password.
4986
- def delete_protection_online_with_http_info(document, password)
4990
+ def delete_protection_online_with_http_info(document, password = nil)
4987
4991
  if @api_client.config.debugging
4988
4992
  @api_client.config.logger.debug 'Calling API: SlidesApi.delete_protection_online ...'
4989
4993
  end
@@ -4992,10 +4996,6 @@ module AsposeSlidesCloud
4992
4996
  if @api_client.config.client_side_validation && document.nil?
4993
4997
  fail ArgumentError, "Missing the required parameter 'document' when calling SlidesApi.delete_protection_online"
4994
4998
  end
4995
- # verify the required parameter 'password' is set
4996
- if @api_client.config.client_side_validation && password.nil?
4997
- fail ArgumentError, "Missing the required parameter 'password' when calling SlidesApi.delete_protection_online"
4998
- end
4999
4999
  # resource path
5000
5000
  local_var_path = '/slides/protection/delete'
5001
5001
 
@@ -5008,7 +5008,7 @@ module AsposeSlidesCloud
5008
5008
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
5009
5009
  # HTTP header 'Content-Type'
5010
5010
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
5011
- header_params[:'password'] = password
5011
+ header_params[:'password'] = password unless password.nil?
5012
5012
 
5013
5013
  # http body (model)
5014
5014
  post_body = nil
@@ -14366,6 +14366,139 @@ module AsposeSlidesCloud
14366
14366
  :return_type => 'File')
14367
14367
  return data, status_code, headers
14368
14368
  end
14369
+ # Replaces image by the specified index.
14370
+ # @param name Document name.
14371
+ # @param image_index Image index.
14372
+ # @param image Image data.
14373
+ # @param password Document password.
14374
+ # @param folder Document folder.
14375
+ # @param storage Document storage.
14376
+ def replace_image(name, image_index, image = nil, password = nil, folder = nil, storage = nil)
14377
+ replace_image_with_http_info(name, image_index, image, password, folder, storage)
14378
+ nil
14379
+ end
14380
+
14381
+ # Replaces image by the specified index.
14382
+ # @param name Document name.
14383
+ # @param image_index Image index.
14384
+ # @param image Image data.
14385
+ # @param password Document password.
14386
+ # @param folder Document folder.
14387
+ # @param storage Document storage.
14388
+ def replace_image_with_http_info(name, image_index, image = nil, password = nil, folder = nil, storage = nil)
14389
+ if @api_client.config.debugging
14390
+ @api_client.config.logger.debug 'Calling API: SlidesApi.replace_image ...'
14391
+ end
14392
+
14393
+ # verify the required parameter 'name' is set
14394
+ if @api_client.config.client_side_validation && name.nil?
14395
+ fail ArgumentError, "Missing the required parameter 'name' when calling SlidesApi.replace_image"
14396
+ end
14397
+ # verify the required parameter 'image_index' is set
14398
+ if @api_client.config.client_side_validation && image_index.nil?
14399
+ fail ArgumentError, "Missing the required parameter 'image_index' when calling SlidesApi.replace_image"
14400
+ end
14401
+ # resource path
14402
+ local_var_path = '/slides/{name}/images/{imageIndex}/replace'
14403
+ local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)
14404
+ local_var_path = @api_client.replace_path_parameter(local_var_path, 'imageIndex', image_index)
14405
+
14406
+ # query parameters
14407
+ query_params = {}
14408
+ query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?
14409
+ query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?
14410
+
14411
+ # header parameters
14412
+ header_params = {}
14413
+ # HTTP header 'Accept' (if needed)
14414
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
14415
+ # HTTP header 'Content-Type'
14416
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
14417
+ header_params[:'password'] = password unless password.nil?
14418
+
14419
+ # http body (model)
14420
+ post_body = nil
14421
+
14422
+ # form parameters
14423
+ post_files = []
14424
+ if image
14425
+ post_files = post_files.push(image)
14426
+ end
14427
+
14428
+ auth_names = ['JWT']
14429
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
14430
+ :header_params => header_params,
14431
+ :query_params => query_params,
14432
+ :body => post_body,
14433
+ :files => post_files,
14434
+ :auth_names => auth_names)
14435
+ return data, status_code, headers
14436
+ end
14437
+ # Replaces image by the specified index and returns updated document.
14438
+ # @param document Document data.
14439
+ # @param image_index Image index.
14440
+ # @param image Image data.
14441
+ # @param password Password.
14442
+ def replace_image_online(document, image_index, image = nil, password = nil)
14443
+ data, _status_code, _headers = replace_image_online_with_http_info(document, image_index, image, password)
14444
+ data
14445
+ end
14446
+
14447
+ # Replaces image by the specified index and returns updated document.
14448
+ # @param document Document data.
14449
+ # @param image_index Image index.
14450
+ # @param image Image data.
14451
+ # @param password Password.
14452
+ def replace_image_online_with_http_info(document, image_index, image = nil, password = nil)
14453
+ if @api_client.config.debugging
14454
+ @api_client.config.logger.debug 'Calling API: SlidesApi.replace_image_online ...'
14455
+ end
14456
+
14457
+ # verify the required parameter 'document' is set
14458
+ if @api_client.config.client_side_validation && document.nil?
14459
+ fail ArgumentError, "Missing the required parameter 'document' when calling SlidesApi.replace_image_online"
14460
+ end
14461
+ # verify the required parameter 'image_index' is set
14462
+ if @api_client.config.client_side_validation && image_index.nil?
14463
+ fail ArgumentError, "Missing the required parameter 'image_index' when calling SlidesApi.replace_image_online"
14464
+ end
14465
+ # resource path
14466
+ local_var_path = '/slides/images/{imageIndex}/replace'
14467
+ local_var_path = @api_client.replace_path_parameter(local_var_path, 'imageIndex', image_index)
14468
+
14469
+ # query parameters
14470
+ query_params = {}
14471
+
14472
+ # header parameters
14473
+ header_params = {}
14474
+ # HTTP header 'Accept' (if needed)
14475
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
14476
+ # HTTP header 'Content-Type'
14477
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
14478
+ header_params[:'password'] = password unless password.nil?
14479
+
14480
+ # http body (model)
14481
+ post_body = nil
14482
+
14483
+ # form parameters
14484
+ post_files = []
14485
+ if document
14486
+ post_files = post_files.push(document)
14487
+ end
14488
+ if image
14489
+ post_files = post_files.push(image)
14490
+ end
14491
+
14492
+ auth_names = ['JWT']
14493
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
14494
+ :header_params => header_params,
14495
+ :query_params => query_params,
14496
+ :body => post_body,
14497
+ :files => post_files,
14498
+ :auth_names => auth_names,
14499
+ :return_type => 'File')
14500
+ return data, status_code, headers
14501
+ end
14369
14502
  # Replace text with a new value.
14370
14503
  # @param name Document name.
14371
14504
  # @param old_value Text value to be replaced.
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeSlidesCloud
24
- VERSION = '23.7.0'
24
+ VERSION = '23.9.0'
25
25
  end
@@ -7996,8 +7996,8 @@ describe 'SlidesApi' do
7996
7996
  # @param name Document name.
7997
7997
  # @param slide_index Parent slide index.
7998
7998
  # @param slide_type Slide type (master, layout or notes).
7999
+ # @param dto Shape DTO.
7999
8000
  # @param [Hash] opts the optional parameters
8000
- # @option opts [ShapeBase] :dto Shape DTO.
8001
8001
  # @option opts [Integer] :shape_to_clone Optional index for clone shape instead of adding a new one.
8002
8002
  # @option opts [Integer] :position Position of the new shape in the list. Default is at the end of the list.
8003
8003
  # @option opts [String] :password Document password.
@@ -13817,8 +13817,8 @@ describe 'SlidesApi' do
13817
13817
  # unit tests for delete_protection_online
13818
13818
  # Resets all presentation protection settings.
13819
13819
  # @param document Document data.
13820
- # @param password Presentation password.
13821
13820
  # @param [Hash] opts the optional parameters
13821
+ # @option opts [String] :password Presentation password.
13822
13822
  # @return [File]
13823
13823
  describe 'delete_protection_online test' do
13824
13824
  it 'should work' do
@@ -37968,6 +37968,295 @@ describe 'SlidesApi' do
37968
37968
  end
37969
37969
  end
37970
37970
 
37971
+ # unit tests for replace_image
37972
+ # Replaces image by the specified index.
37973
+ # @param name Document name.
37974
+ # @param image_index Image index.
37975
+ # @param [Hash] opts the optional parameters
37976
+ # @option opts [File] :image Image data.
37977
+ # @option opts [String] :password Document password.
37978
+ # @option opts [String] :folder Document folder.
37979
+ # @option opts [String] :storage Document storage.
37980
+ # @return [nil]
37981
+ describe 'replace_image test' do
37982
+ it 'should work' do
37983
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
37984
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
37985
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
37986
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
37987
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
37988
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
37989
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', nil, nil)
37990
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
37991
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', nil, nil, nil)
37992
+ expect(c).to eq(code)
37993
+ end
37994
+
37995
+ it 'invalid name' do
37996
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
37997
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
37998
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
37999
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38000
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38001
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38002
+ paramname = AsposeSlidesCloud::SpecUtils.invalidize_param_value('name', 'ReplaceImage', paramname, 'String')
38003
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'name', paramname)
38004
+ begin
38005
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38006
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'name')
38007
+ fail "An exception expected"
38008
+ end
38009
+ rescue AsposeSlidesCloud::ApiError => e
38010
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'name', paramname, 'String')
38011
+ expect(e.code).to eq(code)
38012
+ expect(e.response_body).to include(message)
38013
+ rescue ArgumentError => e
38014
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'name', paramname, 'String')
38015
+ expect(400).to eq(code)
38016
+ expect(e.message).to include(message)
38017
+ end
38018
+ end
38019
+
38020
+ it 'invalid image_index' do
38021
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
38022
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
38023
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
38024
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38025
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38026
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38027
+ paramimage_index = AsposeSlidesCloud::SpecUtils.invalidize_param_value('imageIndex', 'ReplaceImage', paramimage_index, 'Integer')
38028
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'imageIndex', paramimage_index)
38029
+ begin
38030
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38031
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'imageIndex')
38032
+ fail "An exception expected"
38033
+ end
38034
+ rescue AsposeSlidesCloud::ApiError => e
38035
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'imageIndex', paramimage_index, 'Integer')
38036
+ expect(e.code).to eq(code)
38037
+ expect(e.response_body).to include(message)
38038
+ rescue ArgumentError => e
38039
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'imageIndex', paramimage_index, 'Integer')
38040
+ expect(400).to eq(code)
38041
+ expect(e.message).to include(message)
38042
+ end
38043
+ end
38044
+
38045
+ it 'invalid image' do
38046
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
38047
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
38048
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
38049
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38050
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38051
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38052
+ paramimage = AsposeSlidesCloud::SpecUtils.invalidize_param_value('image', 'ReplaceImage', paramimage, 'File')
38053
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'image', paramimage)
38054
+ begin
38055
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38056
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'image')
38057
+ fail "An exception expected"
38058
+ end
38059
+ rescue AsposeSlidesCloud::ApiError => e
38060
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'image', paramimage, 'File')
38061
+ expect(e.code).to eq(code)
38062
+ expect(e.response_body).to include(message)
38063
+ rescue ArgumentError => e
38064
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'image', paramimage, 'File')
38065
+ expect(400).to eq(code)
38066
+ expect(e.message).to include(message)
38067
+ end
38068
+ end
38069
+
38070
+ it 'invalid password' do
38071
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
38072
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
38073
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
38074
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38075
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38076
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38077
+ parampassword = AsposeSlidesCloud::SpecUtils.invalidize_param_value('password', 'ReplaceImage', parampassword, 'String')
38078
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'password', parampassword)
38079
+ begin
38080
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38081
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'password')
38082
+ fail "An exception expected"
38083
+ end
38084
+ rescue AsposeSlidesCloud::ApiError => e
38085
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'password', parampassword, 'String')
38086
+ expect(e.code).to eq(code)
38087
+ expect(e.response_body).to include(message)
38088
+ rescue ArgumentError => e
38089
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'password', parampassword, 'String')
38090
+ expect(400).to eq(code)
38091
+ expect(e.message).to include(message)
38092
+ end
38093
+ end
38094
+
38095
+ it 'invalid folder' do
38096
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
38097
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
38098
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
38099
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38100
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38101
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38102
+ paramfolder = AsposeSlidesCloud::SpecUtils.invalidize_param_value('folder', 'ReplaceImage', paramfolder, 'String')
38103
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'folder', paramfolder)
38104
+ begin
38105
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38106
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'folder')
38107
+ fail "An exception expected"
38108
+ end
38109
+ rescue AsposeSlidesCloud::ApiError => e
38110
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'folder', paramfolder, 'String')
38111
+ expect(e.code).to eq(code)
38112
+ expect(e.response_body).to include(message)
38113
+ rescue ArgumentError => e
38114
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'folder', paramfolder, 'String')
38115
+ expect(400).to eq(code)
38116
+ expect(e.message).to include(message)
38117
+ end
38118
+ end
38119
+
38120
+ it 'invalid storage' do
38121
+ paramname = AsposeSlidesCloud::SpecUtils.get_param_value('name', 'ReplaceImage', 'String')
38122
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImage', 'Integer')
38123
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImage', 'File')
38124
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImage', 'String')
38125
+ paramfolder = AsposeSlidesCloud::SpecUtils.get_param_value('folder', 'ReplaceImage', 'String')
38126
+ paramstorage = AsposeSlidesCloud::SpecUtils.get_param_value('storage', 'ReplaceImage', 'String')
38127
+ paramstorage = AsposeSlidesCloud::SpecUtils.invalidize_param_value('storage', 'ReplaceImage', paramstorage, 'String')
38128
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImage', 'storage', paramstorage)
38129
+ begin
38130
+ AsposeSlidesCloud::SpecUtils.api.replace_image_with_http_info(paramname, paramimage_index, paramimage, parampassword, paramfolder, paramstorage)
38131
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImage', 'storage')
38132
+ fail "An exception expected"
38133
+ end
38134
+ rescue AsposeSlidesCloud::ApiError => e
38135
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'storage', paramstorage, 'String')
38136
+ expect(e.code).to eq(code)
38137
+ expect(e.response_body).to include(message)
38138
+ rescue ArgumentError => e
38139
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImage', 'storage', paramstorage, 'String')
38140
+ expect(400).to eq(code)
38141
+ expect(e.message).to include(message)
38142
+ end
38143
+ end
38144
+ end
38145
+
38146
+ # unit tests for replace_image_online
38147
+ # Replaces image by the specified index and returns updated document.
38148
+ # @param document Document data.
38149
+ # @param image_index Image index.
38150
+ # @param [Hash] opts the optional parameters
38151
+ # @option opts [File] :image Image data.
38152
+ # @option opts [String] :password Password.
38153
+ # @return [File]
38154
+ describe 'replace_image_online test' do
38155
+ it 'should work' do
38156
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'ReplaceImageOnline', 'File')
38157
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImageOnline', 'Integer')
38158
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImageOnline', 'File')
38159
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImageOnline', 'String')
38160
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImageOnline', nil, nil)
38161
+ o, c, _h = AsposeSlidesCloud::SpecUtils.api.replace_image_online_with_http_info(paramdocument, paramimage_index, paramimage, parampassword)
38162
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', nil, nil, nil)
38163
+ expect(c).to eq(code)
38164
+ expect(o).not_to be_nil
38165
+ end
38166
+
38167
+ it 'invalid document' do
38168
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'ReplaceImageOnline', 'File')
38169
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImageOnline', 'Integer')
38170
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImageOnline', 'File')
38171
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImageOnline', 'String')
38172
+ paramdocument = AsposeSlidesCloud::SpecUtils.invalidize_param_value('document', 'ReplaceImageOnline', paramdocument, 'File')
38173
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImageOnline', 'document', paramdocument)
38174
+ begin
38175
+ AsposeSlidesCloud::SpecUtils.api.replace_image_online_with_http_info(paramdocument, paramimage_index, paramimage, parampassword)
38176
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImageOnline', 'document')
38177
+ fail "An exception expected"
38178
+ end
38179
+ rescue AsposeSlidesCloud::ApiError => e
38180
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'document', paramdocument, 'File')
38181
+ expect(e.code).to eq(code)
38182
+ expect(e.response_body).to include(message)
38183
+ rescue ArgumentError => e
38184
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'document', paramdocument, 'File')
38185
+ expect(400).to eq(code)
38186
+ expect(e.message).to include(message)
38187
+ end
38188
+ end
38189
+
38190
+ it 'invalid image_index' do
38191
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'ReplaceImageOnline', 'File')
38192
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImageOnline', 'Integer')
38193
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImageOnline', 'File')
38194
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImageOnline', 'String')
38195
+ paramimage_index = AsposeSlidesCloud::SpecUtils.invalidize_param_value('imageIndex', 'ReplaceImageOnline', paramimage_index, 'Integer')
38196
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImageOnline', 'imageIndex', paramimage_index)
38197
+ begin
38198
+ AsposeSlidesCloud::SpecUtils.api.replace_image_online_with_http_info(paramdocument, paramimage_index, paramimage, parampassword)
38199
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImageOnline', 'imageIndex')
38200
+ fail "An exception expected"
38201
+ end
38202
+ rescue AsposeSlidesCloud::ApiError => e
38203
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'imageIndex', paramimage_index, 'Integer')
38204
+ expect(e.code).to eq(code)
38205
+ expect(e.response_body).to include(message)
38206
+ rescue ArgumentError => e
38207
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'imageIndex', paramimage_index, 'Integer')
38208
+ expect(400).to eq(code)
38209
+ expect(e.message).to include(message)
38210
+ end
38211
+ end
38212
+
38213
+ it 'invalid image' do
38214
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'ReplaceImageOnline', 'File')
38215
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImageOnline', 'Integer')
38216
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImageOnline', 'File')
38217
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImageOnline', 'String')
38218
+ paramimage = AsposeSlidesCloud::SpecUtils.invalidize_param_value('image', 'ReplaceImageOnline', paramimage, 'File')
38219
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImageOnline', 'image', paramimage)
38220
+ begin
38221
+ AsposeSlidesCloud::SpecUtils.api.replace_image_online_with_http_info(paramdocument, paramimage_index, paramimage, parampassword)
38222
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImageOnline', 'image')
38223
+ fail "An exception expected"
38224
+ end
38225
+ rescue AsposeSlidesCloud::ApiError => e
38226
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'image', paramimage, 'File')
38227
+ expect(e.code).to eq(code)
38228
+ expect(e.response_body).to include(message)
38229
+ rescue ArgumentError => e
38230
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'image', paramimage, 'File')
38231
+ expect(400).to eq(code)
38232
+ expect(e.message).to include(message)
38233
+ end
38234
+ end
38235
+
38236
+ it 'invalid password' do
38237
+ paramdocument = AsposeSlidesCloud::SpecUtils.get_param_value('document', 'ReplaceImageOnline', 'File')
38238
+ paramimage_index = AsposeSlidesCloud::SpecUtils.get_param_value('imageIndex', 'ReplaceImageOnline', 'Integer')
38239
+ paramimage = AsposeSlidesCloud::SpecUtils.get_param_value('image', 'ReplaceImageOnline', 'File')
38240
+ parampassword = AsposeSlidesCloud::SpecUtils.get_param_value('password', 'ReplaceImageOnline', 'String')
38241
+ parampassword = AsposeSlidesCloud::SpecUtils.invalidize_param_value('password', 'ReplaceImageOnline', parampassword, 'String')
38242
+ AsposeSlidesCloud::SpecUtils.initialize('ReplaceImageOnline', 'password', parampassword)
38243
+ begin
38244
+ AsposeSlidesCloud::SpecUtils.api.replace_image_online_with_http_info(paramdocument, paramimage_index, paramimage, parampassword)
38245
+ unless AsposeSlidesCloud::SpecUtils.no_exception?('ReplaceImageOnline', 'password')
38246
+ fail "An exception expected"
38247
+ end
38248
+ rescue AsposeSlidesCloud::ApiError => e
38249
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'password', parampassword, 'String')
38250
+ expect(e.code).to eq(code)
38251
+ expect(e.response_body).to include(message)
38252
+ rescue ArgumentError => e
38253
+ code, message = AsposeSlidesCloud::SpecUtils.get_expected_error('ReplaceImageOnline', 'password', parampassword, 'String')
38254
+ expect(400).to eq(code)
38255
+ expect(e.message).to include(message)
38256
+ end
38257
+ end
38258
+ end
38259
+
37971
38260
  # unit tests for replace_presentation_text
37972
38261
  # Replace text with a new value.
37973
38262
  # @param name Document name.
@@ -98,5 +98,26 @@ describe 'UseCases' do
98
98
  png_result = AsposeSlidesCloud::SpecUtils.api.download_image_online(source, slide_index, 'png', password)
99
99
  expect(png_result.size).not_to eq(default_result.size)
100
100
  end
101
+
102
+ it 'replace image' do
103
+ folder_name = "TempSlidesSDK"
104
+ file_name = "test.pptx"
105
+ image_index = 1
106
+ password = "password"
107
+ AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
108
+
109
+ image = File.binread("TestData/watermark.png")
110
+ AsposeSlidesCloud::SpecUtils.api.replace_image(file_name, image_index, image, password, folder_name)
111
+ end
112
+
113
+ it 'replace image request' do
114
+ image_index = 1
115
+ password = "password"
116
+
117
+ file = File.binread("TestData/test.pptx")
118
+ image = File.binread("TestData/watermark.png")
119
+ response = AsposeSlidesCloud::SpecUtils.api.replace_image_online(file, image_index, image, password)
120
+ expect(response.size).not_to eq(0)
121
+ end
101
122
  end
102
123
  end
data/testRules.json CHANGED
@@ -61,6 +61,7 @@
61
61
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Go" },
62
62
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Ruby" },
63
63
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Perl" },
64
+ { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "C++" },
64
65
  { "Value": { "Name": "testModule001", "SourceCode": "Test" }, "Type": "VbaModule" },
65
66
  { "Value": {}, "Type": "OrderedMergeRequest", "Method": "OrderedMerge" },
66
67
  { "Value": { "paths": [ { "pathData": [ { "type": "MoveTo" } ] } ] }, "Type": "GeometryPaths" },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_slides_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.7.0
4
+ version: 23.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Putrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-26 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday