groupdocs_merger_cloud 19.10 → 22.5

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_merger_cloud/api/document_api.rb +101 -4
  3. data/lib/groupdocs_merger_cloud/api/file_api.rb +6 -6
  4. data/lib/groupdocs_merger_cloud/api/folder_api.rb +6 -6
  5. data/lib/groupdocs_merger_cloud/api/info_api.rb +2 -2
  6. data/lib/groupdocs_merger_cloud/api/license_api.rb +169 -0
  7. data/lib/groupdocs_merger_cloud/api/pages_api.rb +7 -7
  8. data/lib/groupdocs_merger_cloud/api/security_api.rb +5 -5
  9. data/lib/groupdocs_merger_cloud/api/storage_api.rb +5 -5
  10. data/lib/groupdocs_merger_cloud/api_client.rb +1 -1
  11. data/lib/groupdocs_merger_cloud/api_error.rb +18 -5
  12. data/lib/groupdocs_merger_cloud/configuration.rb +1 -1
  13. data/lib/groupdocs_merger_cloud/models/consumption_result.rb +234 -0
  14. data/lib/groupdocs_merger_cloud/models/disc_usage.rb +1 -1
  15. data/lib/groupdocs_merger_cloud/models/document_result.rb +1 -1
  16. data/lib/groupdocs_merger_cloud/models/error.rb +1 -1
  17. data/lib/groupdocs_merger_cloud/models/error_details.rb +1 -1
  18. data/lib/groupdocs_merger_cloud/models/extract_options.rb +1 -1
  19. data/lib/groupdocs_merger_cloud/models/file_info.rb +1 -1
  20. data/lib/groupdocs_merger_cloud/models/file_version.rb +1 -1
  21. data/lib/groupdocs_merger_cloud/models/file_versions.rb +1 -1
  22. data/lib/groupdocs_merger_cloud/models/files_list.rb +1 -1
  23. data/lib/groupdocs_merger_cloud/models/files_upload_result.rb +1 -1
  24. data/lib/groupdocs_merger_cloud/models/format.rb +1 -1
  25. data/lib/groupdocs_merger_cloud/models/formats_result.rb +1 -1
  26. data/lib/groupdocs_merger_cloud/models/import_options.rb +236 -0
  27. data/lib/groupdocs_merger_cloud/models/info_result.rb +1 -1
  28. data/lib/groupdocs_merger_cloud/models/join_item.rb +36 -5
  29. data/lib/groupdocs_merger_cloud/models/join_options.rb +1 -1
  30. data/lib/groupdocs_merger_cloud/models/move_options.rb +1 -1
  31. data/lib/groupdocs_merger_cloud/models/multi_document_result.rb +1 -1
  32. data/lib/groupdocs_merger_cloud/models/object_exist.rb +1 -1
  33. data/lib/groupdocs_merger_cloud/models/options.rb +1 -1
  34. data/lib/groupdocs_merger_cloud/models/orientation_options.rb +1 -1
  35. data/lib/groupdocs_merger_cloud/models/page_info.rb +1 -1
  36. data/lib/groupdocs_merger_cloud/models/page_options.rb +1 -1
  37. data/lib/groupdocs_merger_cloud/models/password_result.rb +1 -1
  38. data/lib/groupdocs_merger_cloud/models/preview_options.rb +1 -1
  39. data/lib/groupdocs_merger_cloud/models/remove_options.rb +1 -1
  40. data/lib/groupdocs_merger_cloud/models/rotate_options.rb +1 -1
  41. data/lib/groupdocs_merger_cloud/models/split_options.rb +1 -1
  42. data/lib/groupdocs_merger_cloud/models/storage_exist.rb +1 -1
  43. data/lib/groupdocs_merger_cloud/models/storage_file.rb +1 -1
  44. data/lib/groupdocs_merger_cloud/models/swap_options.rb +1 -1
  45. data/lib/groupdocs_merger_cloud/models/update_password_options.rb +1 -1
  46. data/lib/groupdocs_merger_cloud/version.rb +2 -2
  47. data/lib/groupdocs_merger_cloud.rb +4 -1
  48. metadata +5 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26963d1e0b8a53e0f820b61ec916121e594356ac
