aspose_slides_cloud 21.3.0 → 21.9.0

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.
@@ -91,7 +91,7 @@ module AsposeSlidesCloud
91
91
  else
92
92
  fail ApiError.new(:code => response.status,
93
93
  :response_headers => response.headers,
94
- :response_body => response.body)
94
+ :response_body => response.body && !response.body.empty? ? response.body : response.reason_phrase)
95
95
  end
96
96
  end
97
97
 
@@ -137,7 +137,6 @@ module AsposeSlidesCloud
137
137
  # @param [String] path URL path (e.g. /account/new)
138
138
  # @option opts [Hash] :header_params Header parameters
139
139
  # @option opts [Hash] :query_params Query parameters
140
- # @option opts [Hash] :form_params Query parameters
141
140
  # @option opts [Object] :body HTTP body (JSON/XML)
142
141
  # @return [Typhoeus::Request] A Typhoeus Request
143
142
  def build_request(req, http_method, path, opts = {})
@@ -152,8 +151,7 @@ module AsposeSlidesCloud
152
151
  req.url path.sub(/^\/+/, '')
153
152
  req.headers = opts[:header_params]
154
153
  req.params = opts[:query_params]
155
- form_params = opts[:form_params] || {}
156
- req.body = build_request_body(req.headers, form_params, opts[:body], opts[:files])
154
+ req.body = build_request_body(req.headers, opts[:body], opts[:files])
157
155
  set_headers(req.headers)
158
156
  if @config.debugging
159
157
  @config.logger.debug "HTTP request\nMethod: #{req.method}\nPath: #{req.path}\nParams: #{req.params}\nHeaders: #{req.headers}\nBody: #{req.body}\n"
@@ -288,11 +286,17 @@ module AsposeSlidesCloud
288
286
  # Builds the HTTP request body
289
287
  #
290
288
  # @param [Hash] header_params Header parameters
291
- # @param [Hash] form_params Query parameters
292
289
  # @param [Object] body HTTP body (JSON/XML)
293
290
  # @return [String] HTTP body data in the form of string
294
- def build_request_body(header_params, form_params, body, files)
295
- if files and files.length > 0
291
+ def build_request_body(header_params, body, files)
292
+ partCount = 0
293
+ if files
294
+ partCount += files.length
295
+ end
296
+ if body
297
+ partCount += 1
298
+ end
299
+ if partCount > 1
296
300
  boundary = "7d70fb31-0eb9-4846-9ea8-933dfb69d8f1"
297
301
  header_params['Content-Type'] = "multipart/form-data; boundary=#{boundary}"
298
302
  data = ""
@@ -303,14 +307,16 @@ module AsposeSlidesCloud
303
307
  put_multipart!(data, boundary, index + 1, val)
304
308
  end
305
309
  data << "\r\n--#{boundary}--\r\n"
306
- data
307
- else
308
- header_params['Content-Type'] = 'text/json'
310
+ elsif partCount == 1
309
311
  if body
312
+ header_params['Content-Type'] = "text/json"
310
313
  data = body.is_a?(String) ? body : body.to_json
311
314
  else
312
- data = nil
315
+ header_params['Content-Type'] = "application/octet-stream"
316
+ data = files[0]
313
317
  end
318
+ else
319
+ data = nil
314
320
  end
315
321
  data
316
322
  end
@@ -318,7 +324,6 @@ module AsposeSlidesCloud
318
324
  # Builds the HTTP request body
319
325
  #
320
326
  # @param [Hash] header_params Header parameters
321
- # @param [Hash] form_params Query parameters
322
327
  # @param [Object] body HTTP body (JSON/XML)
323
328
  # @return [String] HTTP body data in the form of string
324
329
  def put_multipart!(data, boundary, part_index, part_data)
@@ -25,7 +25,7 @@ require 'date'
25
25
  module AsposeSlidesCloud
26
26
  # Represents export options for whole presentation.
27
27
  class ExportOptions
28
- # Setting user password to protect the PDF document.
28
+ # Default regular font for rendering the presentation.
29
29
  attr_accessor :default_regular_font
30
30
 
31
31
  attr_accessor :format
@@ -31,11 +31,27 @@ module AsposeSlidesCloud
31
31
  # True if the document should be opened as read-only.
32
32
  attr_accessor :read_only_recommended
33
33
 
