aspose_diagram_cloud 19.10 → 20.3

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -94
  3. data/lib/AsposeDiagramCloud.rb +11 -0
  4. data/lib/AsposeDiagramCloud/api/diagram_api.rb +468 -0
  5. data/lib/AsposeDiagramCloud/models/api_response_of_list_of_page_data.rb +190 -0
  6. data/lib/AsposeDiagramCloud/models/draw_shape_data.rb +262 -0
  7. data/lib/AsposeDiagramCloud/models/ellipse_data.rb +262 -0
  8. data/lib/AsposeDiagramCloud/models/line_data.rb +273 -0
  9. data/lib/AsposeDiagramCloud/models/page_data.rb +216 -0
  10. data/lib/AsposeDiagramCloud/models/page_setting.rb +219 -0
  11. data/lib/AsposeDiagramCloud/models/polyline_data.rb +273 -0
  12. data/lib/AsposeDiagramCloud/models/shape_data.rb +221 -0
  13. data/lib/AsposeDiagramCloud/models/shape_style_data.rb +189 -0
  14. data/lib/AsposeDiagramCloud/models/text_style_data.rb +253 -0
  15. data/lib/AsposeDiagramCloud/version.rb +1 -1
  16. data/spec/_spec.rb +308 -0
  17. data/spec/api/test_drawing_spec.rb +136 -0
  18. data/spec/api/test_page_spec.rb +92 -0
  19. metadata +18 -37
  20. data/docs/AccessTokenResponse.md +0 -15
  21. data/docs/CreateNewResponse.md +0 -8
  22. data/docs/DiagramApi.md +0 -241
  23. data/docs/DiagramSaveOptions.md +0 -10
  24. data/docs/DiscUsage.md +0 -9
  25. data/docs/Error.md +0 -11
  26. data/docs/ErrorDetails.md +0 -9
  27. data/docs/FileVersion.md +0 -14
  28. data/docs/FileVersions.md +0 -8
  29. data/docs/FilesList.md +0 -8
  30. data/docs/FilesUploadResult.md +0 -9
  31. data/docs/HTMLSaveOptions.md +0 -19
  32. data/docs/ImageSaveOptions.md +0 -29
  33. data/docs/ModifyResponse.md +0 -9
  34. data/docs/OAuthApi.md +0 -60
  35. data/docs/ObjectExist.md +0 -9
  36. data/docs/PageSize.md +0 -8
  37. data/docs/PdfDigitalSignatureDetails.md +0 -11
  38. data/docs/PdfEncryptionDetails.md +0 -11
  39. data/docs/PdfSaveOptions.md +0 -25
  40. data/docs/PointF.md +0 -10
  41. data/docs/RectangleF.md +0 -18
  42. data/docs/RenderingSaveOptions.md +0 -13
  43. data/docs/SVGSaveOptions.md +0 -18
  44. data/docs/SWFSaveOptions.md +0 -13
  45. data/docs/SaaSposeResponse.md +0 -7
  46. data/docs/SaveAsResponse.md +0 -10
  47. data/docs/SaveOptionsModel.md +0 -9
  48. data/docs/SaveOptionsRequest.md +0 -10
  49. data/docs/StorageApi.md +0 -799
  50. data/docs/StorageExist.md +0 -8
  51. data/docs/StorageFile.md +0 -12
  52. data/docs/UploadResponse.md +0 -8
  53. data/docs/XAMLSaveOptions.md +0 -12
  54. data/docs/XPSSaveOptions.md +0 -13
@@ -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
@@ -0,0 +1,273 @@
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 LineData
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
+ attr_accessor :points
33
+
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'pin_x' => :'PinX',
39
+ :'pin_y' => :'PinY',
40
+ :'width' => :'Width',
41
+ :'height' => :'Height',
42
+ :'shape_style_data' => :'ShapeStyleData',
43
+ :'text' => :'Text',
44
+ :'text_style_data' => :'TextStyleData',
45
+ :'points' => :'Points'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'pin_x' => :'Float',
53
+ :'pin_y' => :'Float',
54
+ :'width' => :'Float',
55
+ :'height' => :'Float',
56
+ :'shape_style_data' => :'ShapeStyleData',
57
+ :'text' => :'String',
58
+ :'text_style_data' => :'TextStyleData',
59
+ :'points' => :'Array<PointF>'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
70
+
71
+ if attributes.has_key?(:'PinX')
72
+ self.pin_x = attributes[:'PinX']
73
+ end
74
+
75
+ if attributes.has_key?(:'PinY')
76
+ self.pin_y = attributes[:'PinY']
77
+ end
78
+
79
+ if attributes.has_key?(:'Width')
80
+ self.width = attributes[:'Width']
81
+ end
82
+
83
+ if attributes.has_key?(:'Height')
84
+ self.height = attributes[:'Height']
85
+ end
86
+
87
+ if attributes.has_key?(:'ShapeStyleData')
88
+ self.shape_style_data = attributes[:'ShapeStyleData']
89
+ end
90
+
91
+ if attributes.has_key?(:'Text')
92
+ self.text = attributes[:'Text']
93
+ end
94
+
95
+ if attributes.has_key?(:'TextStyleData')
96
+ self.text_style_data = attributes[:'TextStyleData']
97
+ end
98
+
99
+ if attributes.has_key?(:'Points')
100
+ if (value = attributes[:'Points']).is_a?(Array)
101
+ self.points = value
102
+ end
103
+ end
104
+
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properies with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ if @pin_x.nil?
112
+ invalid_properties.push("invalid value for 'pin_x', pin_x cannot be nil.")
113
+ end
114
+
115
+ if @pin_y.nil?
116
+ invalid_properties.push("invalid value for 'pin_y', pin_y cannot be nil.")
117
+ end
118
+
119
+ if @width.nil?
120
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
121
+ end
122
+
123
+ if @height.nil?
124
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
125
+ end
126
+
127
+ return invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ return false if @pin_x.nil?
134
+ return false if @pin_y.nil?
135
+ return false if @width.nil?
136
+ return false if @height.nil?
137
+ return true
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
+ pin_x == o.pin_x &&
146
+ pin_y == o.pin_y &&
147
+ width == o.width &&
148
+ height == o.height &&
149
+ shape_style_data == o.shape_style_data &&
150
+ text == o.text &&
151
+ text_style_data == o.text_style_data &&
152
+ points == o.points
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [pin_x, pin_y, width, height, shape_style_data, text, text_style_data, points].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.swagger_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :DateTime
194
+ DateTime.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :BOOLEAN
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ temp_model = AsposeDiagramCloud.const_get(type).new
225
+ temp_model.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ next if value.nil?
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map{ |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+
273
+ end