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