test_kaferi_cloud 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/D://tmp//2018-02027//Ruby//.gitignore +42 -0
  3. data/D://tmp//2018-02027//Ruby//.idea//.rakeTasks +7 -0
  4. data/D://tmp//2018-02027//Ruby//.idea//inspectionProfiles//Project_Default.xml +6 -0
  5. data/D://tmp//2018-02027//Ruby//.idea//misc.xml +4 -0
  6. data/D://tmp//2018-02027//Ruby//.idea//modules.xml +8 -0
  7. data/D://tmp//2018-02027//Ruby//.idea//ruby.iml +15 -0
  8. data/D://tmp//2018-02027//Ruby//.idea//vcs.xml +6 -0
  9. data/D://tmp//2018-02027//Ruby//.idea//workspace.xml +776 -0
  10. data/D://tmp//2018-02027//Ruby//.swagger-codegen-ignore +58 -0
  11. data/D://tmp//2018-02027//Ruby//.swagger-codegen//VERSION +1 -0
  12. data/D://tmp//2018-02027//Ruby//LICENSE +21 -0
  13. data/D://tmp//2018-02027//Ruby//README.md +37 -0
  14. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud.rb +126 -0
  15. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//api//pdf_api.rb +4026 -0
  16. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//api_client.rb +523 -0
  17. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//api_error.rb +47 -0
  18. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//configuration.rb +189 -0
  19. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//annotation.rb +260 -0
  20. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//annotation_response.rb +222 -0
  21. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//annotations.rb +211 -0
  22. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//annotations_response.rb +222 -0
  23. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//append_document.rb +228 -0
  24. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//attachment.rb +270 -0
  25. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//attachment_response.rb +222 -0
  26. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//attachments.rb +211 -0
  27. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//attachments_response.rb +222 -0
  28. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//bookmarks.rb +211 -0
  29. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//bookmarks_response.rb +222 -0
  30. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//color.rb +244 -0
  31. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document.rb +220 -0
  32. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_pages_response.rb +222 -0
  33. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_properties.rb +211 -0
  34. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_properties_response.rb +222 -0
  35. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_property.rb +227 -0
  36. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_property_response.rb +222 -0
  37. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_response.rb +233 -0
  38. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//document_text_replace_response.rb +231 -0
  39. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//field.rb +254 -0
  40. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//field_response.rb +222 -0
  41. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//field_type.rb +44 -0
  42. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//fields.rb +211 -0
  43. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//fields_response.rb +222 -0
  44. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//font_styles.rb +43 -0
  45. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//horizontal_alignment.rb +44 -0
  46. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//http_status_code.rb +87 -0
  47. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//image.rb +220 -0
  48. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//image_response.rb +222 -0
  49. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//images.rb +211 -0
  50. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//images_list_request.rb +205 -0
  51. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//images_response.rb +222 -0
  52. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//line_spacing.rb +43 -0
  53. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link.rb +228 -0
  54. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_action_type.rb +46 -0
  55. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_annotation.rb +236 -0
  56. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_annotation_response.rb +222 -0
  57. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_annotations.rb +211 -0
  58. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_annotations_response.rb +222 -0
  59. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_element.rb +200 -0
  60. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//link_highlighting_mode.rb +45 -0
  61. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//merge_documents.rb +200 -0
  62. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//optimize_options.rb +293 -0
  63. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//page.rb +228 -0
  64. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//page_text_replace_response.rb +231 -0
  65. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//page_word_count.rb +218 -0
  66. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//pages.rb +211 -0
  67. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//paragraph.rb +303 -0
  68. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//rectangle.rb +244 -0
  69. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//rotation.rb +44 -0
  70. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//saa_spose_response.rb +213 -0
  71. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//segment.rb +206 -0
  72. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//signature.rb +333 -0
  73. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//signature_type.rb +42 -0
  74. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//split_result.rb +200 -0
  75. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//split_result_document.rb +238 -0
  76. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//split_result_response.rb +223 -0
  77. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//stamp.rb +413 -0
  78. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//stamp_type.rb +44 -0
  79. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_format.rb +227 -0
  80. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_format_response.rb +222 -0
  81. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_horizontal_alignment.rb +47 -0
  82. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_item.rb +218 -0
  83. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_item_response.rb +222 -0
  84. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_items.rb +211 -0
  85. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_items_response.rb +222 -0
  86. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_line.rb +210 -0
  87. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_rect.rb +220 -0
  88. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_rects.rb +199 -0
  89. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_rects_response.rb +222 -0
  90. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_replace.rb +253 -0
  91. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_replace_list_request.rb +232 -0
  92. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_replace_request.rb +262 -0
  93. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_replace_response.rb +222 -0
  94. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//text_state.rb +248 -0
  95. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//tiff_export_options.rb +348 -0
  96. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//vertical_alignment.rb +45 -0
  97. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//word_count.rb +199 -0
  98. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//word_count_response.rb +223 -0
  99. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//models//wrap_mode.rb +44 -0
  100. data/D://tmp//2018-02027//Ruby//lib//test_kaferi_cloud//version.rb +24 -0
  101. data/D://tmp//2018-02027//Ruby//test_kaferi_cloud.gemspec +49 -0
  102. metadata +102 -2
