aspose_pdf_cloud 18.7.0 → 18.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/aspose_pdf_cloud.gemspec +53 -49
  3. data/lib/aspose_pdf_cloud.rb +150 -145
  4. data/lib/aspose_pdf_cloud/api/pdf_api.rb +12907 -11705
  5. data/lib/aspose_pdf_cloud/api_client.rb +2 -2
  6. data/lib/aspose_pdf_cloud/api_error.rb +47 -47
  7. data/lib/aspose_pdf_cloud/configuration.rb +175 -185
  8. data/lib/aspose_pdf_cloud/models/annotation.rb +332 -260
  9. data/lib/aspose_pdf_cloud/models/annotation_flags.rb +52 -0
  10. data/lib/aspose_pdf_cloud/models/annotation_info.rb +342 -0
  11. data/lib/aspose_pdf_cloud/models/annotation_state.rb +49 -0
  12. data/lib/aspose_pdf_cloud/models/annotation_type.rb +69 -0
  13. data/lib/aspose_pdf_cloud/models/{annotations.rb → annotations_info.rb} +211 -211
  14. data/lib/aspose_pdf_cloud/models/{annotations_response.rb → annotations_info_response.rb} +222 -222
  15. data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +43 -43
  16. data/lib/aspose_pdf_cloud/models/append_document.rb +233 -228
  17. data/lib/aspose_pdf_cloud/models/{saa_spose_response.rb → aspose_response.rb} +213 -213
  18. data/lib/aspose_pdf_cloud/models/attachment.rb +270 -270
  19. data/lib/aspose_pdf_cloud/models/attachment_response.rb +222 -222
  20. data/lib/aspose_pdf_cloud/models/attachments.rb +211 -211
  21. data/lib/aspose_pdf_cloud/models/attachments_response.rb +222 -222
  22. data/lib/aspose_pdf_cloud/models/color.rb +244 -244
  23. data/lib/aspose_pdf_cloud/models/color_depth.rb +45 -45
  24. data/lib/aspose_pdf_cloud/models/compression_type.rb +46 -46
  25. data/lib/aspose_pdf_cloud/models/doc_format.rb +43 -43
  26. data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +43 -43
  27. data/lib/aspose_pdf_cloud/models/document.rb +220 -220
  28. data/lib/aspose_pdf_cloud/models/{text_item_response.rb → document_page_response.rb} +222 -222
  29. data/lib/aspose_pdf_cloud/models/document_pages_response.rb +222 -222
  30. data/lib/aspose_pdf_cloud/models/document_privilege.rb +298 -298
  31. data/lib/aspose_pdf_cloud/models/document_properties.rb +211 -211
  32. data/lib/aspose_pdf_cloud/models/document_properties_response.rb +222 -222
  33. data/lib/aspose_pdf_cloud/models/document_property.rb +227 -227
  34. data/lib/aspose_pdf_cloud/models/document_property_response.rb +222 -222
  35. data/lib/aspose_pdf_cloud/models/document_response.rb +233 -233
  36. data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +44 -44
  37. data/lib/aspose_pdf_cloud/models/field.rb +254 -254
  38. data/lib/aspose_pdf_cloud/models/field_response.rb +222 -222
  39. data/lib/aspose_pdf_cloud/models/field_type.rb +45 -44
  40. data/lib/aspose_pdf_cloud/models/fields.rb +211 -211
  41. data/lib/aspose_pdf_cloud/models/fields_response.rb +222 -222
  42. data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +43 -43
  43. data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +45 -45
  44. data/lib/aspose_pdf_cloud/models/font_styles.rb +45 -43
  45. data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +382 -0
  46. data/lib/aspose_pdf_cloud/models/{annotation_response.rb → free_text_annotation_response.rb} +222 -222
  47. data/lib/aspose_pdf_cloud/models/{text_items.rb → free_text_annotations.rb} +211 -211
  48. data/lib/aspose_pdf_cloud/models/{text_items_response.rb → free_text_annotations_response.rb} +222 -222
  49. data/lib/aspose_pdf_cloud/models/free_text_intent.rb +44 -0
  50. data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +45 -44
  51. data/lib/aspose_pdf_cloud/models/html_document_type.rb +43 -43
  52. data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +43 -43
  53. data/lib/aspose_pdf_cloud/models/image.rb +250 -220
  54. data/lib/aspose_pdf_cloud/models/image_response.rb +222 -222
  55. data/lib/aspose_pdf_cloud/models/image_src_type.rb +43 -43
  56. data/lib/aspose_pdf_cloud/models/image_template.rb +281 -281
  57. data/lib/aspose_pdf_cloud/models/image_templates_request.rb +230 -230
  58. data/lib/aspose_pdf_cloud/models/images.rb +211 -211
  59. data/lib/aspose_pdf_cloud/models/images_response.rb +222 -222
  60. data/lib/aspose_pdf_cloud/models/justification.rb +44 -0
  61. data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +43 -43
  62. data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -43
  63. data/lib/aspose_pdf_cloud/models/link.rb +228 -228
  64. data/lib/aspose_pdf_cloud/models/link_action_type.rb +47 -46
  65. data/lib/aspose_pdf_cloud/models/link_annotation.rb +254 -236
  66. data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +222 -222
  67. data/lib/aspose_pdf_cloud/models/link_annotations.rb +211 -211
  68. data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +222 -222
  69. data/lib/aspose_pdf_cloud/models/link_element.rb +200 -200
  70. data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +46 -45
  71. data/lib/aspose_pdf_cloud/models/margin_info.rb +244 -244
  72. data/lib/aspose_pdf_cloud/models/markup_annotation.rb +342 -0
  73. data/lib/aspose_pdf_cloud/models/merge_documents.rb +205 -200
  74. data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -293
  75. data/lib/aspose_pdf_cloud/models/page.rb +228 -228
  76. data/lib/aspose_pdf_cloud/models/page_word_count.rb +218 -218
  77. data/lib/aspose_pdf_cloud/models/pages.rb +211 -211
  78. data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -303
  79. data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +44 -44
  80. data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +43 -43
  81. data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +44 -44
  82. data/lib/aspose_pdf_cloud/models/{document_text_replace_response.rb → rectangle_pdf.rb} +244 -231
  83. data/lib/aspose_pdf_cloud/models/rotation.rb +45 -44
  84. data/lib/aspose_pdf_cloud/models/segment.rb +211 -206
  85. data/lib/aspose_pdf_cloud/models/shape_type.rb +44 -44
  86. data/lib/aspose_pdf_cloud/models/signature.rb +338 -333
  87. data/lib/aspose_pdf_cloud/models/signature_type.rb +44 -42
  88. data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +223 -223
  89. data/lib/aspose_pdf_cloud/models/split_result.rb +200 -200
  90. data/lib/aspose_pdf_cloud/models/split_result_document.rb +238 -238
  91. data/lib/aspose_pdf_cloud/models/split_result_response.rb +223 -223
  92. data/lib/aspose_pdf_cloud/models/stamp.rb +413 -413
  93. data/lib/aspose_pdf_cloud/models/stamp_type.rb +45 -44
  94. data/lib/aspose_pdf_cloud/models/{tiff_export_options.rb → text_annotation.rb} +382 -348
  95. data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +222 -0
  96. data/lib/aspose_pdf_cloud/models/{text_item.rb → text_annotations.rb} +211 -218
  97. data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +222 -0
  98. data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -47
  99. data/lib/aspose_pdf_cloud/models/text_icon.rb +52 -0
  100. data/lib/aspose_pdf_cloud/models/text_line.rb +215 -210
  101. data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -220
  102. data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -199
  103. data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -222
  104. data/lib/aspose_pdf_cloud/models/text_replace.rb +253 -253
  105. data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +232 -232
  106. data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -222
  107. data/lib/aspose_pdf_cloud/models/text_state.rb +248 -248
  108. data/lib/aspose_pdf_cloud/models/{text_format.rb → text_style.rb} +233 -227
  109. data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -45
  110. data/lib/aspose_pdf_cloud/models/word_count.rb +199 -199
  111. data/lib/aspose_pdf_cloud/models/word_count_response.rb +223 -223
  112. data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -44
  113. data/lib/aspose_pdf_cloud/version.rb +24 -24
  114. data/test/pdf_tests.rb +1496 -1325
  115. data/test_data/TexExample.tex +304 -304
  116. metadata +24 -21
  117. data/.gitignore +0 -46
  118. data/.swagger-codegen-ignore +0 -58
  119. data/lib/aspose_pdf_cloud/models/http_status_code.rb +0 -87
  120. data/lib/aspose_pdf_cloud/models/images_list_request.rb +0 -205
  121. data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +0 -231
  122. data/lib/aspose_pdf_cloud/models/rectangle.rb +0 -244
  123. data/lib/aspose_pdf_cloud/models/text_format_response.rb +0 -222
  124. data/lib/aspose_pdf_cloud/models/text_replace_request.rb +0 -262
