cloudmersive-convert-api-client 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/AddPdfAnnotationRequest.md +9 -0
  4. data/docs/EditDocumentApi.md +56 -1
  5. data/docs/EditPdfApi.md +345 -0
  6. data/docs/GetPdfAnnotationsResult.md +9 -0
  7. data/docs/PdfAnnotation.md +19 -0
  8. data/docs/PresentationResult.md +10 -0
  9. data/docs/RemovePptxSlidesRequest.md +11 -0
  10. data/docs/SetPdfMetadataRequest.md +2 -2
  11. data/docs/SplitDocumentApi.md +65 -2
  12. data/docs/SplitPptxPresentationResult.md +9 -0
  13. data/docs/WorksheetResult.md +1 -0
  14. data/lib/cloudmersive-convert-api-client.rb +6 -0
  15. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +57 -2
  16. data/lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb +370 -0
  17. data/lib/cloudmersive-convert-api-client/api/split_document_api.rb +62 -0
  18. data/lib/cloudmersive-convert-api-client/models/add_pdf_annotation_request.rb +217 -0
  19. data/lib/cloudmersive-convert-api-client/models/get_pdf_annotations_result.rb +201 -0
  20. data/lib/cloudmersive-convert-api-client/models/pdf_annotation.rb +299 -0
  21. data/lib/cloudmersive-convert-api-client/models/presentation_result.rb +225 -0
  22. data/lib/cloudmersive-convert-api-client/models/remove_pptx_slides_request.rb +235 -0
  23. data/lib/cloudmersive-convert-api-client/models/set_pdf_metadata_request.rb +3 -1
  24. data/lib/cloudmersive-convert-api-client/models/split_pptx_presentation_result.rb +200 -0
  25. data/lib/cloudmersive-convert-api-client/models/worksheet_result.rb +30 -4
  26. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  27. data/spec/api/edit_document_api_spec.rb +13 -1
  28. data/spec/api/edit_pdf_api_spec.rb +77 -0
  29. data/spec/api/split_document_api_spec.rb +14 -0
  30. data/spec/models/add_pdf_annotation_request_spec.rb +48 -0
  31. data/spec/models/get_pdf_annotations_result_spec.rb +48 -0
  32. data/spec/models/pdf_annotation_spec.rb +108 -0
  33. data/spec/models/presentation_result_spec.rb +54 -0
  34. data/spec/models/remove_pptx_slides_request_spec.rb +60 -0
  35. data/spec/models/split_pptx_presentation_result_spec.rb +48 -0
  36. data/spec/models/worksheet_result_spec.rb +6 -0
  37. metadata +20 -2
