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
@@ -0,0 +1,271 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.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 'date'
14
+
15
+ module AsposeDiagramCloud
16
+
17
+ class SWFSaveOptions
18
+ attr_accessor :save_format
19
+
20
+ attr_accessor :default_font
21
+
22
+ attr_accessor :page_count
23
+
24
+ attr_accessor :viewer_included
25
+
26
+ attr_accessor :page_index
27
+
28
+ attr_accessor :save_foreground_pages_only
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'save_format' => :'SaveFormat',
56
+ :'default_font' => :'DefaultFont',
57
+ :'page_count' => :'PageCount',
58
+ :'viewer_included' => :'ViewerIncluded',
59
+ :'page_index' => :'PageIndex',
60
+ :'save_foreground_pages_only' => :'SaveForegroundPagesOnly'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'save_format' => :'String',
68
+ :'default_font' => :'String',
69
+ :'page_count' => :'Integer',
70
+ :'viewer_included' => :'BOOLEAN',
71
+ :'page_index' => :'Integer',
72
+ :'save_foreground_pages_only' => :'BOOLEAN'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes.has_key?(:'SaveFormat')
85
+ self.save_format = attributes[:'SaveFormat']
86
+ end
87
+
88
+ if attributes.has_key?(:'DefaultFont')
89
+ self.default_font = attributes[:'DefaultFont']
90
+ end
91
+
92
+ if attributes.has_key?(:'PageCount')
93
+ self.page_count = attributes[:'PageCount']
94
+ end
95
+
96
+ if attributes.has_key?(:'ViewerIncluded')
97
+ self.viewer_included = attributes[:'ViewerIncluded']
98
+ end
99
+
100
+ if attributes.has_key?(:'PageIndex')
101
+ self.page_index = attributes[:'PageIndex']
102
+ end
103
+
104
+ if attributes.has_key?(:'SaveForegroundPagesOnly')
105
+ self.save_foreground_pages_only = attributes[:'SaveForegroundPagesOnly']
106
+ end
107
+
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properies with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ if @save_format.nil?
115
+ invalid_properties.push("invalid value for 'save_format', save_format cannot be nil.")
116
+ end
117
+
118
+ return invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ return false if @save_format.nil?
125
+ save_format_validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
126
+ return false unless save_format_validator.valid?(@save_format)
127
+ return true
128
+ end
129
+
130
+ # Custom attribute writer method checking allowed values (enum).
131
+ # @param [Object] save_format Object to be assigned
132
+ def save_format=(save_format)
133
+ validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
134
+ unless validator.valid?(save_format)
135
+ fail ArgumentError, "invalid value for 'save_format', must be one of #{validator.allowable_values}."
136
+ end
137
+ @save_format = save_format
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ save_format == o.save_format &&
146
+ default_font == o.default_font &&
147
+ page_count == o.page_count &&
148
+ viewer_included == o.viewer_included &&
149
+ page_index == o.page_index &&
150
+ save_foreground_pages_only == o.save_foreground_pages_only
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [save_format, default_font, page_count, viewer_included, page_index, save_foreground_pages_only].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :DateTime
192
+ DateTime.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :BOOLEAN
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ temp_model = AsposeDiagramCloud.const_get(type).new
223
+ temp_model.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ next if value.nil?
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map{ |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+
269
+ end
270
+
271
+ end
@@ -0,0 +1,188 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.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 'date'
14
+
15
+ module AsposeDiagramCloud
16
+
17
+ class UploadResponse
18
+ attr_accessor :uploaded
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'uploaded' => :'Uploaded'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'uploaded' => :'String'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'Uploaded')
44
+ self.uploaded = attributes[:'Uploaded']
45
+ end
46
+
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properies with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ return invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ return true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ uploaded == o.uploaded
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [uploaded].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /\AArray<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ # Deserializes the data based on type
103
+ # @param string type Data type
104
+ # @param string value Value to be deserialized
105
+ # @return [Object] Deserialized data
106
+ def _deserialize(type, value)
107
+ case type.to_sym
108
+ when :DateTime
109
+ DateTime.parse(value)
110
+ when :Date
111
+ Date.parse(value)
112
+ when :String
113
+ value.to_s
114
+ when :Integer
115
+ value.to_i
116
+ when :Float
117
+ value.to_f
118
+ when :BOOLEAN
119
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
120
+ true
121
+ else
122
+ false
123
+ end
124
+ when :Object
125
+ # generic object (usually a Hash), return directly
126
+ value
127
+ when /\AArray<(?<inner_type>.+)>\z/
128
+ inner_type = Regexp.last_match[:inner_type]
129
+ value.map { |v| _deserialize(inner_type, v) }
130
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
131
+ k_type = Regexp.last_match[:k_type]
132
+ v_type = Regexp.last_match[:v_type]
133
+ {}.tap do |hash|
134
+ value.each do |k, v|
135
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
136
+ end
137
+ end
138
+ else # model
139
+ temp_model = AsposeDiagramCloud.const_get(type).new
140
+ temp_model.build_from_hash(value)
141
+ end
142
+ end
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_hash (backward compatibility)
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_body
153
+ to_hash
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ next if value.nil?
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+
188
+ end