aspose_diagram_cloud 18.10.3 → 19.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/{aspose_diagram_cloud.gemspec → AsposeDiagramCloud.gemspec} +5 -5
  3. data/README.md +94 -124
  4. data/docs/{FileFormatRequest.md → CreateNewResponse.md} +2 -2
  5. data/docs/DiagramApi.md +241 -0
  6. data/docs/DiagramSaveOptions.md +10 -0
  7. data/docs/DiscUsage.md +9 -0
  8. data/docs/Error.md +11 -0
  9. data/docs/ErrorDetails.md +9 -0
  10. data/docs/FileVersion.md +14 -0
  11. data/docs/FileVersions.md +8 -0
  12. data/docs/FilesList.md +8 -0
  13. data/docs/FilesUploadResult.md +9 -0
  14. data/docs/HTMLSaveOptions.md +19 -0
  15. data/docs/ImageSaveOptions.md +29 -0
  16. data/docs/ModifyResponse.md +9 -0
  17. data/docs/OAuthApi.md +3 -3
  18. data/docs/ObjectExist.md +9 -0
  19. data/docs/PageSize.md +8 -0
  20. data/docs/PdfDigitalSignatureDetails.md +11 -0
  21. data/docs/PdfEncryptionDetails.md +11 -0
  22. data/docs/PdfSaveOptions.md +25 -0
  23. data/docs/PointF.md +10 -0
  24. data/docs/RectangleF.md +18 -0
  25. data/docs/RenderingSaveOptions.md +13 -0
  26. data/docs/SVGSaveOptions.md +18 -0
  27. data/docs/SWFSaveOptions.md +13 -0
  28. data/docs/SaaSposeResponse.md +0 -2
  29. data/docs/SaveAsResponse.md +10 -0
  30. data/docs/SaveOptionsModel.md +9 -0
  31. data/docs/SaveOptionsRequest.md +10 -0
  32. data/docs/StorageApi.md +799 -0
  33. data/docs/StorageExist.md +8 -0
  34. data/docs/StorageFile.md +12 -0
  35. data/docs/{SharpModel.md → UploadResponse.md} +2 -2
  36. data/docs/XAMLSaveOptions.md +12 -0
  37. data/docs/XPSSaveOptions.md +13 -0
  38. data/lib/AsposeDiagramCloud.rb +74 -0
  39. data/lib/AsposeDiagramCloud/api/diagram_api.rb +300 -0
  40. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/api/o_auth_api.rb +3 -3
  41. data/lib/AsposeDiagramCloud/api/storage_api.rb +905 -0
  42. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/api_client.rb +7 -4
  43. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/api_error.rb +2 -2
  44. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/configuration.rb +4 -18
  45. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/models/access_token_response.rb +2 -2
  46. data/lib/{aspose_diagram_cloud/models/file_format_request.rb → AsposeDiagramCloud/models/create_new_response.rb} +10 -10
  47. data/lib/AsposeDiagramCloud/models/diagram_save_options.rb +244 -0
  48. data/lib/{aspose_diagram_cloud/models/link.rb → AsposeDiagramCloud/models/disc_usage.rb} +29 -35
  49. data/lib/AsposeDiagramCloud/models/error.rb +219 -0
  50. data/lib/{aspose_diagram_cloud/models/saa_spose_response.rb → AsposeDiagramCloud/models/error_details.rb} +22 -20
  51. data/lib/AsposeDiagramCloud/models/file_version.rb +264 -0
  52. data/lib/{aspose_diagram_cloud/models/page_model.rb → AsposeDiagramCloud/models/file_versions.rb} +13 -21
  53. data/lib/AsposeDiagramCloud/models/files_list.rb +191 -0
  54. data/lib/AsposeDiagramCloud/models/files_upload_result.rb +203 -0
  55. data/lib/AsposeDiagramCloud/models/html_save_options.rb +330 -0
  56. data/lib/AsposeDiagramCloud/models/image_save_options.rb +492 -0
  57. data/lib/AsposeDiagramCloud/models/modify_response.rb +202 -0
  58. data/lib/{aspose_diagram_cloud/models/diagram_response.rb → AsposeDiagramCloud/models/object_exist.rb} +27 -29
  59. data/lib/AsposeDiagramCloud/models/page_size.rb +221 -0
  60. data/lib/AsposeDiagramCloud/models/pdf_digital_signature_details.rb +248 -0
  61. data/lib/AsposeDiagramCloud/models/pdf_encryption_details.rb +260 -0
  62. data/lib/AsposeDiagramCloud/models/pdf_save_options.rb +408 -0
  63. data/lib/{aspose_diagram_cloud/models/save_result.rb → AsposeDiagramCloud/models/point_f.rb} +37 -24
  64. data/lib/AsposeDiagramCloud/models/rectangle_f.rb +333 -0
  65. data/lib/AsposeDiagramCloud/models/rendering_save_options.rb +276 -0
  66. data/lib/{aspose_diagram_cloud/models/sharp_model.rb → AsposeDiagramCloud/models/saa_spose_response.rb} +5 -14
  67. data/lib/{aspose_diagram_cloud/models/save_response.rb → AsposeDiagramCloud/models/save_as_response.rb} +24 -27
  68. data/lib/AsposeDiagramCloud/models/save_options_model.rb +235 -0
  69. data/lib/{aspose_diagram_cloud/models/diagram_model.rb → AsposeDiagramCloud/models/save_options_request.rb} +19 -12
  70. data/lib/AsposeDiagramCloud/models/storage_exist.rb +194 -0
  71. data/lib/AsposeDiagramCloud/models/storage_file.rb +239 -0
  72. data/lib/AsposeDiagramCloud/models/svg_save_options.rb +321 -0
  73. data/lib/AsposeDiagramCloud/models/swf_save_options.rb +271 -0
  74. data/lib/AsposeDiagramCloud/models/upload_response.rb +188 -0
  75. data/lib/AsposeDiagramCloud/models/xaml_save_options.rb +262 -0
  76. data/lib/AsposeDiagramCloud/models/xps_save_options.rb +271 -0
  77. data/lib/{aspose_diagram_cloud → AsposeDiagramCloud}/version.rb +3 -3
  78. data/spec/api/test_convert_spec.rb +308 -0
  79. data/spec/api_client_spec.rb +2 -2
  80. data/spec/configuration_spec.rb +5 -5
  81. data/spec/spec_helper.rb +10 -6
  82. data/testData/FileUpload.vdx +437 -0
  83. metadata +80 -55
  84. data/docs/DiagramFileApi.md +0 -228
  85. data/docs/DiagramModel.md +0 -9
  86. data/docs/DiagramResponse.md +0 -10
  87. data/docs/Link.md +0 -11
  88. data/docs/PageModel.md +0 -9
  89. data/docs/SaveResponse.md +0 -10
  90. data/docs/SaveResult.md +0 -10
  91. data/lib/aspose_diagram_cloud.rb +0 -51
  92. data/lib/aspose_diagram_cloud/api/diagram_file_api.rb +0 -304
  93. data/spec/api/diagram_file_api_spec.rb +0 -118
  94. data/spec/api/o_auth_api_spec.rb +0 -56
  95. data/spec/models/access_token_response_spec.rb +0 -84
  96. data/spec/models/diagram_model_spec.rb +0 -48
  97. data/spec/models/diagram_response_spec.rb +0 -54
  98. data/spec/models/file_format_request_spec.rb +0 -42
  99. data/spec/models/link_spec.rb +0 -60
  100. data/spec/models/page_model_spec.rb +0 -48
  101. data/spec/models/saa_spose_response_spec.rb +0 -48
  102. data/spec/models/save_response_spec.rb +0 -54
  103. data/spec/models/save_result_spec.rb +0 -54
  104. data/spec/models/sharp_model_spec.rb +0 -42