@@ -0,0 +1,218 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for 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 TestKaferiCloud
25
+ # Page words count.
26
+ class PageWordCount
27
+ # Page number.
28
+ attr_accessor :page_number
29
+
30
+ # Number of words at the page.
31
+ attr_accessor :count
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'page_number' => :'PageNumber',
38
+ :'count' => :'Count'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'page_number' => :'Integer',
46
+ :'count' => :'Integer'
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?(:'PageNumber')
59
+ self.page_number = attributes[:'PageNumber']
60
+ end
61
+
62
+ if attributes.has_key?(:'Count')
63
+ self.count = attributes[:'Count']
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 @page_number.nil?
73
+ invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
74
+ end
75
+
76
+ if @count.nil?
77
+ invalid_properties.push("invalid value for 'count', count 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 @page_number.nil?
87
+ return false if @count.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
+ page_number == o.page_number &&
97
+ count == o.count
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
+ [page_number, count].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 = TestKaferiCloud.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,211 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for 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 TestKaferiCloud
25
+ # List of pages.
26
+ class Pages
27
+ # Link to the document.
28
+ attr_accessor :links
29
+
30
+ attr_accessor :list
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'links' => :'Links',
37
+ :'list' => :'List'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'links' => :'Array<Link>',
45
+ :'list' => :'Array<Page>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
56
+
57
+ if attributes.has_key?(:'Links')
58
+ if (value = attributes[:'Links']).is_a?(Array)
59
+ self.links = value
60
+ end
61
+ end
62
+
63
+ if attributes.has_key?(:'List')
64
+ if (value = attributes[:'List']).is_a?(Array)
65
+ self.list = value
66
+ end
67
+ end
68
+
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properies with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ return invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ return true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ links == o.links &&
90
+ list == o.list
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [links, list].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = TestKaferiCloud.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map{ |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
@@ -0,0 +1,303 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2018 Aspose.Pdf for 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 TestKaferiCloud
25
+ # Paragraph DTO for add text functionality.
26
+ class Paragraph
27
+ attr_accessor :line_spacing
28
+
29
+ attr_accessor :wrap_mode
30
+
31
+ attr_accessor :horizontal_alignment
32
+
33
+ attr_accessor :left_margin
34
+
35
+ attr_accessor :right_margin
36
+
37
+ attr_accessor :top_margin
38
+
39
+ attr_accessor :bottom_margin
40
+
41
+ attr_accessor :rectangle
42
+
43
+ attr_accessor :rotation
44
+
45
+ attr_accessor :subsequent_lines_indent
46
+
47
+ attr_accessor :vertical_alignment
48
+
49
+ attr_accessor :lines
50
+
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'line_spacing' => :'LineSpacing',
56
+ :'wrap_mode' => :'WrapMode',
57
+ :'horizontal_alignment' => :'HorizontalAlignment',
58
+ :'left_margin' => :'LeftMargin',
59
+ :'right_margin' => :'RightMargin',
60
+ :'top_margin' => :'TopMargin',
61
+ :'bottom_margin' => :'BottomMargin',
62
+ :'rectangle' => :'Rectangle',
63
+ :'rotation' => :'Rotation',
64
+ :'subsequent_lines_indent' => :'SubsequentLinesIndent',
65
+ :'vertical_alignment' => :'VerticalAlignment',
66
+ :'lines' => :'Lines'
67
+ }
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.swagger_types
72
+ {
73
+ :'line_spacing' => :'LineSpacing',
74
+ :'wrap_mode' => :'WrapMode',
75
+ :'horizontal_alignment' => :'TextHorizontalAlignment',
76
+ :'left_margin' => :'Float',
77
+ :'right_margin' => :'Float',
78
+ :'top_margin' => :'Float',
79
+ :'bottom_margin' => :'Float',
80
+ :'rectangle' => :'Rectangle',
81
+ :'rotation' => :'Float',
82
+ :'subsequent_lines_indent' => :'Float',
83
+ :'vertical_alignment' => :'VerticalAlignment',
84
+ :'lines' => :'Array<TextLine>'
85
+ }
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
95
+
96
+ if attributes.has_key?(:'LineSpacing')
97
+ self.line_spacing = attributes[:'LineSpacing']
98
+ end
99
+
100
+ if attributes.has_key?(:'WrapMode')
101
+ self.wrap_mode = attributes[:'WrapMode']
102
+ end
103
+
104
+ if attributes.has_key?(:'HorizontalAlignment')
105
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
106
+ end
107
+
108
+ if attributes.has_key?(:'LeftMargin')
109
+ self.left_margin = attributes[:'LeftMargin']
110
+ end
111
+
112
+ if attributes.has_key?(:'RightMargin')
113
+ self.right_margin = attributes[:'RightMargin']
114
+ end
115
+
116
+ if attributes.has_key?(:'TopMargin')
117
+ self.top_margin = attributes[:'TopMargin']
118
+ end
119
+
120
+ if attributes.has_key?(:'BottomMargin')
121
+ self.bottom_margin = attributes[:'BottomMargin']
122
+ end
123
+
124
+ if attributes.has_key?(:'Rectangle')
125
+ self.rectangle = attributes[:'Rectangle']
126
+ end
127
+
128
+ if attributes.has_key?(:'Rotation')
129
+ self.rotation = attributes[:'Rotation']
130
+ end
131
+
132
+ if attributes.has_key?(:'SubsequentLinesIndent')
133
+ self.subsequent_lines_indent = attributes[:'SubsequentLinesIndent']
134
+ end
135
+
136
+ if attributes.has_key?(:'VerticalAlignment')
137
+ self.vertical_alignment = attributes[:'VerticalAlignment']
138
+ end
139
+
140
+ if attributes.has_key?(:'Lines')
141
+ if (value = attributes[:'Lines']).is_a?(Array)
142
+ self.lines = value
143
+ end
144
+ end
145
+
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properies with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ if @lines.nil?
153
+ invalid_properties.push("invalid value for 'lines', lines cannot be nil.")
154
+ end
155
+
156
+ return invalid_properties
157
+ end
158
+
159
+ # Check to see if the all the properties in the model are valid
160
+ # @return true if the model is valid
161
+ def valid?
162
+ return false if @lines.nil?
163
+ return true
164
+ end
165
+
166
+ # Checks equality by comparing each attribute.
167
+ # @param [Object] Object to be compared
168
+ def ==(o)
169
+ return true if self.equal?(o)
170
+ self.class == o.class &&
171
+ line_spacing == o.line_spacing &&
172
+ wrap_mode == o.wrap_mode &&
173
+ horizontal_alignment == o.horizontal_alignment &&
174
+ left_margin == o.left_margin &&
175
+ right_margin == o.right_margin &&
176
+ top_margin == o.top_margin &&
177
+ bottom_margin == o.bottom_margin &&
178
+ rectangle == o.rectangle &&
179
+ rotation == o.rotation &&
180
+ subsequent_lines_indent == o.subsequent_lines_indent &&
181
+ vertical_alignment == o.vertical_alignment &&
182
+ lines == o.lines
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Fixnum] Hash code
193
+ def hash
194
+ [line_spacing, wrap_mode, horizontal_alignment, left_margin, right_margin, top_margin, bottom_margin, rectangle, rotation, subsequent_lines_indent, vertical_alignment, lines].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ self.class.swagger_types.each_pair do |key, type|
203
+ if type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
207
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
208
+ end
209
+ elsif !attributes[self.class.attribute_map[key]].nil?
210
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
212
+ end
213
+
214
+ self
215
+ end
216
+
217
+ # Deserializes the data based on type
218
+ # @param string type Data type
219
+ # @param string value Value to be deserialized
220
+ # @return [Object] Deserialized data
221
+ def _deserialize(type, value)
222
+ case type.to_sym
223
+ when :DateTime
224
+ DateTime.parse(value)
225
+ when :Date
226
+ Date.parse(value)
227
+ when :String
228
+ value.to_s
229
+ when :Integer
230
+ value.to_i
231
+ when :Float
232
+ value.to_f
233
+ when :BOOLEAN
234
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ true
236
+ else
237
+ false
238
+ end
239
+ when :Object
240
+ # generic object (usually a Hash), return directly
241
+ value
242
+ when /\AArray<(?<inner_type>.+)>\z/
243
+ inner_type = Regexp.last_match[:inner_type]
244
+ value.map { |v| _deserialize(inner_type, v) }
245
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ k_type = Regexp.last_match[:k_type]
247
+ v_type = Regexp.last_match[:v_type]
248
+ {}.tap do |hash|
249
+ value.each do |k, v|
250
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
+ end
252
+ end
253
+ else # model
254
+ temp_model = TestKaferiCloud.const_get(type).new
255
+ temp_model.build_from_hash(value)
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ next if value.nil?
278
+ hash[param] = _to_hash(value)
279
+ end
280
+ hash
281
+ end
282
+
283
+ # Outputs non-array value in the form of hash
284
+ # For object, use to_hash. Otherwise, just return the value
285
+ # @param [Object] value Any valid value
286
+ # @return [Hash] Returns the value in the form of hash
287
+ def _to_hash(value)
288
+ if value.is_a?(Array)
289
+ value.compact.map{ |v| _to_hash(v) }
290
+ elsif value.is_a?(Hash)
291
+ {}.tap do |hash|
292
+ value.each { |k, v| hash[k] = _to_hash(v) }
293
+ end
294
+ elsif value.respond_to? :to_hash
295
+ value.to_hash
296
+ else
297
+ value
298
+ end
299
+ end
300
+
301
+ end
302
+
303
+ end