aspose_pdf_cloud 18.9.0 → 18.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +362 -3
  3. data/docs/Annotation.md +22 -0
  4. data/docs/AnnotationFlags.md +20 -0
  5. data/docs/AnnotationInfo.md +23 -0
  6. data/docs/AnnotationState.md +17 -0
  7. data/docs/AnnotationType.md +37 -0
  8. data/docs/AnnotationsInfo.md +10 -0
  9. data/docs/AnnotationsInfoResponse.md +11 -0
  10. data/docs/AntialiasingProcessingType.md +11 -0
  11. data/docs/AppendDocument.md +11 -0
  12. data/docs/AsposeResponse.md +10 -0
  13. data/docs/Attachment.md +16 -0
  14. data/docs/AttachmentResponse.md +11 -0
  15. data/docs/Attachments.md +10 -0
  16. data/docs/AttachmentsResponse.md +11 -0
  17. data/docs/CaptionPosition.md +11 -0
  18. data/docs/CircleAnnotation.md +26 -0
  19. data/docs/CircleAnnotationResponse.md +11 -0
  20. data/docs/CircleAnnotations.md +10 -0
  21. data/docs/CircleAnnotationsResponse.md +11 -0
  22. data/docs/Color.md +12 -0
  23. data/docs/ColorDepth.md +13 -0
  24. data/docs/CommonFigureAnnotation.md +25 -0
  25. data/docs/CompressionType.md +14 -0
  26. data/docs/DocFormat.md +11 -0
  27. data/docs/DocRecognitionMode.md +11 -0
  28. data/docs/Document.md +11 -0
  29. data/docs/DocumentPageResponse.md +11 -0
  30. data/docs/DocumentPagesResponse.md +11 -0
  31. data/docs/DocumentPrivilege.md +19 -0
  32. data/docs/DocumentProperties.md +10 -0
  33. data/docs/DocumentPropertiesResponse.md +11 -0
  34. data/docs/DocumentProperty.md +12 -0
  35. data/docs/DocumentPropertyResponse.md +11 -0
  36. data/docs/DocumentResponse.md +12 -0
  37. data/docs/EpubRecognitionMode.md +17 -0
  38. data/docs/Field.md +14 -0
  39. data/docs/FieldResponse.md +11 -0
  40. data/docs/FieldType.md +13 -0
  41. data/docs/Fields.md +10 -0
  42. data/docs/FieldsResponse.md +11 -0
  43. data/docs/FontEncodingRules.md +11 -0
  44. data/docs/FontSavingModes.md +15 -0
  45. data/docs/FontStyles.md +13 -0
  46. data/docs/FreeTextAnnotation.md +27 -0
  47. data/docs/FreeTextAnnotationResponse.md +11 -0
  48. data/docs/FreeTextAnnotations.md +10 -0
  49. data/docs/FreeTextAnnotationsResponse.md +11 -0
  50. data/docs/FreeTextIntent.md +12 -0
  51. data/docs/HorizontalAlignment.md +13 -0
  52. data/docs/HtmlDocumentType.md +11 -0
  53. data/docs/HtmlMarkupGenerationModes.md +14 -0
  54. data/docs/Image.md +14 -0
  55. data/docs/ImageResponse.md +11 -0
  56. data/docs/ImageSrcType.md +11 -0
  57. data/docs/ImageTemplate.md +17 -0
  58. data/docs/ImageTemplatesRequest.md +11 -0
  59. data/docs/Images.md +10 -0
  60. data/docs/ImagesResponse.md +11 -0
  61. data/docs/Justification.md +12 -0
  62. data/docs/LettersPositioningMethods.md +12 -0
  63. data/docs/LineAnnotation.md +36 -0
  64. data/docs/LineAnnotationResponse.md +11 -0
  65. data/docs/LineAnnotations.md +10 -0
  66. data/docs/LineAnnotationsResponse.md +11 -0
  67. data/docs/LineEnding.md +19 -0
  68. data/docs/LineIntent.md +12 -0
  69. data/docs/LineSpacing.md +11 -0
  70. data/docs/Link.md +13 -0
  71. data/docs/LinkActionType.md +15 -0
  72. data/docs/LinkAnnotation.md +15 -0
  73. data/docs/LinkAnnotationResponse.md +11 -0
  74. data/docs/LinkAnnotations.md +10 -0
  75. data/docs/LinkAnnotationsResponse.md +11 -0
  76. data/docs/LinkElement.md +9 -0
  77. data/docs/LinkHighlightingMode.md +14 -0
  78. data/docs/MarginInfo.md +12 -0
  79. data/docs/MarkupAnnotation.md +23 -0
  80. data/docs/MergeDocuments.md +9 -0
  81. data/docs/OptimizeOptions.md +15 -0
  82. data/docs/Page.md +12 -0
  83. data/docs/PageWordCount.md +10 -0
  84. data/docs/Pages.md +10 -0
  85. data/docs/Paragraph.md +20 -0
  86. data/docs/PartsEmbeddingModes.md +15 -0
  87. data/docs/PdfAType.md +11 -0
  88. data/docs/PdfApi.md +4961 -0
  89. data/docs/Point.md +10 -0
  90. data/docs/PolyAnnotation.md +28 -0
  91. data/docs/PolyIntent.md +13 -0
  92. data/docs/PolyLineAnnotation.md +29 -0
  93. data/docs/PolyLineAnnotationResponse.md +11 -0
  94. data/docs/PolyLineAnnotations.md +10 -0
  95. data/docs/PolyLineAnnotationsResponse.md +11 -0
  96. data/docs/PolygonAnnotation.md +29 -0
  97. data/docs/PolygonAnnotationResponse.md +11 -0
  98. data/docs/PolygonAnnotations.md +10 -0
  99. data/docs/PolygonAnnotationsResponse.md +11 -0
  100. data/docs/RasterImagesSavingModes.md +15 -0
  101. data/docs/RectanglePdf.md +12 -0
  102. data/docs/Rotation.md +13 -0
  103. data/docs/Segment.md +10 -0
  104. data/docs/ShapeType.md +12 -0
  105. data/docs/Signature.md +21 -0
  106. data/docs/SignatureType.md +12 -0
  107. data/docs/SignatureVerifyResponse.md +11 -0
  108. data/docs/SplitResult.md +9 -0
  109. data/docs/SplitResultDocument.md +13 -0
  110. data/docs/SplitResultResponse.md +11 -0
  111. data/docs/SquareAnnotation.md +26 -0
  112. data/docs/SquareAnnotationResponse.md +11 -0
  113. data/docs/SquareAnnotations.md +10 -0
  114. data/docs/SquareAnnotationsResponse.md +11 -0
  115. data/docs/Stamp.md +30 -0
  116. data/docs/StampType.md +13 -0
  117. data/docs/TextAnnotation.md +27 -0
  118. data/docs/TextAnnotationResponse.md +11 -0
  119. data/docs/TextAnnotations.md +10 -0
  120. data/docs/TextAnnotationsResponse.md +11 -0
  121. data/docs/TextHorizontalAlignment.md +15 -0
  122. data/docs/TextIcon.md +20 -0
  123. data/docs/TextLine.md +10 -0
  124. data/docs/TextRect.md +11 -0
  125. data/docs/TextRects.md +9 -0
  126. data/docs/TextRectsResponse.md +11 -0
  127. data/docs/TextReplace.md +13 -0
  128. data/docs/TextReplaceListRequest.md +12 -0
  129. data/docs/TextReplaceResponse.md +11 -0
  130. data/docs/TextState.md +13 -0
  131. data/docs/TextStyle.md +12 -0
  132. data/docs/VerticalAlignment.md +13 -0
  133. data/docs/WordCount.md +9 -0
  134. data/docs/WordCountResponse.md +11 -0
  135. data/docs/WrapMode.md +12 -0
  136. data/lib/aspose_pdf_cloud.rb +27 -0
  137. data/lib/aspose_pdf_cloud/api/pdf_api.rb +3632 -1662
  138. data/lib/aspose_pdf_cloud/models/caption_position.rb +43 -0
  139. data/lib/aspose_pdf_cloud/models/circle_annotation.rb +372 -0
  140. data/lib/aspose_pdf_cloud/models/circle_annotation_response.rb +222 -0
  141. data/lib/aspose_pdf_cloud/models/circle_annotations.rb +211 -0
  142. data/lib/aspose_pdf_cloud/models/circle_annotations_response.rb +222 -0
  143. data/lib/aspose_pdf_cloud/models/common_figure_annotation.rb +362 -0
  144. data/lib/aspose_pdf_cloud/models/line_annotation.rb +472 -0
  145. data/lib/aspose_pdf_cloud/models/line_annotation_response.rb +222 -0
  146. data/lib/aspose_pdf_cloud/models/line_annotations.rb +211 -0
  147. data/lib/aspose_pdf_cloud/models/line_annotations_response.rb +222 -0
  148. data/lib/aspose_pdf_cloud/models/line_ending.rb +51 -0
  149. data/lib/aspose_pdf_cloud/models/line_intent.rb +44 -0
  150. data/lib/aspose_pdf_cloud/models/point.rb +218 -0
  151. data/lib/aspose_pdf_cloud/models/poly_annotation.rb +394 -0
  152. data/lib/aspose_pdf_cloud/models/poly_intent.rb +45 -0
  153. data/lib/aspose_pdf_cloud/models/poly_line_annotation.rb +404 -0
  154. data/lib/aspose_pdf_cloud/models/poly_line_annotation_response.rb +222 -0
  155. data/lib/aspose_pdf_cloud/models/poly_line_annotations.rb +211 -0
  156. data/lib/aspose_pdf_cloud/models/poly_line_annotations_response.rb +222 -0
  157. data/lib/aspose_pdf_cloud/models/polygon_annotation.rb +404 -0
  158. data/lib/aspose_pdf_cloud/models/polygon_annotation_response.rb +222 -0
  159. data/lib/aspose_pdf_cloud/models/polygon_annotations.rb +211 -0
  160. data/lib/aspose_pdf_cloud/models/polygon_annotations_response.rb +222 -0
  161. data/lib/aspose_pdf_cloud/models/square_annotation.rb +372 -0
  162. data/lib/aspose_pdf_cloud/models/square_annotation_response.rb +222 -0
  163. data/lib/aspose_pdf_cloud/models/square_annotations.rb +211 -0
  164. data/lib/aspose_pdf_cloud/models/square_annotations_response.rb +222 -0
  165. data/lib/aspose_pdf_cloud/version.rb +1 -1
  166. data/test/pdf_tests.rb +483 -1
  167. metadata +162 -2