4
- data.tar.gz: caae255afc236b0bb89e5eb17b40d308104c68a0
3
+ metadata.gz: ecac6d6cd0d1ca243d86798b6a9a60fda8286ac7
4
+ data.tar.gz: a7755f7a052a818fb919e801fa43f1300f6cc0c7
5
5
  SHA512:
6
- metadata.gz: 0526e3f943c6ce9dbd0132f834285d827ee86ca503466776a3756e675ff4143ca8ec5bb8724f20979d0618cb16478c33ece7ee8deb64578287130339fae763fd
7
- data.tar.gz: d6e7f60b2c8a495a8f409a5f4e52460afc4141e30969ea93c63027dae2b90e7fc0490ec38bc17d25484b99b29c55e383771483553fe1610f80a4c405621e5683
6
+ metadata.gz: 190dabbeeaa14d5c4975c566250857df0ffdd8f95c3d8e7263969def65b1b526912dc5986d70e64c86745e29eec09d49b869a194a78cac7b041b88a815adef07
7
+ data.tar.gz: 118d86bd54d115379a2c576fd21648ec8e6e11cdce11b6a88e329251bbbd89737eb8106291e26ac7d2591a17fecfbeecf5188ee63231baed064a8f1e69f8f358
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="document.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -64,6 +64,58 @@ module GroupDocsMergerCloud
64
64
  return new(config)
65
65
  end
66
66
 
67
+ # Import attachments into pdf document
68
+ #
69
+ # @param request import_request
70
+ # @return [DocumentResult]
71
+ def import(request)
72
+ data, _status_code, _headers = import_with_http_info(request)
73
+ data
74
+ end
75
+
76
+ # Import attachments into pdf document
77
+ #
78
+ # @param request import_request
79
+ # @return [Array<(DocumentResult, Fixnum, Hash)>]
80
+ # DocumentResult data, response status code and response headers
81
+ def import_with_http_info(request)
82
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? ImportRequest
83
+
84
+ @api_client.config.logger.debug 'Calling API: DocumentApi.import ...' if @api_client.config.debugging
85
+ # verify the required parameter 'options' is set
86
+ raise ArgumentError, 'Missing the required parameter options when calling DocumentApi.import' if @api_client.config.client_side_validation && request.options.nil?
87
+ # resource path
88
+ local_var_path = '/merger/import'
89
+
90
+ # query parameters
91
+ query_params = {}
92
+
93
+ # header parameters
94
+ header_params = {}
95
+ # HTTP header 'Accept' (if needed)
96
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
97
+ # HTTP header 'Content-Type'
98
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
99
+
100
+ # form parameters
101
+ form_params = {}
102
+
103
+ # http body (model)
104
+ post_body = @api_client.object_to_http_body(request.options)
105
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
106
+ header_params: header_params,
107
+ query_params: query_params,
108
+ form_params: form_params,
109
+ body: post_body,
110
+ access_token: get_access_token,
111
+ return_type: 'DocumentResult')
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called:
114
+ DocumentApi#import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
115
+ end
116
+ [data, status_code, headers]
117
+ end
118
+
67
119
  # Join multiple documents into one document
68
120
  #
69
121
  # @param request join_request
@@ -273,11 +325,56 @@ module GroupDocsMergerCloud
273
325
  end
274
326
  end
275
327
  end
328
+ end
329
+ #
330
+ # --------------------------------------------------------------------------------------------------------------------
331
+ # <copyright company="Aspose Pty Ltd" file="import_request.rb">
332
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
333
+ # </copyright>
334
+ # <summary>
335
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
336
+ # of this software and associated documentation files (the "Software"), to deal
337
+ # in the Software without restriction, including without limitation the rights
338
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
339
+ # copies of the Software, and to permit persons to whom the Software is
340
+ # furnished to do so, subject to the following conditions:
341
+ #
342
+ # The above copyright notice and this permission notice shall be included in all
343
+ # copies or substantial portions of the Software.
344
+ #
345
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
346
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
347
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
348
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
349
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
350
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
351
+ # SOFTWARE.
352
+ # </summary>
353
+ # --------------------------------------------------------------------------------------------------------------------
354
+ #
355
+
356
+ module GroupDocsMergerCloud
357
+
358
+ #
359
+ # Request model for import operation.
360
+ #
361
+ class ImportRequest
362
+
363
+ # Import options
364
+ attr_accessor :options
365
+
366
+ #
367
+ # Initializes a new instance.
368
+ # @param options Import options
369
+ def initialize(options)
370
+ self.options = options
371
+ end
372
+ end
276
373
  end
