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