AsposeDiagramCloud 18.10 → 20.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/AsposeDiagramCloud.gemspec +46 -0
  3. data/Gemfile +7 -0
  4. data/README.md +74 -0
  5. data/Rakefile +8 -0
  6. data/git_push.sh +55 -0
  7. data/lib/AsposeDiagramCloud.rb +85 -0
  8. data/lib/AsposeDiagramCloud/api/diagram_api.rb +768 -0
  9. data/lib/AsposeDiagramCloud/api/o_auth_api.rb +93 -0
  10. data/lib/AsposeDiagramCloud/api/storage_api.rb +905 -0
  11. data/lib/AsposeDiagramCloud/api_client.rb +391 -0
  12. data/lib/AsposeDiagramCloud/api_error.rb +38 -0
  13. data/lib/AsposeDiagramCloud/configuration.rb +209 -0
  14. data/lib/AsposeDiagramCloud/models/access_token_response.rb +251 -0
  15. data/lib/AsposeDiagramCloud/models/api_response_of_list_of_page_data.rb +190 -0
  16. data/lib/AsposeDiagramCloud/models/create_new_response.rb +188 -0
  17. data/lib/AsposeDiagramCloud/models/diagram_save_options.rb +244 -0
  18. data/lib/AsposeDiagramCloud/models/disc_usage.rb +209 -0
  19. data/lib/AsposeDiagramCloud/models/draw_shape_data.rb +262 -0
  20. data/lib/AsposeDiagramCloud/models/ellipse_data.rb +262 -0
  21. data/lib/AsposeDiagramCloud/models/error.rb +219 -0
  22. data/lib/AsposeDiagramCloud/models/error_details.rb +204 -0
  23. data/lib/AsposeDiagramCloud/models/file_version.rb +264 -0
  24. data/lib/AsposeDiagramCloud/models/file_versions.rb +191 -0
  25. data/lib/AsposeDiagramCloud/models/files_list.rb +191 -0
  26. data/lib/AsposeDiagramCloud/models/files_upload_result.rb +203 -0
  27. data/lib/AsposeDiagramCloud/models/html_save_options.rb +330 -0
  28. data/lib/AsposeDiagramCloud/models/image_save_options.rb +492 -0
  29. data/lib/AsposeDiagramCloud/models/line_data.rb +273 -0
  30. data/lib/AsposeDiagramCloud/models/modify_response.rb +202 -0
  31. data/lib/AsposeDiagramCloud/models/object_exist.rb +209 -0
  32. data/lib/AsposeDiagramCloud/models/page_data.rb +216 -0
  33. data/lib/AsposeDiagramCloud/models/page_setting.rb +219 -0
  34. data/lib/AsposeDiagramCloud/models/page_size.rb +221 -0
  35. data/lib/AsposeDiagramCloud/models/pdf_digital_signature_details.rb +248 -0
  36. data/lib/AsposeDiagramCloud/models/pdf_encryption_details.rb +260 -0
  37. data/lib/AsposeDiagramCloud/models/pdf_save_options.rb +408 -0
  38. data/lib/AsposeDiagramCloud/models/point_f.rb +221 -0
  39. data/lib/AsposeDiagramCloud/models/polyline_data.rb +273 -0
  40. data/lib/AsposeDiagramCloud/models/rectangle_f.rb +333 -0
  41. data/lib/AsposeDiagramCloud/models/rendering_save_options.rb +276 -0
  42. data/lib/AsposeDiagramCloud/models/saa_spose_response.rb +179 -0
  43. data/lib/AsposeDiagramCloud/models/save_as_response.rb +208 -0
  44. data/lib/AsposeDiagramCloud/models/save_options_model.rb +235 -0
  45. data/lib/AsposeDiagramCloud/models/save_options_request.rb +206 -0
  46. data/lib/AsposeDiagramCloud/models/shape_data.rb +221 -0
  47. data/lib/AsposeDiagramCloud/models/shape_style_data.rb +189 -0
  48. data/lib/AsposeDiagramCloud/models/storage_exist.rb +194 -0
  49. data/lib/AsposeDiagramCloud/models/storage_file.rb +239 -0
  50. data/lib/AsposeDiagramCloud/models/svg_save_options.rb +321 -0
  51. data/lib/AsposeDiagramCloud/models/swf_save_options.rb +271 -0
  52. data/lib/AsposeDiagramCloud/models/text_style_data.rb +253 -0
  53. data/lib/AsposeDiagramCloud/models/upload_response.rb +188 -0
  54. data/lib/AsposeDiagramCloud/models/xaml_save_options.rb +262 -0
  55. data/lib/AsposeDiagramCloud/models/xps_save_options.rb +271 -0
  56. data/lib/AsposeDiagramCloud/version.rb +15 -0
  57. data/spec/_spec.rb +308 -0
  58. data/spec/api/test_convert_spec.rb +308 -0
  59. data/spec/api/test_drawing_spec.rb +136 -0
  60. data/spec/api/test_page_spec.rb +92 -0
  61. data/spec/api_client_spec.rb +226 -0
  62. data/spec/configuration_spec.rb +42 -0
  63. data/spec/spec_helper.rb +120 -0
  64. data/testData/FileUpload.vdx +437 -0
  65. metadata +118 -49