277
374
  #
278
375
  # --------------------------------------------------------------------------------------------------------------------
279
376
  # <copyright company="Aspose Pty Ltd" file="join_request.rb">
280
- # Copyright (c) 2003-2019 Aspose Pty Ltd
377
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
281
378
  # </copyright>
282
379
  # <summary>
283
380
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -322,7 +419,7 @@ end
322
419
  #
323
420
  # --------------------------------------------------------------------------------------------------------------------
324
421
  # <copyright company="Aspose Pty Ltd" file="preview_request.rb">
325
- # Copyright (c) 2003-2019 Aspose Pty Ltd
422
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
326
423
  # </copyright>
327
424
  # <summary>
328
425
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -367,7 +464,7 @@ end
367
464
  #
368
465
  # --------------------------------------------------------------------------------------------------------------------
369
466
  # <copyright company="Aspose Pty Ltd" file="split_request.rb">
370
- # Copyright (c) 2003-2019 Aspose Pty Ltd
467
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
371
468
  # </copyright>
372
469
  # <summary>
373
470
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="file.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -449,7 +449,7 @@ end
449
449
  #
450
450
  # --------------------------------------------------------------------------------------------------------------------
451
451
  # <copyright company="Aspose Pty Ltd" file="copy_file_request.rb">
452
- # Copyright (c) 2003-2019 Aspose Pty Ltd
452
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
453
453
  # </copyright>
454
454
  # <summary>
455
455
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -510,7 +510,7 @@ end
510
510
  #
511
511
  # --------------------------------------------------------------------------------------------------------------------
512
512
  # <copyright company="Aspose Pty Ltd" file="delete_file_request.rb">
513
- # Copyright (c) 2003-2019 Aspose Pty Ltd
513
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
514
514
  # </copyright>
515
515
  # <summary>
516
516
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -563,7 +563,7 @@ end
563
563
  #
564
564
  # --------------------------------------------------------------------------------------------------------------------
565
565
  # <copyright company="Aspose Pty Ltd" file="download_file_request.rb">
566
- # Copyright (c) 2003-2019 Aspose Pty Ltd
566
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
567
567
  # </copyright>
568
568
  # <summary>
569
569
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -616,7 +616,7 @@ end
616
616
  #
617
617
  # --------------------------------------------------------------------------------------------------------------------
618
618
  # <copyright company="Aspose Pty Ltd" file="move_file_request.rb">
619
- # Copyright (c) 2003-2019 Aspose Pty Ltd
619
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
620
620
  # </copyright>
621
621
  # <summary>
622
622
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -677,7 +677,7 @@ end
677
677
  #
678
678
  # --------------------------------------------------------------------------------------------------------------------
679
679
  # <copyright company="Aspose Pty Ltd" file="upload_file_request.rb">
680
- # Copyright (c) 2003-2019 Aspose Pty Ltd
680
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
681
681
  # </copyright>
682
682
  # <summary>
683
683
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="folder.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -430,7 +430,7 @@ end
430
430
  #
431
431
  # --------------------------------------------------------------------------------------------------------------------
432
432
  # <copyright company="Aspose Pty Ltd" file="copy_folder_request.rb">
433
- # Copyright (c) 2003-2019 Aspose Pty Ltd
433
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
434
434
  # </copyright>
435
435
  # <summary>
436
436
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -487,7 +487,7 @@ end
487
487
  #
488
488
  # --------------------------------------------------------------------------------------------------------------------
489
489
  # <copyright company="Aspose Pty Ltd" file="create_folder_request.rb">
490
- # Copyright (c) 2003-2019 Aspose Pty Ltd
490
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
491
491
  # </copyright>
492
492
  # <summary>
493
493
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -536,7 +536,7 @@ end
536
536
  #
537
537
  # --------------------------------------------------------------------------------------------------------------------
