aspose_diagram_cloud 19.10 → 20.3

Sign up to get free protection for your applications and to get access to all the features.
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,190 @@
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 ApiResponseOfListOfPageData
18
+ attr_accessor :model
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'model' => :'Model'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'model' => :'Array<PageData>'
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?(:'Model')
44
+ if (value = attributes[:'Model']).is_a?(Array)
45
+ self.model = value
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ # Show invalid properties with the reasons. Usually used together with valid?
52
+ # @return Array for valid properies with the reasons
53
+ def list_invalid_properties
54
+ invalid_properties = Array.new
55
+ return invalid_properties
56
+ end
57
+
58
+ # Check to see if the all the properties in the model are valid
59
+ # @return true if the model is valid
60
+ def valid?
61
+ return true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ model == o.model
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [model].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = AsposeDiagramCloud.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map{ |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ 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 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