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,228 @@
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
+ # Provides link to page.
26
+ class Page
27
+ # Link to the document.
28
+ attr_accessor :links
29
+
30
+ # Page's id.
31
+ attr_accessor :id
32
+
33
+ attr_accessor :images
34
+
35
+ attr_accessor :rectangle
36
+
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'links' => :'Links',
42
+ :'id' => :'Id',
43
+ :'images' => :'Images',
44
+ :'rectangle' => :'Rectangle'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'links' => :'Array<Link>',
52
+ :'id' => :'Integer',
53
+ :'images' => :'Images',
54
+ :'rectangle' => :'Rectangle'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
65
+
66
+ if attributes.has_key?(:'Links')
67
+ if (value = attributes[:'Links']).is_a?(Array)
68
+ self.links = value
69
+ end
70
+ end
71
+
72
+ if attributes.has_key?(:'Id')
73
+ self.id = attributes[:'Id']
74
+ end
75
+
76
+ if attributes.has_key?(:'Images')
77
+ self.images = attributes[:'Images']
78
+ end
79
+
80
+ if attributes.has_key?(:'Rectangle')
81
+ self.rectangle = attributes[:'Rectangle']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properies with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ return invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ links == o.links &&
105
+ id == o.id &&
106
+ images == o.images &&
107
+ rectangle == o.rectangle
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Fixnum] Hash code
118
+ def hash
119
+ [links, id, images, rectangle].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.swagger_types.each_pair do |key, type|
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :BOOLEAN
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ temp_model = TestKaferiCloud.const_get(type).new
180
+ temp_model.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ next if value.nil?
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map{ |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,231 @@
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
+
26
+ class PageTextReplaceResponse
27
+ # Response status code.
28
+ attr_accessor :code
29
+
30
+ # Response status.
31
+ attr_accessor :status
32
+
33
+ attr_accessor :matches
34
+
35
+ attr_accessor :page
36
+
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'code' => :'Code',
42
+ :'status' => :'Status',
43
+ :'matches' => :'Matches',
44
+ :'page' => :'Page'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'code' => :'HttpStatusCode',
52
+ :'status' => :'String',
53
+ :'matches' => :'Integer',
54
+ :'page' => :'Page'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
65
+
66
+ if attributes.has_key?(:'Code')
67
+ self.code = attributes[:'Code']
68
+ end
69
+
70
+ if attributes.has_key?(:'Status')
71
+ self.status = attributes[:'Status']
72
+ end
73
+
74
+ if attributes.has_key?(:'Matches')
75
+ self.matches = attributes[:'Matches']
76
+ end
77
+
78
+ if attributes.has_key?(:'Page')
79
+ self.page = attributes[:'Page']
80
+ end
81
+
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properies with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @code.nil?
89
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
90
+ end
91
+
92
+ return invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @code.nil?
99
+ return true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ code == o.code &&
108
+ status == o.status &&
109
+ matches == o.matches &&
110
+ page == o.page
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Fixnum] Hash code
121
+ def hash
122
+ [code, status, matches, page].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.swagger_types.each_pair do |key, type|
131
+ if type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :BOOLEAN
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ temp_model = TestKaferiCloud.const_get(type).new
183
+ temp_model.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ next if value.nil?
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map{ |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end