34
+ # Password for read protection.
35
+ attr_accessor :read_password
36
+
37
+ # Password for write protection.
38
+ attr_accessor :write_password
39
+
40
+ # Returns true if the presentation protected for editing.
41
+ attr_accessor :is_write_protected
42
+
43
+ # Returns true if the presentation protected for reading.
44
+ attr_accessor :is_encrypted
45
+
34
46
  # Attribute mapping from ruby-style variable name to JSON key.
35
47
  def self.attribute_map
36
48
  super.merge({
37
49
  :'encrypt_document_properties' => :'EncryptDocumentProperties',
38
50
  :'read_only_recommended' => :'ReadOnlyRecommended',
51
+ :'read_password' => :'ReadPassword',
52
+ :'write_password' => :'WritePassword',
53
+ :'is_write_protected' => :'IsWriteProtected',
54
+ :'is_encrypted' => :'IsEncrypted',
39
55
  })
40
56
  end
41
57
 
@@ -44,6 +60,10 @@ module AsposeSlidesCloud
44
60
  super.merge({
45
61
  :'encrypt_document_properties' => :'BOOLEAN',
46
62
  :'read_only_recommended' => :'BOOLEAN',
63
+ :'read_password' => :'String',
64
+ :'write_password' => :'String',
65
+ :'is_write_protected' => :'BOOLEAN',
66
+ :'is_encrypted' => :'BOOLEAN',
47
67
  })
48
68
  end
49
69
 
@@ -59,12 +79,36 @@ module AsposeSlidesCloud
59
79
  if attributes.has_key?(:'ReadOnlyRecommended')
60
80
  self.read_only_recommended = attributes[:'ReadOnlyRecommended']
61
81
  end
82
+
83
+ if attributes.has_key?(:'ReadPassword')
84
+ self.read_password = attributes[:'ReadPassword']
85
+ end
86
+
87
+ if attributes.has_key?(:'WritePassword')
88
+ self.write_password = attributes[:'WritePassword']
89
+ end
90
+
91
+ if attributes.has_key?(:'IsWriteProtected')
92
+ self.is_write_protected = attributes[:'IsWriteProtected']
93
+ end
94
+
95
+ if attributes.has_key?(:'IsEncrypted')
96
+ self.is_encrypted = attributes[:'IsEncrypted']
97
+ end
62
98
  end
63
99
 
64
100
  # Show invalid properties with the reasons. Usually used together with valid?
65
101
  # @return Array for valid properties with the reasons
66
102
  def list_invalid_properties
67
103
  invalid_properties = super
104
+ if @is_write_protected.nil?
105
+ invalid_properties.push('invalid value for "is_write_protected", is_write_protected cannot be nil.')
106
+ end
107
+
108
+ if @is_encrypted.nil?
109
+ invalid_properties.push('invalid value for "is_encrypted", is_encrypted cannot be nil.')
110
+ end
111
+
68
112
  invalid_properties
69
113
  end
70
114
 
@@ -72,6 +116,8 @@ module AsposeSlidesCloud
72
116
  # @return true if the model is valid
73
117
  def valid?
74
118
  return false if !super
119
+ return false if @is_write_protected.nil?
120
+ return false if @is_encrypted.nil?
75
121
  true
76
122
  end
77
123
 
@@ -83,7 +129,11 @@ module AsposeSlidesCloud
83
129
  self_uri == o.self_uri &&
84
130
  alternate_links == o.alternate_links &&
85
131
  encrypt_document_properties == o.encrypt_document_properties &&
86
- read_only_recommended == o.read_only_recommended
132
+ read_only_recommended == o.read_only_recommended &&
133
+ read_password == o.read_password &&
134
+ write_password == o.write_password &&
135
+ is_write_protected == o.is_write_protected &&
136
+ is_encrypted == o.is_encrypted
87
137
  end
88
138
 
89
139
  # @see the `==` method
@@ -95,7 +145,7 @@ module AsposeSlidesCloud
95
145
  # Calculates hash code according to all attributes.
96
146
  # @return [Fixnum] Hash code
97
147
  def hash
98
- [self_uri, alternate_links, encrypt_document_properties, read_only_recommended].hash
148
+ [self_uri, alternate_links, encrypt_document_properties, read_only_recommended, read_password, write_password, is_write_protected, is_encrypted].hash
99
149
  end
100
150
 
101
151
  # Builds the object from hash
@@ -23,18 +23,23 @@ SOFTWARE.
23
23
  require 'date'
24
24
 
25
25
  module AsposeSlidesCloud
