pdf4me 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +472 -0
  4. data/Rakefile +8 -0
  5. data/docs/ActionFlow.md +8 -0
  6. data/docs/ApiUsageRes.md +11 -0
  7. data/docs/ArchiveConfig.md +11 -0
  8. data/docs/ArchiveJobReq.md +12 -0
  9. data/docs/ArchiveJobRes.md +9 -0
  10. data/docs/Color.md +10 -0
  11. data/docs/ConvertApi.md +102 -0
  12. data/docs/ConvertToPdf.md +10 -0
  13. data/docs/ConvertToPdfAction.md +10 -0
  14. data/docs/ConvertToPdfRes.md +8 -0
  15. data/docs/CreateImages.md +10 -0
  16. data/docs/CreateImagesRes.md +8 -0
  17. data/docs/CreatePdfA.md +10 -0
  18. data/docs/CreatePdfARes.md +8 -0
  19. data/docs/CustomCMSConfig.md +23 -0
  20. data/docs/DocAction.md +8 -0
  21. data/docs/DocLog.md +12 -0
  22. data/docs/DocMetadata.md +16 -0
  23. data/docs/Document.md +16 -0
  24. data/docs/DocumentApi.md +203 -0
  25. data/docs/DropDocumentReq.md +20 -0
  26. data/docs/DropDocumentRes.md +15 -0
  27. data/docs/ExecutionTrigger.md +10 -0
  28. data/docs/Extract.md +10 -0
  29. data/docs/ExtractAction.md +9 -0
  30. data/docs/ExtractApi.md +102 -0
  31. data/docs/ExtractRes.md +8 -0
  32. data/docs/GetDocumentListRes.md +13 -0
  33. data/docs/GetDocumentReq.md +14 -0
  34. data/docs/GetDocumentRes.md +14 -0
  35. data/docs/IFormFile.md +13 -0
  36. data/docs/Image.md +15 -0
  37. data/docs/ImageAction.md +30 -0
  38. data/docs/ImageApi.md +107 -0
  39. data/docs/Job.md +10 -0
  40. data/docs/JobApi.md +197 -0
  41. data/docs/JobConfig.md +18 -0
  42. data/docs/JobConfigRes.md +8 -0
  43. data/docs/KeyValuePairStringObject.md +9 -0
  44. data/docs/KeyValuePairStringString.md +9 -0
  45. data/docs/ManagementApi.md +92 -0
  46. data/docs/Merge.md +10 -0
  47. data/docs/MergeAction.md +8 -0
  48. data/docs/MergeApi.md +102 -0
  49. data/docs/MergeRes.md +8 -0
  50. data/docs/Notification.md +9 -0
  51. data/docs/OcrAction.md +12 -0
  52. data/docs/OcrApi.md +57 -0
  53. data/docs/Optimize.md +10 -0
  54. data/docs/OptimizeAction.md +35 -0
  55. data/docs/OptimizeApi.md +103 -0
  56. data/docs/OptimizeRes.md +9 -0
  57. data/docs/Page.md +14 -0
  58. data/docs/PageSelection.md +10 -0
  59. data/docs/Pdf4meAction.md +12 -0
  60. data/docs/Pdf4meDocument.md +32 -0
  61. data/docs/Pdf4meException.md +8 -0
  62. data/docs/PdfAAction.md +14 -0
  63. data/docs/PdfAApi.md +102 -0
  64. data/docs/PdfFont.md +9 -0
  65. data/docs/Pricing.md +13 -0
  66. data/docs/ProduceDocuments.md +14 -0
  67. data/docs/ProduceDocumentsRes.md +8 -0
  68. data/docs/ProduceOutput.md +8 -0
  69. data/docs/RGBSet.md +10 -0
  70. data/docs/RecognizeDocument.md +10 -0
  71. data/docs/RecognizeDocumentRes.md +9 -0
  72. data/docs/Rectangle.md +11 -0
  73. data/docs/Rotate.md +10 -0
  74. data/docs/RunJobRes.md +10 -0
  75. data/docs/SignatureConfig.md +7 -0
  76. data/docs/Split.md +10 -0
  77. data/docs/SplitAction.md +11 -0
  78. data/docs/SplitApi.md +103 -0
  79. data/docs/SplitRes.md +8 -0
  80. data/docs/Stamp.md +10 -0
  81. data/docs/StampAction.md +22 -0
  82. data/docs/StampApi.md +110 -0
  83. data/docs/StampRes.md +8 -0
  84. data/docs/StorageFolder.md +10 -0
  85. data/docs/Text.md +17 -0
  86. data/docs/Transform.md +13 -0
  87. data/docs/Translate.md +9 -0
  88. data/docs/UserFingerprint.md +9 -0
  89. data/docs/VersionRes.md +8 -0
  90. data/docs/java.md +425 -0
  91. data/git_push.sh +55 -0
  92. data/lib/pdf4me.rb +124 -0
  93. data/lib/pdf4me/api/convert_api.rb +130 -0
  94. data/lib/pdf4me/api/document_api.rb +218 -0
  95. data/lib/pdf4me/api/extract_api.rb +131 -0
  96. data/lib/pdf4me/api/image_api.rb +139 -0
  97. data/lib/pdf4me/api/job_api.rb +223 -0
  98. data/lib/pdf4me/api/management_api.rb +117 -0
  99. data/lib/pdf4me/api/merge_api.rb +131 -0
  100. data/lib/pdf4me/api/ocr_api.rb +74 -0
  101. data/lib/pdf4me/api/optimize_api.rb +139 -0
  102. data/lib/pdf4me/api/pdf_a_api.rb +134 -0
  103. data/lib/pdf4me/api/split_api.rb +135 -0
  104. data/lib/pdf4me/api/stamp_api.rb +159 -0
  105. data/lib/pdf4me/api_client.rb +380 -0
  106. data/lib/pdf4me/api_error.rb +38 -0
  107. data/lib/pdf4me/configuration.rb +109 -0
  108. data/lib/pdf4me/models/action_flow.rb +190 -0
  109. data/lib/pdf4me/models/api_usage_res.rb +219 -0
  110. data/lib/pdf4me/models/archive_config.rb +226 -0
  111. data/lib/pdf4me/models/archive_job_req.rb +249 -0
  112. data/lib/pdf4me/models/archive_job_res.rb +207 -0
  113. data/lib/pdf4me/models/color.rb +206 -0
  114. data/lib/pdf4me/models/convert_to_pdf.rb +209 -0
  115. data/lib/pdf4me/models/convert_to_pdf_action.rb +253 -0
  116. data/lib/pdf4me/models/convert_to_pdf_res.rb +189 -0
  117. data/lib/pdf4me/models/create_images.rb +209 -0
  118. data/lib/pdf4me/models/create_images_res.rb +189 -0
  119. data/lib/pdf4me/models/create_pdf_a.rb +209 -0
  120. data/lib/pdf4me/models/create_pdf_a_res.rb +189 -0
  121. data/lib/pdf4me/models/custom_cms_config.rb +323 -0
  122. data/lib/pdf4me/models/doc_action.rb +190 -0
  123. data/lib/pdf4me/models/doc_log.rb +257 -0
  124. data/lib/pdf4me/models/doc_metadata.rb +285 -0
  125. data/lib/pdf4me/models/document.rb +285 -0
  126. data/lib/pdf4me/models/drop_document_req.rb +348 -0
  127. data/lib/pdf4me/models/drop_document_res.rb +260 -0
  128. data/lib/pdf4me/models/execution_trigger.rb +206 -0
  129. data/lib/pdf4me/models/extract.rb +207 -0
  130. data/lib/pdf4me/models/extract_action.rb +201 -0
  131. data/lib/pdf4me/models/extract_res.rb +188 -0
  132. data/lib/pdf4me/models/get_document_list_res.rb +237 -0
  133. data/lib/pdf4me/models/get_document_req.rb +243 -0
  134. data/lib/pdf4me/models/get_document_res.rb +246 -0
  135. data/lib/pdf4me/models/i_form_file.rb +235 -0
  136. data/lib/pdf4me/models/image.rb +300 -0
  137. data/lib/pdf4me/models/image_action.rb +513 -0
  138. data/lib/pdf4me/models/job.rb +213 -0
  139. data/lib/pdf4me/models/job_config.rb +298 -0
  140. data/lib/pdf4me/models/job_config_res.rb +193 -0
  141. data/lib/pdf4me/models/key_value_pair_string_object.rb +197 -0
  142. data/lib/pdf4me/models/key_value_pair_string_string.rb +197 -0
  143. data/lib/pdf4me/models/merge.rb +209 -0
  144. data/lib/pdf4me/models/merge_action.rb +190 -0
  145. data/lib/pdf4me/models/merge_res.rb +188 -0
  146. data/lib/pdf4me/models/notification.rb +199 -0
  147. data/lib/pdf4me/models/ocr_action.rb +259 -0
  148. data/lib/pdf4me/models/optimize.rb +209 -0
  149. data/lib/pdf4me/models/optimize_action.rb +514 -0
  150. data/lib/pdf4me/models/optimize_res.rb +199 -0
  151. data/lib/pdf4me/models/page.rb +258 -0
  152. data/lib/pdf4me/models/page_selection.rb +246 -0
  153. data/lib/pdf4me/models/pdf4me_action.rb +259 -0
  154. data/lib/pdf4me/models/pdf4me_document.rb +511 -0
  155. data/lib/pdf4me/models/pdf4me_exception.rb +189 -0
  156. data/lib/pdf4me/models/pdf_a_action.rb +297 -0
  157. data/lib/pdf4me/models/pdf_font.rb +213 -0
  158. data/lib/pdf4me/models/pricing.rb +278 -0
  159. data/lib/pdf4me/models/produce_documents.rb +251 -0
  160. data/lib/pdf4me/models/produce_documents_res.rb +191 -0
  161. data/lib/pdf4me/models/produce_output.rb +221 -0
  162. data/lib/pdf4me/models/recognize_document.rb +209 -0
  163. data/lib/pdf4me/models/recognize_document_res.rb +198 -0
  164. data/lib/pdf4me/models/rectangle.rb +215 -0
  165. data/lib/pdf4me/models/rgb_set.rb +206 -0
  166. data/lib/pdf4me/models/rotate.rb +221 -0
  167. data/lib/pdf4me/models/run_job_res.rb +215 -0
  168. data/lib/pdf4me/models/signature_config.rb +179 -0
  169. data/lib/pdf4me/models/split.rb +207 -0
  170. data/lib/pdf4me/models/split_action.rb +219 -0
  171. data/lib/pdf4me/models/split_res.rb +190 -0
  172. data/lib/pdf4me/models/stamp.rb +209 -0
  173. data/lib/pdf4me/models/stamp_action.rb +387 -0
  174. data/lib/pdf4me/models/stamp_res.rb +189 -0
  175. data/lib/pdf4me/models/storage_folder.rb +239 -0
  176. data/lib/pdf4me/models/text.rb +320 -0
  177. data/lib/pdf4me/models/transform.rb +263 -0
  178. data/lib/pdf4me/models/translate.rb +207 -0
  179. data/lib/pdf4me/models/user_fingerprint.rb +197 -0
  180. data/lib/pdf4me/models/version_res.rb +188 -0
  181. data/lib/pdf4me/version.rb +15 -0
  182. data/pdf4me.gemspec +47 -0
  183. data/spec/api/convert_api_spec.rb +60 -0
  184. data/spec/api/document_api_spec.rb +83 -0
  185. data/spec/api/extract_api_spec.rb +60 -0
  186. data/spec/api/image_api_spec.rb +62 -0
  187. data/spec/api/job_api_spec.rb +82 -0
  188. data/spec/api/management_api_spec.rb +57 -0
  189. data/spec/api/merge_api_spec.rb +60 -0
  190. data/spec/api/ocr_api_spec.rb +47 -0
  191. data/spec/api/optimize_api_spec.rb +60 -0
  192. data/spec/api/pdf_a_api_spec.rb +60 -0
  193. data/spec/api/split_api_spec.rb +60 -0
  194. data/spec/api/stamp_api_spec.rb +63 -0
  195. data/spec/api_client_spec.rb +226 -0
  196. data/spec/configuration_spec.rb +42 -0
  197. data/spec/models/action_flow_spec.rb +42 -0
  198. data/spec/models/api_usage_res_spec.rb +60 -0
  199. data/spec/models/archive_config_spec.rb +60 -0
  200. data/spec/models/archive_job_req_spec.rb +66 -0
  201. data/spec/models/archive_job_res_spec.rb +48 -0
  202. data/spec/models/color_spec.rb +54 -0
  203. data/spec/models/convert_to_pdf_action_spec.rb +62 -0
  204. data/spec/models/convert_to_pdf_res_spec.rb +42 -0
  205. data/spec/models/convert_to_pdf_spec.rb +54 -0
  206. data/spec/models/create_images_res_spec.rb +42 -0
  207. data/spec/models/create_images_spec.rb +54 -0
  208. data/spec/models/create_pdf_a_res_spec.rb +42 -0
  209. data/spec/models/create_pdf_a_spec.rb +54 -0
  210. data/spec/models/custom_cms_config_spec.rb +132 -0
  211. data/spec/models/doc_action_spec.rb +42 -0
  212. data/spec/models/doc_log_spec.rb +70 -0
  213. data/spec/models/doc_metadata_spec.rb +90 -0
  214. data/spec/models/document_spec.rb +90 -0
  215. data/spec/models/drop_document_req_spec.rb +118 -0
  216. data/spec/models/drop_document_res_spec.rb +84 -0
  217. data/spec/models/execution_trigger_spec.rb +54 -0
  218. data/spec/models/extract_action_spec.rb +48 -0
  219. data/spec/models/extract_res_spec.rb +42 -0
  220. data/spec/models/extract_spec.rb +54 -0
  221. data/spec/models/get_document_list_res_spec.rb +72 -0
  222. data/spec/models/get_document_req_spec.rb +78 -0
  223. data/spec/models/get_document_res_spec.rb +78 -0
  224. data/spec/models/i_form_file_spec.rb +72 -0
  225. data/spec/models/image_action_spec.rb +206 -0
  226. data/spec/models/image_spec.rb +88 -0
  227. data/spec/models/job_config_res_spec.rb +42 -0
  228. data/spec/models/job_config_spec.rb +102 -0
  229. data/spec/models/job_spec.rb +54 -0
  230. data/spec/models/key_value_pair_string_object_spec.rb +48 -0
  231. data/spec/models/key_value_pair_string_string_spec.rb +48 -0
  232. data/spec/models/merge_action_spec.rb +42 -0
  233. data/spec/models/merge_res_spec.rb +42 -0
  234. data/spec/models/merge_spec.rb +54 -0
  235. data/spec/models/notification_spec.rb +48 -0
  236. data/spec/models/ocr_action_spec.rb +70 -0
  237. data/spec/models/optimize_action_spec.rb +228 -0
  238. data/spec/models/optimize_res_spec.rb +48 -0
  239. data/spec/models/optimize_spec.rb +54 -0
  240. data/spec/models/page_selection_spec.rb +58 -0
  241. data/spec/models/page_spec.rb +78 -0
  242. data/spec/models/pdf4me_action_spec.rb +70 -0
  243. data/spec/models/pdf4me_document_spec.rb +202 -0
  244. data/spec/models/pdf4me_exception_spec.rb +42 -0
  245. data/spec/models/pdf_a_action_spec.rb +86 -0
  246. data/spec/models/pdf_font_spec.rb +48 -0
  247. data/spec/models/pricing_spec.rb +80 -0
  248. data/spec/models/produce_documents_res_spec.rb +42 -0
  249. data/spec/models/produce_documents_spec.rb +78 -0
  250. data/spec/models/produce_output_spec.rb +46 -0
  251. data/spec/models/recognize_document_res_spec.rb +48 -0
  252. data/spec/models/recognize_document_spec.rb +54 -0
  253. data/spec/models/rectangle_spec.rb +60 -0
  254. data/spec/models/rgb_set_spec.rb +54 -0
  255. data/spec/models/rotate_spec.rb +54 -0
  256. data/spec/models/run_job_res_spec.rb +54 -0
  257. data/spec/models/signature_config_spec.rb +36 -0
  258. data/spec/models/split_action_spec.rb +60 -0
  259. data/spec/models/split_res_spec.rb +42 -0
  260. data/spec/models/split_spec.rb +54 -0
  261. data/spec/models/stamp_action_spec.rb +142 -0
  262. data/spec/models/stamp_res_spec.rb +42 -0
  263. data/spec/models/stamp_spec.rb +54 -0
  264. data/spec/models/storage_folder_spec.rb +58 -0
  265. data/spec/models/text_spec.rb +104 -0
  266. data/spec/models/transform_spec.rb +72 -0
  267. data/spec/models/translate_spec.rb +48 -0
  268. data/spec/models/user_fingerprint_spec.rb +48 -0
  269. data/spec/models/version_res_spec.rb +42 -0
  270. data/spec/spec_helper.rb +111 -0
  271. metadata +594 -0
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #DmsApi
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Pdf4me
16
+
17
+ class GetDocumentRes
18
+ attr_accessor :document
19
+
20
+ attr_accessor :doc_logs
21
+
22
+ attr_accessor :pricing
23
+
24
+ attr_accessor :document_list
25
+
26
+ attr_accessor :success
27
+
28
+ attr_accessor :error_msg
29
+
30
+ attr_accessor :exception
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'document' => :'document',
37
+ :'doc_logs' => :'docLogs',
38
+ :'pricing' => :'pricing',
39
+ :'document_list' => :'documentList',
40
+ :'success' => :'success',
41
+ :'error_msg' => :'errorMsg',
42
+ :'exception' => :'exception'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'document' => :'Pdf4meDocument',
50
+ :'doc_logs' => :'Array<DocLog>',
51
+ :'pricing' => :'Pricing',
52
+ :'document_list' => :'Array<Document>',
53
+ :'success' => :'BOOLEAN',
54
+ :'error_msg' => :'String',
55
+ :'exception' => :'Object'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66
+
67
+ if attributes.has_key?(:'document')
68
+ self.document = attributes[:'document']
69
+ end
70
+
71
+ if attributes.has_key?(:'docLogs')
72
+ if (value = attributes[:'docLogs']).is_a?(Array)
73
+ self.doc_logs = value
74
+ end
75
+ end
76
+
77
+ if attributes.has_key?(:'pricing')
78
+ self.pricing = attributes[:'pricing']
79
+ end
80
+
81
+ if attributes.has_key?(:'documentList')
82
+ if (value = attributes[:'documentList']).is_a?(Array)
83
+ self.document_list = value
84
+ end
85
+ end
86
+
87
+ if attributes.has_key?(:'success')
88
+ self.success = attributes[:'success']
89
+ end
90
+
91
+ if attributes.has_key?(:'errorMsg')
92
+ self.error_msg = attributes[:'errorMsg']
93
+ end
94
+
95
+ if attributes.has_key?(:'exception')
96
+ self.exception = attributes[:'exception']
97
+ end
98
+
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ return invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ document == o.document &&
120
+ doc_logs == o.doc_logs &&
121
+ pricing == o.pricing &&
122
+ document_list == o.document_list &&
123
+ success == o.success &&
124
+ error_msg == o.error_msg &&
125
+ exception == o.exception
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [document, doc_logs, pricing, document_list, success, error_msg, exception].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :BOOLEAN
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ temp_model = Pdf4me.const_get(type).new
198
+ temp_model.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map{ |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -0,0 +1,235 @@
1
+ =begin
2
+ #DmsApi
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Pdf4me
16
+
17
+ class IFormFile
18
+ attr_accessor :content_type
19
+
20
+ attr_accessor :content_disposition
21
+
22
+ attr_accessor :headers
23
+
24
+ attr_accessor :length
25
+
26
+ attr_accessor :name
27
+
28
+ attr_accessor :file_name
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'content_type' => :'contentType',
35
+ :'content_disposition' => :'contentDisposition',
36
+ :'headers' => :'headers',
37
+ :'length' => :'length',
38
+ :'name' => :'name',
39
+ :'file_name' => :'fileName'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'content_type' => :'String',
47
+ :'content_disposition' => :'String',
48
+ :'headers' => :'Hash<String, Array<String>>',
49
+ :'length' => :'Integer',
50
+ :'name' => :'String',
51
+ :'file_name' => :'String'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'contentType')
64
+ self.content_type = attributes[:'contentType']
65
+ end
66
+
67
+ if attributes.has_key?(:'contentDisposition')
68
+ self.content_disposition = attributes[:'contentDisposition']
69
+ end
70
+
71
+ if attributes.has_key?(:'headers')
72
+ if (value = attributes[:'headers']).is_a?(Hash)
73
+ self.headers = value
74
+ end
75
+ end
76
+
77
+ if attributes.has_key?(:'length')
78
+ self.length = attributes[:'length']
79
+ end
80
+
81
+ if attributes.has_key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.has_key?(:'fileName')
86
+ self.file_name = attributes[:'fileName']
87
+ end
88
+
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ return invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ content_type == o.content_type &&
110
+ content_disposition == o.content_disposition &&
111
+ headers == o.headers &&
112
+ length == o.length &&
113
+ name == o.name &&
114
+ file_name == o.file_name
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Fixnum] Hash code
125
+ def hash
126
+ [content_type, content_disposition, headers, length, name, file_name].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :BOOLEAN
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ temp_model = Pdf4me.const_get(type).new
187
+ temp_model.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map{ |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end