538
538
  # <copyright company="Aspose Pty Ltd" file="delete_folder_request.rb">
539
- # Copyright (c) 2003-2019 Aspose Pty Ltd
539
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
540
540
  # </copyright>
541
541
  # <summary>
542
542
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -589,7 +589,7 @@ end
589
589
  #
590
590
  # --------------------------------------------------------------------------------------------------------------------
591
591
  # <copyright company="Aspose Pty Ltd" file="get_files_list_request.rb">
592
- # Copyright (c) 2003-2019 Aspose Pty Ltd
592
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
593
593
  # </copyright>
594
594
  # <summary>
595
595
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -638,7 +638,7 @@ end
638
638
  #
639
639
  # --------------------------------------------------------------------------------------------------------------------
640
640
  # <copyright company="Aspose Pty Ltd" file="move_folder_request.rb">
641
- # Copyright (c) 2003-2019 Aspose Pty Ltd
641
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
642
642
  # </copyright>
643
643
  # <summary>
644
644
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="info.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -222,7 +222,7 @@ end
222
222
  #
223
223
  # --------------------------------------------------------------------------------------------------------------------
224
224
  # <copyright company="Aspose Pty Ltd" file="get_info_request.rb">
225
- # Copyright (c) 2003-2019 Aspose Pty Ltd
225
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
226
226
  # </copyright>
227
227
  # <summary>
228
228
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -0,0 +1,169 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose Pty Ltd" file="license.rb">
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # 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 FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # </summary>
24
+ # -----------------------------------------------------------------------------------
25
+
26
+ require 'uri'
27
+ require 'date'
28
+
29
+ module GroupDocsMergerCloud
30
+ #
31
+ # GroupDocs.Merger Cloud API
32
+ #
33
+ class LicenseApi
34
+ attr_accessor :config
35
+
36
+ #make LicenseApi.new private
37
+ private_class_method :new
38
+
39
+ # Initializes new instance of LicenseApi
40
+ #
41
+ # @param [config] Configuration
42
+ # @return [LicenseApi] New instance of LicenseApi
43
+ def initialize(config)
44
+ @config = config
45
+ @api_client = ApiClient.new(config)
46
+ @access_token = nil
47
+ end
48
+
49
+ # Initializes new instance of LicenseApi
50
+ #
51
+ # @param [app_sid] Application identifier (App SID)
52
+ # @param [app_key] Application private key (App Key)
53
+ # @return [LicenseApi] New instance of LicenseApi
54
+ def self.from_keys(app_sid, app_key)
55
+ config = Configuration.new(app_sid, app_key)
56
+ return new(config)
57
+ end
58
+
59
+ # Initializes new instance of LicenseApi
60
+ #
61
+ # @param [config] Configuration
62
+ # @return [LicenseApi] New instance of LicenseApi
63
+ def self.from_config(config)
64
+ return new(config)
65
+ end
66
+
67
+ # Get license consumption
68
+ #
69
+ # @return [ConsumptionResult]
70
+ def get_consumption_credit()
71
+ data, _status_code, _headers = get_consumption_credit_with_http_info()
72
+ data
73
+ end
74
+
75
+ # Get license consumption
76
+ #
77
+
78
+ # @return [Array<(ConsumptionResult, Fixnum, Hash)>]
79
+ # ConsumptionResult data, response status code and response headers
80
+ def get_consumption_credit_with_http_info()
81
+
82
+
83
+ @api_client.config.logger.debug 'Calling API: LicenseApi.get_consumption_credit ...' if @api_client.config.debugging
84
+ # resource path
85
+ local_var_path = '/merger/consumption'
86
+
87
+ # query parameters
88
+ query_params = {}
89
+
90
+ # header parameters
91
+ header_params = {}
92
+ # HTTP header 'Accept' (if needed)
93
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
94
+ # HTTP header 'Content-Type'
95
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
96
+
97
+ # form parameters
98
+ form_params = {}
99
+
100
+ # http body (model)
101
+ post_body = nil
102
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
103
+ header_params: header_params,
104
+ query_params: query_params,
105
+ form_params: form_params,
106
+ body: post_body,
107
+ access_token: get_access_token,
108
+ return_type: 'ConsumptionResult')
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug "API called:
111
+ LicenseApi#get_consumption_credit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
112
+ end
113
+ [data, status_code, headers]
114
+ end
115
+
116
+ #
117
+ # Helper method to convert first letter to downcase
118
+ #
119
+ private def downcase_first_letter(str)
120
+ value = str[0].downcase + str[1..-1]
121
+ value
122
+ end
123
+
124
+ #
125
+ # Retrieves access token
126
+ #
127
+ private def get_access_token
128
+ if @access_token.nil? then
129
+ request_access_token
130
+ end
131
+
132
+ @access_token
133
+ end
134
+
135
+ #
136
+ # Gets a access token from server
137
+ #
138
+ private def request_access_token
139
+ auth_config = Configuration.new(@config.app_sid, @config.app_key)
140
+ auth_config.api_base_url = @config.api_base_url
141
+ auth_config.debugging = @config.debugging
142
+ auth_config.logger = @config.logger
143
+ auth_config.temp_folder_path = @config.temp_folder_path
144
+ auth_config.client_side_validation = @config.client_side_validation
145
+ auth_config.api_version = ''
146
+
147
+ auth_api_client = ApiClient.new(auth_config)
148
+
149
+ request_url = "/connect/token"
150
+ post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
151
+
152
+ data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
153
+
154
+ @access_token = data[:access_token]
155
+
156
+ expires_in_seconds = data[:expires_in].to_i - 5 * 60
157
+ expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
158
+ @access_token_expires_at = DateTime.now + expires_in_days
159
+ end
160
+
161
+ # requires all files inside a directory from current dir
162
+ # @param _dir can be relative path like '/lib' or "../lib"
163
+ private def require_all(_dir)
164
+ Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
165
+ require file
166
+ end
167
+ end
168
+ end
169
+ end
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="pages.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -433,7 +433,7 @@ end
433
433
  #