@@ -1,10 +0,0 @@
1
- # AsposeDiagramCloud::SaveResult
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **source_document** | [**Link**](Link.md) | | [optional]
7
- **dest_document** | [**Link**](Link.md) | | [optional]
8
- **additional_items** | [**Array<Link>**](Link.md) | | [optional]
9
-
10
-
@@ -1,51 +0,0 @@
1
- =begin
2
- #Web API Swagger specification
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
10
-
11
- =end
12
-
13
- # Common files
14
- require 'aspose_diagram_cloud/api_client'
15
- require 'aspose_diagram_cloud/api_error'
16
- require 'aspose_diagram_cloud/version'
17
- require 'aspose_diagram_cloud/configuration'
18
-
19
- # Models
20
- require 'aspose_diagram_cloud/models/access_token_response'
21
- require 'aspose_diagram_cloud/models/diagram_model'
22
- require 'aspose_diagram_cloud/models/file_format_request'
23
- require 'aspose_diagram_cloud/models/link'
24
- require 'aspose_diagram_cloud/models/page_model'
25
- require 'aspose_diagram_cloud/models/saa_spose_response'
26
- require 'aspose_diagram_cloud/models/save_result'
27
- require 'aspose_diagram_cloud/models/sharp_model'
28
- require 'aspose_diagram_cloud/models/diagram_response'
29
- require 'aspose_diagram_cloud/models/save_response'
30
-
31
- # APIs
32
- require 'aspose_diagram_cloud/api/diagram_file_api'
33
- require 'aspose_diagram_cloud/api/o_auth_api'
34
-
35
- module AsposeDiagramCloud
36
- class << self
37
- # Customize default settings for the SDK using block.
38
- # AsposeDiagramCloud.configure do |config|
39
- # config.username = "xxx"
40
- # config.password = "xxx"
41
- # end
42
- # If no block given, return the default Configuration object.
43
- def configure
44
- if block_given?
45
- yield(Configuration.default)
46
- else
47
- Configuration.default
48
- end
49
- end
50
- end
51
- end
@@ -1,304 +0,0 @@
1
- =begin
2
- #Web API Swagger specification
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require "uri"
14
-
15
- module AsposeDiagramCloud
16
- class DiagramFileApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- request_token
22
- end
23
-
24
- #
25
- # Gets a request token from server
26
- #
27
- def request_token
28
- config = @api_client.config
29
- base_path = config.base_path
30
- config.base_path = '/'
31
- request_url = "/oauth2/token"
32
- post_data = "grant_type=client_credentials" + "&client_id=" + config.api_key['app_sid'] + "&client_secret=" + config.api_key['api_key']
33
- data, status_code, header = @api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
34
- @api_client.config.access_token = data[:access_token]
35
- @api_client.config.base_path = base_path
36
- @api_client.default_headers["Authorization"] ="Bearer " + data[:access_token]
37
- end
38
-
39
- # Read document info or export.
40
- #
41
- # @param name The document name.
42
- # @param [Hash] opts the optional parameters
43
- # @option opts [String] :format The exported file format.
44
- # @option opts [String] :folder The document folder.
45
- # @option opts [String] :storage storage name.
46
- # @return [File]
47
- def diagram_file_get_diagram(name, opts = {})
48
- data, _status_code, _headers = diagram_file_get_diagram_with_http_info(name, opts)
49
- request_token if _status_code == 401
50
- return data
51
- end
52
-
53
- # Read document info or export.
54
- #
55
- # @param name The document name.
56
- # @param [Hash] opts the optional parameters
57
- # @option opts [String] :format The exported file format.
58
- # @option opts [String] :folder The document folder.
59
- # @option opts [String] :storage storage name.
60
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
61
- def diagram_file_get_diagram_with_http_info(name, opts = {})
62
- if @api_client.config.debugging
63
- @api_client.config.logger.debug "Calling API: DiagramFileApi.diagram_file_get_diagram ..."
64
- end
65
- # verify the required parameter 'name' is set
66
- if @api_client.config.client_side_validation && name.nil?
67
- fail ArgumentError, "Missing the required parameter 'name' when calling DiagramFileApi.diagram_file_get_diagram"
68
- end
69
- # resource path
70
- local_var_path = "/diagram/{name}".sub('{' + 'name' + '}', name.to_s)
71
-
72
- # query parameters
73
- query_params = {}
74
- query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
75
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
76
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
77
-
78
- # header parameters
79
- header_params = {}
80
- # HTTP header 'Accept' (if needed)
81
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
82
- # HTTP header 'Content-Type'
83
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
84
-
85
- # form parameters
86
- form_params = {}
87
-
88
- # http body (model)
89
- post_body = nil
90
- auth_names = []
91
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
92
- :header_params => header_params,
93
- :query_params => query_params,
94
- :form_params => form_params,
95
- :body => post_body,
96
- :auth_names => auth_names,
97
- :return_type => 'File')
98
- if @api_client.config.debugging
99
- @api_client.config.logger.debug "API called: DiagramFileApi#diagram_file_get_diagram\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
- end
101
- return data, status_code, headers
102
- end
103
-
104
- # Convert document and save result to storage.
105
- #
106
- # @param name The document name.
107
- # @param [Hash] opts the optional parameters
108
- # @option opts [FileFormatRequest] :format Save format.
109
- # @option opts [String] :newfilename The new file name.
110
- # @option opts [String] :folder The document folder.
111
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false. (default to false)
112
- # @option opts [String] :storage storage name.
113
- # @return [SaveResponse]
114
- def diagram_file_post_save_as(name, opts = {})
115
- data, _status_code, _headers = diagram_file_post_save_as_with_http_info(name, opts)
116
- request_token if _status_code == 401
117
- return data
118
- end
119
-
120
- # Convert document and save result to storage.
121
- #
122
- # @param name The document name.
123
- # @param [Hash] opts the optional parameters
124
- # @option opts [FileFormatRequest] :format Save format.
125
- # @option opts [String] :newfilename The new file name.
126
- # @option opts [String] :folder The document folder.
127
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
128
- # @option opts [String] :storage storage name.
129
- # @return [Array<(SaveResponse, Fixnum, Hash)>] SaveResponse data, response status code and response headers
130
- def diagram_file_post_save_as_with_http_info(name, opts = {})
131
- if @api_client.config.debugging
132
- @api_client.config.logger.debug "Calling API: DiagramFileApi.diagram_file_post_save_as ..."
133
- end
134
- # verify the required parameter 'name' is set
135
- if @api_client.config.client_side_validation && name.nil?
136
- fail ArgumentError, "Missing the required parameter 'name' when calling DiagramFileApi.diagram_file_post_save_as"
137
- end
138
- # resource path
139
- local_var_path = "/diagram/{name}/SaveAs".sub('{' + 'name' + '}', name.to_s)
140
-
141
- # query parameters
142
- query_params = {}
143
- query_params[:'newfilename'] = opts[:'newfilename'] if !opts[:'newfilename'].nil?
144
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
145
- query_params[:'IsOverwrite'] = opts[:'is_overwrite'] if !opts[:'is_overwrite'].nil?
146
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
147
-
148
- # header parameters
149
- header_params = {}
150
- # HTTP header 'Accept' (if needed)
151
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
152
- # HTTP header 'Content-Type'
153
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
154
-
155
- # form parameters
156
- form_params = {}
157
-
158
- # http body (model)
159
- post_body = @api_client.object_to_http_body(opts[:'format'])
160
- auth_names = []
161
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
162
- :header_params => header_params,
163
- :query_params => query_params,
164
- :form_params => form_params,
165
- :body => post_body,
166
- :auth_names => auth_names,
167
- :return_type => 'SaveResponse')
168
- if @api_client.config.debugging
169
- @api_client.config.logger.debug "API called: DiagramFileApi#diagram_file_post_save_as\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
170
- end
171
- return data, status_code, headers
172
- end
173
-
174
- # Create new diagram and save result to storage.
175
- #
176
- # @param name The new document name.
177
- # @param [Hash] opts the optional parameters
178
- # @option opts [String] :folder The new document folder.
179
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false. (default to false)
180
- # @option opts [String] :storage storage name.
181
- # @return [SaaSposeResponse]
182
- def diagram_file_put_create(name, opts = {})
183
- data, _status_code, _headers = diagram_file_put_create_with_http_info(name, opts)
184
- request_token if _status_code == 401
185
- return data
186
- end
187
-
188
- # Create new diagram and save result to storage.
189
- #
190
- # @param name The new document name.
191
- # @param [Hash] opts the optional parameters
192
- # @option opts [String] :folder The new document folder.
193
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
194
- # @option opts [String] :storage storage name.
195
- # @return [Array<(SaaSposeResponse, Fixnum, Hash)>] SaaSposeResponse data, response status code and response headers
196
- def diagram_file_put_create_with_http_info(name, opts = {})
197
- if @api_client.config.debugging
198
- @api_client.config.logger.debug "Calling API: DiagramFileApi.diagram_file_put_create ..."
199
- end
200
- # verify the required parameter 'name' is set
201
- if @api_client.config.client_side_validation && name.nil?
202
- fail ArgumentError, "Missing the required parameter 'name' when calling DiagramFileApi.diagram_file_put_create"
203
- end
204
- # resource path
205
- local_var_path = "/diagram/{name}".sub('{' + 'name' + '}', name.to_s)
206
-
207
- # query parameters
208
- query_params = {}
209
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
210
- query_params[:'IsOverwrite'] = opts[:'is_overwrite'] if !opts[:'is_overwrite'].nil?
211
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
212
-
213
- # header parameters
214
- header_params = {}
215
- # HTTP header 'Accept' (if needed)
216
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
217
- # HTTP header 'Content-Type'
218
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
219
-
220
- # form parameters
221
- form_params = {}
222
-
223
- # http body (model)
224
- post_body = nil
225
- auth_names = []
226
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
227
- :header_params => header_params,
228
- :query_params => query_params,
229
- :form_params => form_params,
230
- :body => post_body,
231
- :auth_names => auth_names,
232
- :return_type => 'SaaSposeResponse')
233
- if @api_client.config.debugging
234
- @api_client.config.logger.debug "API called: DiagramFileApi#diagram_file_put_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
235
- end
236
- return data, status_code, headers
237
- end
238
-
239
- # Upload file and save result to storage.
240
- #
241
- # @param name The document name.
242
- # @param [Hash] opts the optional parameters
243
- # @option opts [String] :folder The document folder.
244
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false. (default to false)
245
- # @option opts [String] :storage storage name.
246
- # @return [SaaSposeResponse]
247
- def diagram_file_put_upload(name, opts = {})
248
- data, _status_code, _headers = diagram_file_put_upload_with_http_info(name, opts)
249
- request_token if _status_code == 401
250
- return data
251
- end
252
-
253
- # Upload file and save result to storage.
254
- #
255
- # @param name The document name.
256
- # @param [Hash] opts the optional parameters
257
- # @option opts [String] :folder The document folder.
258
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
259
- # @option opts [String] :storage storage name.
260
- # @return [Array<(SaaSposeResponse, Fixnum, Hash)>] SaaSposeResponse data, response status code and response headers
261
- def diagram_file_put_upload_with_http_info(name, opts = {})
262
- if @api_client.config.debugging
263
- @api_client.config.logger.debug "Calling API: DiagramFileApi.diagram_file_put_upload ..."
264
- end
265
- # verify the required parameter 'name' is set
266
- if @api_client.config.client_side_validation && name.nil?
267
- fail ArgumentError, "Missing the required parameter 'name' when calling DiagramFileApi.diagram_file_put_upload"
268
- end
269
- # resource path
270
- local_var_path = "/diagram/{name}/upload".sub('{' + 'name' + '}', name.to_s)
271
-
272
- # query parameters
273
- query_params = {}
274
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
275
- query_params[:'IsOverwrite'] = opts[:'is_overwrite'] if !opts[:'is_overwrite'].nil?
276
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
277
-
278
- # header parameters
279
- header_params = {}
280
- # HTTP header 'Accept' (if needed)
281
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
282
- # HTTP header 'Content-Type'
283
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
284
-
285
- # form parameters
286
- form_params = {}
287
-
288
- # http body (model)
289
- post_body = nil
290
- auth_names = []
291
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
292
- :header_params => header_params,
293
- :query_params => query_params,
294
- :form_params => form_params,
295
- :body => post_body,
296
- :auth_names => auth_names,
297
- :return_type => 'SaaSposeResponse')
298
- if @api_client.config.debugging
299
- @api_client.config.logger.debug "API called: DiagramFileApi#diagram_file_put_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
300
- end
301
- return data, status_code, headers
302
- end
303
- end
304
- end
@@ -1,118 +0,0 @@
1
- =begin
2
- #Web API Swagger specification
3
-
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
-
16
- # Unit tests for AsposeDiagramCloud::DiagramFileApi
17
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
- # Please update as you see appropriate
19
- describe 'DiagramFileApi' do
20
- before do
21
- # run before each test
22
- conf = AsposeDiagramCloud::Configuration.new
23
- conf.api_key['app_sid'] = $client_id
24
- conf.api_key['api_key'] = $client_secret
25
- client = AsposeDiagramCloud::ApiClient.new(conf)
26
- @instance = AsposeDiagramCloud::DiagramFileApi.new(client)
27
- end
28
-
29
- after do
30
- # run after each test
31
- end
32
-
33
- describe 'test an instance of DiagramFileApi' do
34
- it 'should create an instance of DiagramFileApi' do
35
- expect(@instance).to be_instance_of(AsposeDiagramCloud::DiagramFileApi)
36
- end
37
- end
38
-
39
- # unit tests for diagram_file_get_diagram
40
- # Read document info or export.
41
- #
42
- # @param name The document name.
43
- # @param [Hash] opts the optional parameters
44
- # @option opts [String] :format The exported file format.
45
- # @option opts [String] :folder The document folder.
46
- # @option opts [String] :storage storage name.
47
- # @return [File]
48
- describe 'diagram_file_get_diagram test' do
49
- it "should work" do
50
- name = 'file_get_1.vdx'
51
- folder = $TEMPFOLDER
52
- format="pdf"
53
- @instance.diagram_file_get_diagram(name, {:name=>name, :format=>format, :folder=>folder})
54
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
- end
56
- end
57
-
58
- # unit tests for diagram_file_post_save_as
59
- # Convert document and save result to storage.
60
- #
61
- # @param name The document name.
62
- # @param [Hash] opts the optional parameters
63
- # @option opts [FileFormatRequest] :format Save format.
64
- # @option opts [String] :newfilename The new file name.
65
- # @option opts [String] :folder The document folder.
66
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
67
- # @option opts [String] :storage storage name.
68
- # @return [SaveResponse]
69
- describe 'diagram_file_post_save_as test' do
70
- it "should work" do
71
- name = 'file_get_1.vdx'
72
- folder = $TEMPFOLDER
73
- is_overwrite=true
74
- format=AsposeDiagramCloud::FileFormatRequest.new({:Format=>"pdf"})
75
- newfilename = "file_saveas_ruby.pdf";
76
-
77
- @instance.diagram_file_post_save_as(name, {:name=>name, :is_overwrite=>is_overwrite, :folder=>folder,:format=>format,:newfilename=>newfilename})
78
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
- end
80
- end
81
-
82
- # unit tests for diagram_file_put_create
83
- # Create new diagram and save result to storage.
84
- #
85
- # @param name The new document name.
86
- # @param [Hash] opts the optional parameters
87
- # @option opts [String] :folder The new document folder.
88
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
89
- # @option opts [String] :storage storage name.
90
- # @return [SaaSposeResponse]
91
- describe 'diagram_file_put_create test' do
92
- it "should work" do
93
- name = 'file_create_ruby.vdx'
94
- folder = $TEMPFOLDER
95
- is_overwrite=true
96
- @instance.diagram_file_put_create(name, {:name=>name, :is_overwrite=>is_overwrite, :folder=>folder})
97
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
98
- end
99
- end
100
-
101
- # unit tests for diagram_file_put_upload
102
- # Upload file and save result to storage.
103
- #
104
- # @param name The document name.
105
- # @param [Hash] opts the optional parameters
106
- # @option opts [String] :folder The document folder.
107
- # @option opts [BOOLEAN] :is_overwrite If true overwrite the same name file.The default value is false.
108
- # @option opts [String] :storage storage name.
109
- # @return [SaaSposeResponse]
110
- describe 'diagram_file_put_upload test' do
111
- it "should work" do
112
- #use aspose-storage-cloud
113
- #https://github.com/aspose-storage-cloud/aspose-storage-cloud-ruby
114
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
- end
116
- end
117
-
118
- end