@@ -0,0 +1,262 @@
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 DrawShapeData
18
+ attr_accessor :pin_x
19
+
20
+ attr_accessor :pin_y
21
+
22
+ attr_accessor :width
23
+
24
+ attr_accessor :height
25
+
26
+ attr_accessor :shape_style_data
27
+
28
+ attr_accessor :text
29
+
30
+ attr_accessor :text_style_data
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'pin_x' => :'PinX',
37
+ :'pin_y' => :'PinY',
38
+ :'width' => :'Width',
39
+ :'height' => :'Height',
40
+ :'shape_style_data' => :'ShapeStyleData',
41
+ :'text' => :'Text',
42
+ :'text_style_data' => :'TextStyleData'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'pin_x' => :'Float',
50
+ :'pin_y' => :'Float',
51
+ :'width' => :'Float',
52
+ :'height' => :'Float',
53
+ :'shape_style_data' => :'ShapeStyleData',
54
+ :'text' => :'String',
55
+ :'text_style_data' => :'TextStyleData'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66
+
67
+ if attributes.has_key?(:'PinX')
68
+ self.pin_x = attributes[:'PinX']
69
+ end
70
+
71
+ if attributes.has_key?(:'PinY')
72
+ self.pin_y = attributes[:'PinY']
73
+ end
74
+
75
+ if attributes.has_key?(:'Width')
76
+ self.width = attributes[:'Width']
77
+ end
78
+
79
+ if attributes.has_key?(:'Height')
80
+ self.height = attributes[:'Height']
81
+ end
82
+
83
+ if attributes.has_key?(:'ShapeStyleData')
84
+ self.shape_style_data = attributes[:'ShapeStyleData']
85
+ end
86
+
87
+ if attributes.has_key?(:'Text')
88
+ self.text = attributes[:'Text']
89
+ end
90
+
91
+ if attributes.has_key?(:'TextStyleData')
92
+ self.text_style_data = attributes[:'TextStyleData']
93
+ end
94
+
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @pin_x.nil?
102
+ invalid_properties.push("invalid value for 'pin_x', pin_x cannot be nil.")
103
+ end
104
+
105
+ if @pin_y.nil?
106
+ invalid_properties.push("invalid value for 'pin_y', pin_y cannot be nil.")
107
+ end
108
+
109
+ if @width.nil?
110
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
111
+ end
112
+
113
+ if @height.nil?
114
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
115
+ end
116
+
117
+ return invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return false if @pin_x.nil?
124
+ return false if @pin_y.nil?
125
+ return false if @width.nil?
126
+ return false if @height.nil?
127
+ return true
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ pin_x == o.pin_x &&
136
+ pin_y == o.pin_y &&
137
+ width == o.width &&
138
+ height == o.height &&
139
+ shape_style_data == o.shape_style_data &&
140
+ text == o.text &&
141
+ text_style_data == o.text_style_data
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Fixnum] Hash code
152
+ def hash
153
+ [pin_x, pin_y, width, height, shape_style_data, text, text_style_data].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :BOOLEAN
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ temp_model = AsposeDiagramCloud.const_get(type).new
214
+ temp_model.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ next if value.nil?
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map{ |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,262 @@
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 EllipseData
18
+ attr_accessor :pin_x
19
+
20
+ attr_accessor :pin_y
21
+
22
+ attr_accessor :width
23
+
24
+ attr_accessor :height
25
+
26
+ attr_accessor :shape_style_data
27
+
28
+ attr_accessor :text
29
+
30
+ attr_accessor :text_style_data
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'pin_x' => :'PinX',
37
+ :'pin_y' => :'PinY',
38
+ :'width' => :'Width',
39
+ :'height' => :'Height',
40
+ :'shape_style_data' => :'ShapeStyleData',
41
+ :'text' => :'Text',
42
+ :'text_style_data' => :'TextStyleData'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'pin_x' => :'Float',
50
+ :'pin_y' => :'Float',
51
+ :'width' => :'Float',
52
+ :'height' => :'Float',
53
+ :'shape_style_data' => :'ShapeStyleData',
54
+ :'text' => :'String',
55
+ :'text_style_data' => :'TextStyleData'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66
+
67
+ if attributes.has_key?(:'PinX')
68
+ self.pin_x = attributes[:'PinX']
69
+ end
70
+
71
+ if attributes.has_key?(:'PinY')
72
+ self.pin_y = attributes[:'PinY']
73
+ end
74
+
75
+ if attributes.has_key?(:'Width')
76
+ self.width = attributes[:'Width']
77
+ end
78
+
79
+ if attributes.has_key?(:'Height')
80
+ self.height = attributes[:'Height']
81
+ end
82
+
83
+ if attributes.has_key?(:'ShapeStyleData')
84
+ self.shape_style_data = attributes[:'ShapeStyleData']
85
+ end
86
+
87
+ if attributes.has_key?(:'Text')
88
+ self.text = attributes[:'Text']
89
+ end
90
+
91
+ if attributes.has_key?(:'TextStyleData')
92
+ self.text_style_data = attributes[:'TextStyleData']
93
+ end
94
+
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @pin_x.nil?
102
+ invalid_properties.push("invalid value for 'pin_x', pin_x cannot be nil.")
103
+ end
104
+
105
+ if @pin_y.nil?
106
+ invalid_properties.push("invalid value for 'pin_y', pin_y cannot be nil.")
107
+ end
108
+
109
+ if @width.nil?
110
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
111
+ end
112
+
113
+ if @height.nil?
114
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
115
+ end
116
+
117
+ return invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return false if @pin_x.nil?
124
+ return false if @pin_y.nil?
125
+ return false if @width.nil?
126
+ return false if @height.nil?
127
+ return true
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ pin_x == o.pin_x &&
136
+ pin_y == o.pin_y &&
137
+ width == o.width &&
138
+ height == o.height &&
139
+ shape_style_data == o.shape_style_data &&
140
+ text == o.text &&
141
+ text_style_data == o.text_style_data
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Fixnum] Hash code
152
+ def hash
153
+ [pin_x, pin_y, width, height, shape_style_data, text, text_style_data].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :BOOLEAN
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ temp_model = AsposeDiagramCloud.const_get(type).new
214
+ temp_model.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ next if value.nil?
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map{ |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end