434
434
  # --------------------------------------------------------------------------------------------------------------------
435
435
  # <copyright company="Aspose Pty Ltd" file="extract_request.rb">
436
- # Copyright (c) 2003-2019 Aspose Pty Ltd
436
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
437
437
  # </copyright>
438
438
  # <summary>
439
439
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -478,7 +478,7 @@ end
478
478
  #
479
479
  # --------------------------------------------------------------------------------------------------------------------
480
480
  # <copyright company="Aspose Pty Ltd" file="move_request.rb">
481
- # Copyright (c) 2003-2019 Aspose Pty Ltd
481
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
482
482
  # </copyright>
483
483
  # <summary>
484
484
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -523,7 +523,7 @@ end
523
523
  #
524
524
  # --------------------------------------------------------------------------------------------------------------------
525
525
  # <copyright company="Aspose Pty Ltd" file="orientation_request.rb">
526
- # Copyright (c) 2003-2019 Aspose Pty Ltd
526
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
527
527
  # </copyright>
528
528
  # <summary>
529
529
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -568,7 +568,7 @@ end
568
568
  #
569
569
  # --------------------------------------------------------------------------------------------------------------------
570
570
  # <copyright company="Aspose Pty Ltd" file="remove_request.rb">
571
- # Copyright (c) 2003-2019 Aspose Pty Ltd
571
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
572
572
  # </copyright>
573
573
  # <summary>
574
574
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -613,7 +613,7 @@ end
613
613
  #
614
614
  # --------------------------------------------------------------------------------------------------------------------
615
615
  # <copyright company="Aspose Pty Ltd" file="rotate_request.rb">
616
- # Copyright (c) 2003-2019 Aspose Pty Ltd
616
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
617
617
  # </copyright>
618
618
  # <summary>
619
619
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -658,7 +658,7 @@ end
658
658
  #
659
659
  # --------------------------------------------------------------------------------------------------------------------
660
660
  # <copyright company="Aspose Pty Ltd" file="swap_request.rb">
661
- # Copyright (c) 2003-2019 Aspose Pty Ltd
661
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
662
662
  # </copyright>
663
663
  # <summary>
664
664
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="security.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -341,7 +341,7 @@ end
341
341
  #
342
342
  # --------------------------------------------------------------------------------------------------------------------