@@ -0,0 +1,51 @@
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
+ class LineEnding
26
+
27
+ NONE = "None".freeze
28
+ SQUARE = "Square".freeze
29
+ CIRCLE = "Circle".freeze
30
+ DIAMOND = "Diamond".freeze
31
+ OPEN_ARROW = "OpenArrow".freeze
32
+ CLOSED_ARROW = "ClosedArrow".freeze
33
+ BUTT = "Butt".freeze
34
+ R_OPEN_ARROW = "ROpenArrow".freeze
35
+ R_CLOSED_ARROW = "RClosedArrow".freeze
36
+ SLASH = "Slash".freeze
37
+
38
+ # Builds the enum from string
39
+ # @param [String] The enum value in the form of the string
40
+ # @return [String] The enum value
41
+ def build_from_hash(value)
42
+ # resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
43
+ # consantValues = LineEnding.constants.select{|c| c.to_s == value}
44
+ constantValues = LineEnding.constants.select{ |const_name| LineEnding.const_get(const_name) == value}
45
+
46
+ raise "Invalid ENUM value #{value} for class #LineEnding" if constantValues.empty?
47
+ value
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,44 @@
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
+ class LineIntent
26
+
27
+ UNDEFINED = "Undefined".freeze
28
+ LINE_ARROW = "LineArrow".freeze
29
+ LINE_DIMENSION = "LineDimension".freeze
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ # resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
36
+ # consantValues = LineIntent.constants.select{|c| c.to_s == value}
37
+ constantValues = LineIntent.constants.select{ |const_name| LineIntent.const_get(const_name) == value}
38
+
39
+ raise "Invalid ENUM value #{value} for class #LineIntent" if constantValues.empty?
40
+ value
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,218 @@
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
+ # Represent point with fractional coordinates.
26
+ class Point
27
+ # X coordinate value.
28
+ attr_accessor :x
29
+
30
+ # Y coordinate value.
31
+ attr_accessor :y
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'x' => :'X',
38
+ :'y' => :'Y'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'x' => :'Float',
46
+ :'y' => :'Float'
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?(:'X')
59
+ self.x = attributes[:'X']
60
+ end
61
+
62
+ if attributes.has_key?(:'Y')
63
+ self.y = attributes[:'Y']
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 @x.nil?
73
+ invalid_properties.push("invalid value for 'x', x cannot be nil.")
74
+ end
75
+
76
+ if @y.nil?
77
+ invalid_properties.push("invalid value for 'y', y cannot be nil.")
78
+ end
79
+
80
+ return invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return false if @x.nil?
87
+ return false if @y.nil?
88
+ return true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ x == o.x &&
97
+ y == o.y
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Fixnum] Hash code
108
+ def hash
109
+ [x, y].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :BOOLEAN
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ temp_model = AsposePdfCloud.const_get(type).new
170
+ temp_model.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ next if value.nil?
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map{ |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -0,0 +1,394 @@
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 PolyAnnotation.
26
+ class PolyAnnotation
27
+ # Link to the document.
28
+ attr_accessor :links
29
+
30
+ # Get the annotation content.
31
+ attr_accessor :contents
32
+
33
+ # The date and time when the annotation was created.
34
+ attr_accessor :creation_date
35
+
36
+ # Get the annotation subject.
37
+ attr_accessor :subject
38
+
39
+ # Get the annotation title.
40
+ attr_accessor :title
41
+
42
+ # The date and time when the annotation was last modified.
43
+ attr_accessor :modified
44
+
45
+ # Gets ID of the annotation.
46
+ attr_accessor :id
47
+
48
+ # Gets Flags of the annotation.
49
+ attr_accessor :flags
50
+
51
+ # Gets Name of the annotation.
52
+ attr_accessor :name
53
+
54
+ # Gets Rect of the annotation.
55
+ attr_accessor :rect
56
+
57
+ # Gets PageIndex of the annotation.
58
+ attr_accessor :page_index
59
+
60
+ # Gets ZIndex of the annotation.
61
+ attr_accessor :z_index
62
+
63
+ # Gets HorizontalAlignment of the annotation.
64
+ attr_accessor :horizontal_alignment
65
+
66
+ # Gets VerticalAlignment of the annotation.
67
+ attr_accessor :vertical_alignment
68
+
69
+ # Get the annotation RichText.
70
+ attr_accessor :rich_text
71
+
72
+ # Gets or sets the interior color with which to fill the annotation?s line endings.
73
+ attr_accessor :interior_color
74
+
75
+ # Gets or sets the style of first line ending.
76
+ attr_accessor :starting_style
77
+
78
+ # Gets or sets the style of second line ending.
79
+ attr_accessor :ending_style
80
+
81
+ # Gets or sets the intent of the polygon or polyline annotation.
82
+ attr_accessor :intent
83
+
84
+ # Gets or sets an array of points representing the horizontal and vertical coordinates of each vertex.
85
+ attr_accessor :vertices
86
+
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'links' => :'Links',
92
+ :'contents' => :'Contents',
93
+ :'creation_date' => :'CreationDate',
94
+ :'subject' => :'Subject',
95
+ :'title' => :'Title',
96
+ :'modified' => :'Modified',
97
+ :'id' => :'Id',
98
+ :'flags' => :'Flags',
99
+ :'name' => :'Name',
100
+ :'rect' => :'Rect',
101
+ :'page_index' => :'PageIndex',
102
+ :'z_index' => :'ZIndex',
103
+ :'horizontal_alignment' => :'HorizontalAlignment',
104
+ :'vertical_alignment' => :'VerticalAlignment',
105
+ :'rich_text' => :'RichText',
106
+ :'interior_color' => :'InteriorColor',
107
+ :'starting_style' => :'StartingStyle',
108
+ :'ending_style' => :'EndingStyle',
109
+ :'intent' => :'Intent',
110
+ :'vertices' => :'Vertices'
111
+ }
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.swagger_types
116
+ {
117
+ :'links' => :'Array<Link>',
118
+ :'contents' => :'String',
119
+ :'creation_date' => :'String',
120
+ :'subject' => :'String',
121
+ :'title' => :'String',
122
+ :'modified' => :'String',
123
+ :'id' => :'String',
124
+ :'flags' => :'Array<AnnotationFlags>',
125
+ :'name' => :'String',
126
+ :'rect' => :'RectanglePdf',
127
+ :'page_index' => :'Integer',
128
+ :'z_index' => :'Integer',
129
+ :'horizontal_alignment' => :'HorizontalAlignment',
130
+ :'vertical_alignment' => :'VerticalAlignment',
131
+ :'rich_text' => :'String',
132
+ :'interior_color' => :'Color',
133
+ :'starting_style' => :'LineEnding',
134
+ :'ending_style' => :'LineEnding',
135
+ :'intent' => :'PolyIntent',
136
+ :'vertices' => :'Array<Point>'
137
+ }
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ return unless attributes.is_a?(Hash)
144
+
145
+ # convert string to symbol for hash key
146
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
147
+
148
+ if attributes.has_key?(:'Links')
149
+ if (value = attributes[:'Links']).is_a?(Array)
150
+ self.links = value
151
+ end
152
+ end
153
+
154
+ if attributes.has_key?(:'Contents')
155
+ self.contents = attributes[:'Contents']
156
+ end
157
+
158
+ if attributes.has_key?(:'CreationDate')
159
+ self.creation_date = attributes[:'CreationDate']
160
+ end
161
+
162
+ if attributes.has_key?(:'Subject')
163
+ self.subject = attributes[:'Subject']
164
+ end
165
+
166
+ if attributes.has_key?(:'Title')
167
+ self.title = attributes[:'Title']
168
+ end
169
+
170
+ if attributes.has_key?(:'Modified')
171
+ self.modified = attributes[:'Modified']
172
+ end
173
+
174
+ if attributes.has_key?(:'Id')
175
+ self.id = attributes[:'Id']
176
+ end
177
+
178
+ if attributes.has_key?(:'Flags')
179
+ if (value = attributes[:'Flags']).is_a?(Array)
180
+ self.flags = value
181
+ end
182
+ end
183
+
184
+ if attributes.has_key?(:'Name')
185
+ self.name = attributes[:'Name']
186
+ end
187
+
188
+ if attributes.has_key?(:'Rect')
189
+ self.rect = attributes[:'Rect']
190
+ end
191
+
192
+ if attributes.has_key?(:'PageIndex')
193
+ self.page_index = attributes[:'PageIndex']
194
+ end
195
+
196
+ if attributes.has_key?(:'ZIndex')
197
+ self.z_index = attributes[:'ZIndex']
198
+ end
199
+
200
+ if attributes.has_key?(:'HorizontalAlignment')
201
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
202
+ end
203
+
204
+ if attributes.has_key?(:'VerticalAlignment')
205
+ self.vertical_alignment = attributes[:'VerticalAlignment']
206
+ end
207
+
208
+ if attributes.has_key?(:'RichText')
209
+ self.rich_text = attributes[:'RichText']
210
+ end
211
+
212
+ if attributes.has_key?(:'InteriorColor')
213
+ self.interior_color = attributes[:'InteriorColor']
214
+ end
215
+
216
+ if attributes.has_key?(:'StartingStyle')
217
+ self.starting_style = attributes[:'StartingStyle']
218
+ end
219
+
220
+ if attributes.has_key?(:'EndingStyle')
221
+ self.ending_style = attributes[:'EndingStyle']
222
+ end
223
+
224
+ if attributes.has_key?(:'Intent')
225
+ self.intent = attributes[:'Intent']
226
+ end
227
+
228
+ if attributes.has_key?(:'Vertices')
229
+ if (value = attributes[:'Vertices']).is_a?(Array)
230
+ self.vertices = value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ # Show invalid properties with the reasons. Usually used together with valid?
237
+ # @return Array for valid properies with the reasons
238
+ def list_invalid_properties
239
+ invalid_properties = Array.new
240
+ return invalid_properties
241
+ end
242
+
243
+ # Check to see if the all the properties in the model are valid
244
+ # @return true if the model is valid
245
+ def valid?
246
+ return true
247
+ end
248
+
249
+ # Checks equality by comparing each attribute.
250
+ # @param [Object] Object to be compared
251
+ def ==(o)
252
+ return true if self.equal?(o)
253
+ self.class == o.class &&
254
+ links == o.links &&
255
+ contents == o.contents &&
256
+ creation_date == o.creation_date &&
257
+ subject == o.subject &&
258
+ title == o.title &&
259
+ modified == o.modified &&
260
+ id == o.id &&
261
+ flags == o.flags &&
262
+ name == o.name &&
263
+ rect == o.rect &&
264
+ page_index == o.page_index &&
265
+ z_index == o.z_index &&
266
+ horizontal_alignment == o.horizontal_alignment &&
267
+ vertical_alignment == o.vertical_alignment &&
268
+ rich_text == o.rich_text &&
269
+ interior_color == o.interior_color &&
270
+ starting_style == o.starting_style &&
271
+ ending_style == o.ending_style &&
272
+ intent == o.intent &&
273
+ vertices == o.vertices
274
+ end
275
+
276
+ # @see the `==` method
277
+ # @param [Object] Object to be compared
278
+ def eql?(o)
279
+ self == o
280
+ end
281
+
282
+ # Calculates hash code according to all attributes.
283
+ # @return [Fixnum] Hash code
284
+ def hash
285
+ [links, contents, creation_date, subject, title, modified, id, flags, name, rect, page_index, z_index, horizontal_alignment, vertical_alignment, rich_text, interior_color, starting_style, ending_style, intent, vertices].hash
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ self.class.swagger_types.each_pair do |key, type|
294
+ if type =~ /\AArray<(.*)>/i
295
+ # check to ensure the input is an array given that the the attribute
296
+ # is documented as an array but the input is not
297
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
298
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
299
+ end
300
+ elsif !attributes[self.class.attribute_map[key]].nil?
301
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
302
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
303
+ end
304
+
305
+ self
306
+ end
307
+
308
+ # Deserializes the data based on type
309
+ # @param string type Data type
310
+ # @param string value Value to be deserialized
311
+ # @return [Object] Deserialized data
312
+ def _deserialize(type, value)
313
+ case type.to_sym
314
+ when :DateTime
315
+ DateTime.parse(value)
316
+ when :Date
317
+ Date.parse(value)
318
+ when :String
319
+ value.to_s
320
+ when :Integer
321
+ value.to_i
322
+ when :Float
323
+ value.to_f
324
+ when :BOOLEAN
325
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
326
+ true
327
+ else
328
+ false
329
+ end
330
+ when :Object
331
+ # generic object (usually a Hash), return directly
332
+ value
333
+ when /\AArray<(?<inner_type>.+)>\z/
334
+ inner_type = Regexp.last_match[:inner_type]
335
+ value.map { |v| _deserialize(inner_type, v) }
336
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
337
+ k_type = Regexp.last_match[:k_type]
338
+ v_type = Regexp.last_match[:v_type]
339
+ {}.tap do |hash|
340
+ value.each do |k, v|
341
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
342
+ end
343
+ end
344
+ else # model
345
+ temp_model = AsposePdfCloud.const_get(type).new
346
+ temp_model.build_from_hash(value)
347
+ end
348
+ end
349
+
350
+ # Returns the string representation of the object
351
+ # @return [String] String presentation of the object
352
+ def to_s
353
+ to_hash.to_s
354
+ end
355
+
356
+ # to_body is an alias to to_hash (backward compatibility)
357
+ # @return [Hash] Returns the object in the form of hash
358
+ def to_body
359
+ to_hash
360
+ end
361
+
362
+ # Returns the object in the form of hash
363
+ # @return [Hash] Returns the object in the form of hash
364
+ def to_hash
365
+ hash = {}
366
+ self.class.attribute_map.each_pair do |attr, param|
367
+ value = self.send(attr)
368
+ next if value.nil?
369
+ hash[param] = _to_hash(value)
370
+ end
371
+ hash
372
+ end
373
+
374
+ # Outputs non-array value in the form of hash
375
+ # For object, use to_hash. Otherwise, just return the value
376
+ # @param [Object] value Any valid value
377
+ # @return [Hash] Returns the value in the form of hash
378
+ def _to_hash(value)
379
+ if value.is_a?(Array)
380
+ value.compact.map{ |v| _to_hash(v) }
381
+ elsif value.is_a?(Hash)
382
+ {}.tap do |hash|
383
+ value.each { |k, v| hash[k] = _to_hash(v) }
384
+ end
385
+ elsif value.respond_to? :to_hash
386
+ value.to_hash
387
+ else
388
+ value
389
+ end
390
+ end
391
+
392
+ end
393
+
394
+ end