26
- class ScaleType
26
+ class ShapesAlignmentType
27
27
 
28
- DO_NOT_SCALE = "DoNotScale".freeze
29
- ENSURE_FIT = "EnsureFit".freeze
30
- MAXIMIZE = "Maximize".freeze
28
+ ALIGN_LEFT = "AlignLeft".freeze
29
+ ALIGN_RIGHT = "AlignRight".freeze
30
+ ALIGN_CENTER = "AlignCenter".freeze
31
+ ALIGN_TOP = "AlignTop".freeze
32
+ ALIGN_MIDDLE = "AlignMiddle".freeze
33
+ ALIGN_BOTTOM = "AlignBottom".freeze
34
+ DISTRIBUTE_HORIZONTALLY = "DistributeHorizontally".freeze
35
+ DISTRIBUTE_VERTICALLY = "DistributeVertically".freeze
31
36
 
32
37
  # Builds the enum from string
33
38
  # @param [String] The enum value in the form of the string
34
39
  # @return [String] The enum value
35
40
  def build_from_hash(value)
36
- constantValues = ScaleType.constants.select { |c| ScaleType::const_get(c) == value }
37
- raise "Invalid ENUM value #{value} for class #ScaleType" if constantValues.empty?
41
+ constantValues = ShapesAlignmentType.constants.select { |c| ShapesAlignmentType::const_get(c) == value }
42
+ raise "Invalid ENUM value #{value} for class #ShapesAlignmentType" if constantValues.empty?
38
43
  value
39
44
  end
40
45
  end
@@ -206,18 +206,17 @@ module AsposeSlidesCloud
206
206
  :'ReflectionEffect' => { },
207
207
  :'ResourceBase' => { },
208
208
  :'ResourceUri' => { },
209
- :'ScaleType' => { },
210
209
  :'Series' => { },
211
210
  :'SeriesMarker' => { },
212
211
  :'ShapeExportFormat' => { },
213
212
  :'ShapeImageExportOptions' => { },
214
213
  :'ShapeThumbnailBounds' => { },
215
214
  :'ShapesAlignmentType' => { },
216
- :'SizeType' => { },
217
215
  :'SlideComment' => { },
218
216
  :'SlideExportFormat' => { },
219
217
  :'SmartArtNode' => { },
220
218
  :'SoftEdgeEffect' => { },
219
+ :'SpecialSlideType' => { },
221
220
  :'StorageExist' => { },
222
221
  :'StorageFile' => { },
223
222
  :'TableCell' => { },
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeSlidesCloud
24
- VERSION = '21.3.0'
24
+ VERSION = '21.9.0'
25
25
  end
@@ -78,18 +78,17 @@ require 'aspose_slides_cloud/models/preset_shadow_effect'
78
78
  require 'aspose_slides_cloud/models/reflection_effect'
79
79
  require 'aspose_slides_cloud/models/resource_base'
80
80
  require 'aspose_slides_cloud/models/resource_uri'
81
- require 'aspose_slides_cloud/models/scale_type'
82
81
  require 'aspose_slides_cloud/models/series'
83
82
  require 'aspose_slides_cloud/models/series_marker'
84
83
  require 'aspose_slides_cloud/models/shape_export_format'
85
84
  require 'aspose_slides_cloud/models/shape_image_export_options'
86
85
  require 'aspose_slides_cloud/models/shape_thumbnail_bounds'
87
86
  require 'aspose_slides_cloud/models/shapes_alignment_type'
88
- require 'aspose_slides_cloud/models/size_type'
89
87
  require 'aspose_slides_cloud/models/slide_comment'
90
88
  require 'aspose_slides_cloud/models/slide_export_format'
91
89
  require 'aspose_slides_cloud/models/smart_art_node'
92
90
  require 'aspose_slides_cloud/models/soft_edge_effect'
91
+ require 'aspose_slides_cloud/models/special_slide_type'
93
92
  require 'aspose_slides_cloud/models/storage_exist'
94
93
  require 'aspose_slides_cloud/models/storage_file'
95
94
  require 'aspose_slides_cloud/models/table_cell'
@@ -194,7 +193,6 @@ require 'aspose_slides_cloud/models/video_frame'
194
193
 
195
194
  # APIs
196
195
  require 'aspose_slides_cloud/api/slides_api'
197
- require 'aspose_slides_cloud/api/slides_api_requests'
198
196
 
199
197
  module AsposeSlidesCloud
200
198
  class << self