@@ -0,0 +1,235 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Input to a Remove PowerPoint PPTX Presentation Slides request
17
+ class RemovePptxSlidesRequest
18
+ # Optional: Bytes of the input file to operate on
19
+ attr_accessor :input_file_bytes
20
+
21
+ # Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
22
+ attr_accessor :input_file_url
23
+
24
+ # Slide number (1-based) to start deleting slides; inclusive
25
+ attr_accessor :start_delete_slide_number
26
+
27
+ # Slide number (1-based) to stop deleting slides; inclusive
28
+ attr_accessor :end_delete_slide_number
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'input_file_bytes' => :'InputFileBytes',
35
+ :'input_file_url' => :'InputFileUrl',
36
+ :'start_delete_slide_number' => :'StartDeleteSlideNumber',
37
+ :'end_delete_slide_number' => :'EndDeleteSlideNumber'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'input_file_bytes' => :'String',
45
+ :'input_file_url' => :'String',
46
+ :'start_delete_slide_number' => :'Integer',
47
+ :'end_delete_slide_number' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'InputFileBytes')
60
+ self.input_file_bytes = attributes[:'InputFileBytes']
61
+ end
62
+
63
+ if attributes.has_key?(:'InputFileUrl')
64
+ self.input_file_url = attributes[:'InputFileUrl']
65
+ end
66
+
67
+ if attributes.has_key?(:'StartDeleteSlideNumber')
68
+ self.start_delete_slide_number = attributes[:'StartDeleteSlideNumber']
69
+ end
70
+
71
+ if attributes.has_key?(:'EndDeleteSlideNumber')
72
+ self.end_delete_slide_number = attributes[:'EndDeleteSlideNumber']
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
82
+ invalid_properties.push("invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
83
+ end
84
+
85
+ return invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
+ return true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] input_file_bytes Value to be assigned
97
+ def input_file_bytes=(input_file_bytes)
98
+
99
+ if !input_file_bytes.nil? && input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
100
+ fail ArgumentError, "invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
101
+ end
102
+
103
+ @input_file_bytes = input_file_bytes
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ input_file_bytes == o.input_file_bytes &&
112
+ input_file_url == o.input_file_url &&
113
+ start_delete_slide_number == o.start_delete_slide_number &&
114
+ end_delete_slide_number == o.end_delete_slide_number
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Fixnum] Hash code
125
+ def hash
126
+ [input_file_bytes, input_file_url, start_delete_slide_number, end_delete_slide_number].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :BOOLEAN
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
187
+ temp_model.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map{ |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end
@@ -13,10 +13,12 @@ Swagger Codegen version: 2.3.1
13
13
  require 'date'
14
14
 
15
15
  module CloudmersiveConvertApiClient
16
-
16
+ # Request to set PDF metadata
17
17
  class SetPdfMetadataRequest
18
+ # Input file contents bytes for the file to modify
18
19
  attr_accessor :input_file_bytes
19
20
 
21
+ # PDF metadata to set on the file
20
22
  attr_accessor :metadata_to_set
21
23
 
22
24
 
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # The result of splitting a presentation into individual PowerPoint PPTX slides
17
+ class SplitPptxPresentationResult
18
+ attr_accessor :result_presentations
19
+
20
+ # True if the operation was successful, false otherwise
21
+ attr_accessor :successful
22
+
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'result_presentations' => :'ResultPresentations',
28
+ :'successful' => :'Successful'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'result_presentations' => :'Array<PresentationResult>',
36
+ :'successful' => :'BOOLEAN'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
47
+
48
+ if attributes.has_key?(:'ResultPresentations')
49
+ if (value = attributes[:'ResultPresentations']).is_a?(Array)
50
+ self.result_presentations = value
51
+ end
52
+ end
53
+
54
+ if attributes.has_key?(:'Successful')
55
+ self.successful = attributes[:'Successful']
56
+ end
57
+
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ return invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ result_presentations == o.result_presentations &&
79
+ successful == o.successful
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [result_presentations, successful].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ if type =~ /\AArray<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
103
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
104
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
105
+ end
106
+ elsif !attributes[self.class.attribute_map[key]].nil?
107
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
108
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
109
+ end
110
+
111
+ self
112
+ end
113
+
114
+ # Deserializes the data based on type
115
+ # @param string type Data type
116
+ # @param string value Value to be deserialized
117
+ # @return [Object] Deserialized data
118
+ def _deserialize(type, value)
119
+ case type.to_sym
120
+ when :DateTime
121
+ DateTime.parse(value)
122
+ when :Date
123
+ Date.parse(value)
124
+ when :String
125
+ value.to_s
126
+ when :Integer
127
+ value.to_i
128
+ when :Float
129
+ value.to_f
130
+ when :BOOLEAN
131
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
132
+ true
133
+ else
134
+ false
135
+ end
136
+ when :Object
137
+ # generic object (usually a Hash), return directly
138
+ value
139
+ when /\AArray<(?<inner_type>.+)>\z/
140
+ inner_type = Regexp.last_match[:inner_type]
141
+ value.map { |v| _deserialize(inner_type, v) }
142
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
143
+ k_type = Regexp.last_match[:k_type]
144
+ v_type = Regexp.last_match[:v_type]
145
+ {}.tap do |hash|
146
+ value.each do |k, v|
147
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
+ end
149
+ end
150
+ else # model
151
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
152
+ temp_model.build_from_hash(value)
153
+ end
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_body
165
+ to_hash
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map{ |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+
198
+ end
199
+
200
+ end