@@ -1,213 +1,213 @@
1
- =begin
2
- --------------------------------------------------------------------------------------------------------------------
3
- Copyright (c) 2018 Aspose.PDF Cloud
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
- SOFTWARE.
19
- --------------------------------------------------------------------------------------------------------------------
20
- =end
21
-
22
- require 'date'
23
-
24
- module AsposePdfCloud
25
- # Base class for all responses.
26
- class SaaSposeResponse
27
- # Response status code.
28
- attr_accessor :code
29
-
30
- # Response status.
31
- attr_accessor :status
32
-
33
-
34
- # Attribute mapping from ruby-style variable name to JSON key.
35
- def self.attribute_map
36
- {
37
- :'code' => :'Code',
38
- :'status' => :'Status'
39
- }
40
- end
41
-
42
- # Attribute type mapping.
43
- def self.swagger_types
44
- {
45
- :'code' => :'HttpStatusCode',
46
- :'status' => :'String'
47
- }
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
- def initialize(attributes = {})
53
- return unless attributes.is_a?(Hash)
54
-
55
- # convert string to symbol for hash key
56
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
-
58
- if attributes.has_key?(:'Code')
59
- self.code = attributes[:'Code']
60
- end
61
-
62
- if attributes.has_key?(:'Status')
63
- self.status = attributes[:'Status']
64
- end
65
-
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properies with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- if @code.nil?
73
- invalid_properties.push("invalid value for 'code', code cannot be nil.")
74
- end
75
-
76
- return invalid_properties
77
- end
78
-
79
- # Check to see if the all the properties in the model are valid
80
- # @return true if the model is valid
81
- def valid?
82
- return false if @code.nil?
83
- return true
84
- end
85
-
86
- # Checks equality by comparing each attribute.
87
- # @param [Object] Object to be compared
88
- def ==(o)
89
- return true if self.equal?(o)
90
- self.class == o.class &&
91
- code == o.code &&
92
- status == o.status
93
- end
94
-
95
- # @see the `==` method
96
- # @param [Object] Object to be compared
97
- def eql?(o)
98
- self == o
99
- end
100
-
101
- # Calculates hash code according to all attributes.
102
- # @return [Fixnum] Hash code
103
- def hash
104
- [code, status].hash
105
- end
106
-
107
- # Builds the object from hash
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- # @return [Object] Returns the model itself
110
- def build_from_hash(attributes)
111
- return nil unless attributes.is_a?(Hash)
112
- self.class.swagger_types.each_pair do |key, type|
113
- if type =~ /\AArray<(.*)>/i
114
- # check to ensure the input is an array given that the the attribute
115
- # is documented as an array but the input is not
116
- if attributes[self.class.attribute_map[key]].is_a?(Array)
117
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
118
- end
119
- elsif !attributes[self.class.attribute_map[key]].nil?
120
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
- end # or else data not found in attributes(hash), not an issue as the data can be optional
122
- end
123
-
124
- self
125
- end
126
-
127
- # Deserializes the data based on type
128
- # @param string type Data type
129
- # @param string value Value to be deserialized
130
- # @return [Object] Deserialized data
131
- def _deserialize(type, value)
132
- case type.to_sym
133
- when :DateTime
134
- DateTime.parse(value)
135
- when :Date
136
- Date.parse(value)
137
- when :String
138
- value.to_s
139
- when :Integer
140
- value.to_i
141
- when :Float
142
- value.to_f
143
- when :BOOLEAN
144
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
- true
146
- else
147
- false
148
- end
149
- when :Object
150
- # generic object (usually a Hash), return directly
151
- value
152
- when /\AArray<(?<inner_type>.+)>\z/
153
- inner_type = Regexp.last_match[:inner_type]
154
- value.map { |v| _deserialize(inner_type, v) }
155
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
- k_type = Regexp.last_match[:k_type]
157
- v_type = Regexp.last_match[:v_type]
158
- {}.tap do |hash|
159
- value.each do |k, v|
160
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
- end
162
- end
163
- else # model
164
- temp_model = AsposePdfCloud.const_get(type).new
165
- temp_model.build_from_hash(value)
166
- end
167
- end
168
-
169
- # Returns the string representation of the object
170
- # @return [String] String presentation of the object
171
- def to_s
172
- to_hash.to_s
173
- end
174
-
175
- # to_body is an alias to to_hash (backward compatibility)
176
- # @return [Hash] Returns the object in the form of hash
177
- def to_body
178
- to_hash
179
- end
180
-
181
- # Returns the object in the form of hash
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_hash
184
- hash = {}
185
- self.class.attribute_map.each_pair do |attr, param|
186
- value = self.send(attr)
187
- next if value.nil?
188
- hash[param] = _to_hash(value)
189
- end
190
- hash
191
- end
192
-
193
- # Outputs non-array value in the form of hash
194
- # For object, use to_hash. Otherwise, just return the value
195
- # @param [Object] value Any valid value
196
- # @return [Hash] Returns the value in the form of hash
197
- def _to_hash(value)
198
- if value.is_a?(Array)
199
- value.compact.map{ |v| _to_hash(v) }
200
- elsif value.is_a?(Hash)
201
- {}.tap do |hash|
202
- value.each { |k, v| hash[k] = _to_hash(v) }
203
- end
204
- elsif value.respond_to? :to_hash
205
- value.to_hash
206
- else
207
- value
208
- end
209
- end
210
-
211
- end
212
-
213
- end
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.PDF Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module AsposePdfCloud
25
+ # Base class for all responses.
26
+ class AsposeResponse
27
+ # Response status code.
28
+ attr_accessor :code
29
+
30
+ # Response status.
31
+ attr_accessor :status
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'code' => :'Code',
38
+ :'status' => :'Status'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'code' => :'Integer',
46
+ :'status' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+ if attributes.has_key?(:'Code')
59
+ self.code = attributes[:'Code']
60
+ end
61
+
62
+ if attributes.has_key?(:'Status')
63
+ self.status = attributes[:'Status']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properies with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if @code.nil?
73
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
74
+ end
75
+
76
+ return invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if @code.nil?
83
+ return true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ code == o.code &&
92
+ status == o.status
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [code, status].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.swagger_types.each_pair do |key, type|
113
+ if type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :BOOLEAN
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ temp_model = AsposePdfCloud.const_get(type).new
165
+ temp_model.build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ next if value.nil?
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map{ |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end
210
+
211
+ end
212
+
213
+ end
@@ -1,270 +1,270 @@
1
- =begin
2
- --------------------------------------------------------------------------------------------------------------------
3
- Copyright (c) 2018 Aspose.PDF Cloud
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
- SOFTWARE.
19
- --------------------------------------------------------------------------------------------------------------------
20
- =end
21
-
22
- require 'date'
23
-
24
- module AsposePdfCloud
25
- # Provides link to attachment.
26
- class Attachment
27
- # Link to the document.
28
- attr_accessor :links
29
-
30
- # Gets text associated with the attachment.
31
- attr_accessor :description
32
-
33
- # Gets subtype of the attachment file.
34
- attr_accessor :mime_type
35
-
36
- # Gets the name of the attachment.
37
- attr_accessor :name
38
-
39
- # The date and time when the embedded file was created.
40
- attr_accessor :creation_date
41
-
42
- # The date and time when the embedded file was last modified.
43
- attr_accessor :modification_date
44
-
45
- # The size of the uncompressed embedded file, in bytes.
46
- attr_accessor :size
47
-
48
- # A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.
49
- attr_accessor :check_sum
50
-
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'links' => :'Links',
56
- :'description' => :'Description',
57
- :'mime_type' => :'MimeType',
58
- :'name' => :'Name',
59
- :'creation_date' => :'CreationDate',
60
- :'modification_date' => :'ModificationDate',
61
- :'size' => :'Size',
62
- :'check_sum' => :'CheckSum'
63
- }
64
- end
65
-
66
- # Attribute type mapping.
67
- def self.swagger_types
68
- {
69
- :'links' => :'Array<Link>',
70
- :'description' => :'String',
71
- :'mime_type' => :'String',
72
- :'name' => :'String',
73
- :'creation_date' => :'String',
74
- :'modification_date' => :'String',
75
- :'size' => :'Integer',
76
- :'check_sum' => :'String'
77
- }
78
- end
79
-
80
- # Initializes the object
81
- # @param [Hash] attributes Model attributes in the form of hash
82
- def initialize(attributes = {})
83
- return unless attributes.is_a?(Hash)
84
-
85
- # convert string to symbol for hash key
86
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
87
-
88
- if attributes.has_key?(:'Links')
89
- if (value = attributes[:'Links']).is_a?(Array)
90
- self.links = value
91
- end
92
- end
93
-
94
- if attributes.has_key?(:'Description')
95
- self.description = attributes[:'Description']
96
- end
97
-
98
- if attributes.has_key?(:'MimeType')
99
- self.mime_type = attributes[:'MimeType']
100
- end
101
-
102
- if attributes.has_key?(:'Name')
103
- self.name = attributes[:'Name']
104
- end
105
-
106
- if attributes.has_key?(:'CreationDate')
107
- self.creation_date = attributes[:'CreationDate']
108
- end
109
-
110
- if attributes.has_key?(:'ModificationDate')
111
- self.modification_date = attributes[:'ModificationDate']
112
- end
113
-
114
- if attributes.has_key?(:'Size')
115
- self.size = attributes[:'Size']
116
- end
117
-
118
- if attributes.has_key?(:'CheckSum')
119
- self.check_sum = attributes[:'CheckSum']
120
- end
121
-
122
- end
123
-
124
- # Show invalid properties with the reasons. Usually used together with valid?
125
- # @return Array for valid properies with the reasons
126
- def list_invalid_properties
127
- invalid_properties = Array.new
128
- return invalid_properties
129
- end
130
-
131
- # Check to see if the all the properties in the model are valid
132
- # @return true if the model is valid
133
- def valid?
134
- return true
135
- end
136
-
137
- # Checks equality by comparing each attribute.
138
- # @param [Object] Object to be compared
139
- def ==(o)
140
- return true if self.equal?(o)
141
- self.class == o.class &&
142
- links == o.links &&
143
- description == o.description &&
144
- mime_type == o.mime_type &&
145
- name == o.name &&
146
- creation_date == o.creation_date &&
147
- modification_date == o.modification_date &&
148
- size == o.size &&
149
- check_sum == o.check_sum
150
- end
151
-
152
- # @see the `==` method
153
- # @param [Object] Object to be compared
154
- def eql?(o)
155
- self == o
156
- end
157
-
158
- # Calculates hash code according to all attributes.
159
- # @return [Fixnum] Hash code
160
- def hash
161
- [links, description, mime_type, name, creation_date, modification_date, size, check_sum].hash
162
- end
163
-
164
- # Builds the object from hash
165
- # @param [Hash] attributes Model attributes in the form of hash
166
- # @return [Object] Returns the model itself
167
- def build_from_hash(attributes)
168
- return nil unless attributes.is_a?(Hash)
169
- self.class.swagger_types.each_pair do |key, type|
170
- if type =~ /\AArray<(.*)>/i
171
- # check to ensure the input is an array given that the the attribute
172
- # is documented as an array but the input is not
173
- if attributes[self.class.attribute_map[key]].is_a?(Array)
174
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
175
- end
176
- elsif !attributes[self.class.attribute_map[key]].nil?
177
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
- end # or else data not found in attributes(hash), not an issue as the data can be optional
179
- end
180
-
181
- self
182
- end
183
-
184
- # Deserializes the data based on type
185
- # @param string type Data type
186
- # @param string value Value to be deserialized
187
- # @return [Object] Deserialized data
188
- def _deserialize(type, value)
189
- case type.to_sym
190
- when :DateTime
191
- DateTime.parse(value)
192
- when :Date
193
- Date.parse(value)
194
- when :String
195
- value.to_s
196
- when :Integer
197
- value.to_i
198
- when :Float
199
- value.to_f
200
- when :BOOLEAN
201
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
- true
203
- else
204
- false
205
- end
206
- when :Object
207
- # generic object (usually a Hash), return directly
208
- value
209
- when /\AArray<(?<inner_type>.+)>\z/
210
- inner_type = Regexp.last_match[:inner_type]
211
- value.map { |v| _deserialize(inner_type, v) }
212
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
- k_type = Regexp.last_match[:k_type]
214
- v_type = Regexp.last_match[:v_type]
215
- {}.tap do |hash|
216
- value.each do |k, v|
217
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
- end
219
- end
220
- else # model
221
- temp_model = AsposePdfCloud.const_get(type).new
222
- temp_model.build_from_hash(value)
223
- end
224
- end
225
-
226
- # Returns the string representation of the object
227
- # @return [String] String presentation of the object
228
- def to_s
229
- to_hash.to_s
230
- end
231
-
232
- # to_body is an alias to to_hash (backward compatibility)
233
- # @return [Hash] Returns the object in the form of hash
234
- def to_body
235
- to_hash
236
- end
237
-
238
- # Returns the object in the form of hash
239
- # @return [Hash] Returns the object in the form of hash
240
- def to_hash
241
- hash = {}
242
- self.class.attribute_map.each_pair do |attr, param|
243
- value = self.send(attr)
244
- next if value.nil?
245
- hash[param] = _to_hash(value)
246
- end
247
- hash
248
- end
249
-
250
- # Outputs non-array value in the form of hash
251
- # For object, use to_hash. Otherwise, just return the value
252
- # @param [Object] value Any valid value
253
- # @return [Hash] Returns the value in the form of hash
254
- def _to_hash(value)
255
- if value.is_a?(Array)
256
- value.compact.map{ |v| _to_hash(v) }
257
- elsif value.is_a?(Hash)
258
- {}.tap do |hash|
259
- value.each { |k, v| hash[k] = _to_hash(v) }
260
- end
261
- elsif value.respond_to? :to_hash
262
- value.to_hash
263
- else
264
- value
265
- end
266
- end
267
-
268
- end
269
-
270
- end
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.PDF Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module AsposePdfCloud
25
+ # Provides link to attachment.
26
+ class Attachment
27
+ # Link to the document.
28
+ attr_accessor :links
29
+
30
+ # Gets text associated with the attachment.
31
+ attr_accessor :description
32
+
33
+ # Gets subtype of the attachment file.
34
+ attr_accessor :mime_type
35
+
36
+ # Gets the name of the attachment.
37
+ attr_accessor :name
38
+
39
+ # The date and time when the embedded file was created.
40
+ attr_accessor :creation_date
41
+
42
+ # The date and time when the embedded file was last modified.
43
+ attr_accessor :modification_date
44
+
45
+ # The size of the uncompressed embedded file, in bytes.
46
+ attr_accessor :size
47
+
48
+ # A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.
49
+ attr_accessor :check_sum
50
+
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'links' => :'Links',
56
+ :'description' => :'Description',
57
+ :'mime_type' => :'MimeType',
58
+ :'name' => :'Name',
59
+ :'creation_date' => :'CreationDate',
60
+ :'modification_date' => :'ModificationDate',
61
+ :'size' => :'Size',
62
+ :'check_sum' => :'CheckSum'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'links' => :'Array<Link>',
70
+ :'description' => :'String',
71
+ :'mime_type' => :'String',
72
+ :'name' => :'String',
73
+ :'creation_date' => :'String',
74
+ :'modification_date' => :'String',
75
+ :'size' => :'Integer',
76
+ :'check_sum' => :'String'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
87
+
88
+ if attributes.has_key?(:'Links')
89
+ if (value = attributes[:'Links']).is_a?(Array)
90
+ self.links = value
91
+ end
92
+ end
93
+
94
+ if attributes.has_key?(:'Description')
95
+ self.description = attributes[:'Description']
96
+ end
97
+
98
+ if attributes.has_key?(:'MimeType')
99
+ self.mime_type = attributes[:'MimeType']
100
+ end
101
+
102
+ if attributes.has_key?(:'Name')
103
+ self.name = attributes[:'Name']
104
+ end
105
+
106
+ if attributes.has_key?(:'CreationDate')
107
+ self.creation_date = attributes[:'CreationDate']
108
+ end
109
+
110
+ if attributes.has_key?(:'ModificationDate')
111
+ self.modification_date = attributes[:'ModificationDate']
112
+ end
113
+
114
+ if attributes.has_key?(:'Size')
115
+ self.size = attributes[:'Size']
116
+ end
117
+
118
+ if attributes.has_key?(:'CheckSum')
119
+ self.check_sum = attributes[:'CheckSum']
120
+ end
121
+
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properies with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ return invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ links == o.links &&
143
+ description == o.description &&
144
+ mime_type == o.mime_type &&
145
+ name == o.name &&
146
+ creation_date == o.creation_date &&
147
+ modification_date == o.modification_date &&
148
+ size == o.size &&
149
+ check_sum == o.check_sum
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Fixnum] Hash code
160
+ def hash
161
+ [links, description, mime_type, name, creation_date, modification_date, size, check_sum].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.swagger_types.each_pair do |key, type|
170
+ if type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
175
+ end
176
+ elsif !attributes[self.class.attribute_map[key]].nil?
177
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+
181
+ self
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def _deserialize(type, value)
189
+ case type.to_sym
190
+ when :DateTime
191
+ DateTime.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :BOOLEAN
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ temp_model = AsposePdfCloud.const_get(type).new
222
+ temp_model.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ next if value.nil?
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map{ |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+ end