343
343
  # <copyright company="Aspose Pty Ltd" file="add_password_request.rb">
344
- # Copyright (c) 2003-2019 Aspose Pty Ltd
344
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
345
345
  # </copyright>
346
346
  # <summary>
347
347
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -386,7 +386,7 @@ end
386
386
  #
387
387
  # --------------------------------------------------------------------------------------------------------------------
388
388
  # <copyright company="Aspose Pty Ltd" file="check_password_request.rb">
389
- # Copyright (c) 2003-2019 Aspose Pty Ltd
389
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
390
390
  # </copyright>
391
391
  # <summary>
392
392
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -439,7 +439,7 @@ end
439
439
  #
440
440
  # --------------------------------------------------------------------------------------------------------------------
441
441
  # <copyright company="Aspose Pty Ltd" file="remove_password_request.rb">
442
- # Copyright (c) 2003-2019 Aspose Pty Ltd
442
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
443
443
  # </copyright>
444
444
  # <summary>
445
445
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -484,7 +484,7 @@ end
484
484
  #
485
485
  # --------------------------------------------------------------------------------------------------------------------
486
486
  # <copyright company="Aspose Pty Ltd" file="update_password_request.rb">
487
- # Copyright (c) 2003-2019 Aspose Pty Ltd
487
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
488
488
  # </copyright>
489
489
  # <summary>
490
490
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="storage.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -350,7 +350,7 @@ end
350
350
  #
351
351
  # --------------------------------------------------------------------------------------------------------------------
352
352
  # <copyright company="Aspose Pty Ltd" file="get_disc_usage_request.rb">
353
- # Copyright (c) 2003-2019 Aspose Pty Ltd
353
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
354
354
  # </copyright>
355
355
  # <summary>
356
356
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -395,7 +395,7 @@ end
395
395
  #
396
396
  # --------------------------------------------------------------------------------------------------------------------
397
397
  # <copyright company="Aspose Pty Ltd" file="get_file_versions_request.rb">
398
- # Copyright (c) 2003-2019 Aspose Pty Ltd
398
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
399
399
  # </copyright>
400
400
  # <summary>
401
401
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -444,7 +444,7 @@ end
444
444
  #
445
445
  # --------------------------------------------------------------------------------------------------------------------
446
446
  # <copyright company="Aspose Pty Ltd" file="object_exists_request.rb">
447
- # Copyright (c) 2003-2019 Aspose Pty Ltd
447
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
448
448
  # </copyright>
449
449
  # <summary>
450
450
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -497,7 +497,7 @@ end
497
497
  #
498
498
  # --------------------------------------------------------------------------------------------------------------------
499
499
  # <copyright company="Aspose Pty Ltd" file="storage_exists_request.rb">
500
- # Copyright (c) 2003-2019 Aspose Pty Ltd
500
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
501
501
  # </copyright>
502
502
  # <summary>
503
503
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_client.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="api_error.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,10 +39,23 @@ module GroupDocsMergerCloud
39
39
 
40
40
  if arg.key?(:response_body) then
41
41
  data = JSON.parse(arg[:response_body], :symbolize_names => true)
42
- if !data.nil? && !data[:error].nil? then
43
- @message = data[:error]
44
- elsif !data.nil? && !data[:Error].nil? && !data[:Error][:Message].nil? then
45
- @message = data[:Error][:Message]
42
+ if !data.nil? then
43
+ if !data[:error].nil? then
44
+ error = data[:error]
45
+ if error.kind_of?(String) then
46
+ @message = error
47
+ else
48
+ @message = error[:message]
49
+ end
50
+ else
51
+ message = data[:message]
52
+ if !message.nil? && message.kind_of?(String) then
53
+ @message = message
54
+ @code = data[:code]
55
+ else
56
+ @message = data
57
+ end
58
+ end
46
59
  end
47
60
  end
48
61
 
@@ -1,6 +1,6 @@
1
1
  # ------------------------------------------------------------------------------------
2
2
  # <copyright company="Aspose Pty Ltd" file="configuration.rb">
3
- # Copyright (c) 2003-2019 Aspose Pty Ltd
3
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
4
4
  # </copyright>
5
5
  # <summary>
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy