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