groupdocs_parser_cloud 22.3 → 23.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/groupdocs_parser_cloud/api/file_api.rb +6 -6
- data/lib/groupdocs_parser_cloud/api/folder_api.rb +6 -6
- data/lib/groupdocs_parser_cloud/api/info_api.rb +3 -3
- data/lib/groupdocs_parser_cloud/api/parse_api.rb +101 -4
- data/lib/groupdocs_parser_cloud/api/storage_api.rb +5 -5
- data/lib/groupdocs_parser_cloud/api/template_api.rb +4 -4
- data/lib/groupdocs_parser_cloud/api_client.rb +2 -1
- data/lib/groupdocs_parser_cloud/api_error.rb +1 -1
- data/lib/groupdocs_parser_cloud/configuration.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/barcode.rb +234 -0
- data/lib/groupdocs_parser_cloud/models/barcode_page.rb +214 -0
- data/lib/groupdocs_parser_cloud/models/barcodes_options.rb +254 -0
- data/lib/groupdocs_parser_cloud/models/barcodes_result.rb +216 -0
- data/lib/groupdocs_parser_cloud/models/container_item.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/container_item_info.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/container_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/container_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/coordinates.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/create_template_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/detector_parameters.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/disc_usage.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/error.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/error_details.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/field.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/field_data.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/field_position.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/file_info.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/file_type.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/file_version.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/file_versions.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/files_list.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/files_upload_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/format.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/formats_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/formatted_text_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/image.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/image_page.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/images_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/images_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/info_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/info_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/object_exist.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/page.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/page_area.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/page_table_area.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/page_table_area_cell.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/page_text_area.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/parse_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/parse_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/parser_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/point.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/rectangle.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/size.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/storage_exist.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/storage_file.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/table.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/table_layout.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/template.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/template_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/template_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/text_options.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/text_page.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/text_result.rb +1 -1
- data/lib/groupdocs_parser_cloud/models/text_style.rb +1 -1
- data/lib/groupdocs_parser_cloud/version.rb +2 -2
- data/lib/groupdocs_parser_cloud.rb +5 -1
- metadata +10 -6
@@ -0,0 +1,214 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="barcode_page.rb">
|
4
|
+
# Copyright (c) 2003-2023 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsParserCloud
|
31
|
+
# Represents page object with barcode.
|
32
|
+
class BarcodePage
|
33
|
+
|
34
|
+
# The index of the page.
|
35
|
+
attr_accessor :index
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'index' => :'Index'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'index' => :'Integer'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
return unless attributes.is_a?(Hash)
|
55
|
+
|
56
|
+
# convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
58
|
+
|
59
|
+
if attributes.key?(:'Index')
|
60
|
+
self.index = attributes[:'Index']
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properies with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = []
|
69
|
+
return invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
return true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(other)
|
81
|
+
return true if self.equal?(other)
|
82
|
+
self.class == other.class &&
|
83
|
+
index == other.index
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(other)
|
89
|
+
self == other
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Fixnum] Hash code
|
94
|
+
def hash
|
95
|
+
[index].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Downcases first letter.
|
99
|
+
# @return downcased string
|
100
|
+
def uncap(str)
|
101
|
+
str[0, 1].downcase + str[1..-1]
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
111
|
+
value = attributes[pname]
|
112
|
+
if type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if value.is_a?(Array)
|
116
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !value.nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, value))
|
120
|
+
end
|
121
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
122
|
+
end
|
123
|
+
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
# Deserializes the data based on type
|
128
|
+
# @param string type Data type
|
129
|
+
# @param string value Value to be deserialized
|
130
|
+
# @return [Object] Deserialized data
|
131
|
+
def _deserialize(type, value)
|
132
|
+
case type.to_sym
|
133
|
+
when :DateTime
|
134
|
+
Date.parse value
|
135
|
+
when :Date
|
136
|
+
Date.parse value
|
137
|
+
when :String
|
138
|
+
value.to_s
|
139
|
+
when :Integer
|
140
|
+
value.to_i
|
141
|
+
when :Float
|
142
|
+
value.to_f
|
143
|
+
when :BOOLEAN
|
144
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
145
|
+
true
|
146
|
+
else
|
147
|
+
false
|
148
|
+
end
|
149
|
+
when :Object
|
150
|
+
# generic object (usually a Hash), return directly
|
151
|
+
value
|
152
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
153
|
+
inner_type = Regexp.last_match[:inner_type]
|
154
|
+
value.map { |v| _deserialize(inner_type, v) }
|
155
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
156
|
+
k_type = Regexp.last_match[:k_type]
|
157
|
+
v_type = Regexp.last_match[:v_type]
|
158
|
+
{}.tap do |hash|
|
159
|
+
value.each do |k, v|
|
160
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
else
|
164
|
+
# model
|
165
|
+
temp_model = GroupDocsParserCloud.const_get(type).new
|
166
|
+
temp_model.build_from_hash(value)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# Returns the string representation of the object
|
171
|
+
# @return [String] String presentation of the object
|
172
|
+
def to_s
|
173
|
+
to_hash.to_s
|
174
|
+
end
|
175
|
+
|
176
|
+
# to_body is an alias to to_hash (backward compatibility)
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
178
|
+
def to_body
|
179
|
+
to_hash
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the object in the form of hash
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_hash
|
185
|
+
hash = {}
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
187
|
+
value = self.send(attr)
|
188
|
+
next if value.nil?
|
189
|
+
hash[param] = _to_hash(value)
|
190
|
+
end
|
191
|
+
hash
|
192
|
+
end
|
193
|
+
|
194
|
+
# Outputs non-array value in the form of hash
|
195
|
+
# For object, use to_hash. Otherwise, just return the value
|
196
|
+
# @param [Object] value Any valid value
|
197
|
+
# @return [Hash] Returns the value in the form of hash
|
198
|
+
def _to_hash(value)
|
199
|
+
if value.is_a?(Array)
|
200
|
+
value.compact.map { |v| _to_hash(v) }
|
201
|
+
elsif value.is_a?(Hash)
|
202
|
+
{}.tap do |hash|
|
203
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
204
|
+
end
|
205
|
+
elsif value.respond_to? :to_hash
|
206
|
+
value.to_hash
|
207
|
+
else
|
208
|
+
value
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
@@ -0,0 +1,254 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="barcodes_options.rb">
|
4
|
+
# Copyright (c) 2003-2023 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsParserCloud
|
31
|
+
# Barcode options.
|
32
|
+
class BarcodesOptions
|
33
|
+
|
34
|
+
# Gets or sets the file information.
|
35
|
+
attr_accessor :file_info
|
36
|
+
|
37
|
+
# Gets or sets the container item information.
|
38
|
+
attr_accessor :container_item_info
|
39
|
+
|
40
|
+
# Gets or sets the output path for extracted barcodes.
|
41
|
+
attr_accessor :output_path
|
42
|
+
|
43
|
+
# Gets or sets the zero-based start page index.
|
44
|
+
attr_accessor :start_page_number
|
45
|
+
|
46
|
+
# Gets or sets the number of pages to extract.
|
47
|
+
attr_accessor :count_pages_to_extract
|
48
|
+
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
50
|
+
def self.attribute_map
|
51
|
+
{
|
52
|
+
:'file_info' => :'FileInfo',
|
53
|
+
:'container_item_info' => :'ContainerItemInfo',
|
54
|
+
:'output_path' => :'OutputPath',
|
55
|
+
:'start_page_number' => :'StartPageNumber',
|
56
|
+
:'count_pages_to_extract' => :'CountPagesToExtract'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# Attribute type mapping.
|
61
|
+
def self.swagger_types
|
62
|
+
{
|
63
|
+
:'file_info' => :'FileInfo',
|
64
|
+
:'container_item_info' => :'ContainerItemInfo',
|
65
|
+
:'output_path' => :'String',
|
66
|
+
:'start_page_number' => :'Integer',
|
67
|
+
:'count_pages_to_extract' => :'Integer'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
return unless attributes.is_a?(Hash)
|
75
|
+
|
76
|
+
# convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
78
|
+
|
79
|
+
if attributes.key?(:'FileInfo')
|
80
|
+
self.file_info = attributes[:'FileInfo']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'ContainerItemInfo')
|
84
|
+
self.container_item_info = attributes[:'ContainerItemInfo']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'OutputPath')
|
88
|
+
self.output_path = attributes[:'OutputPath']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'StartPageNumber')
|
92
|
+
self.start_page_number = attributes[:'StartPageNumber']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'CountPagesToExtract')
|
96
|
+
self.count_pages_to_extract = attributes[:'CountPagesToExtract']
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
102
|
+
# @return Array for valid properies with the reasons
|
103
|
+
def list_invalid_properties
|
104
|
+
invalid_properties = []
|
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 ==(other)
|
117
|
+
return true if self.equal?(other)
|
118
|
+
self.class == other.class &&
|
119
|
+
file_info == other.file_info &&
|
120
|
+
container_item_info == other.container_item_info &&
|
121
|
+
output_path == other.output_path &&
|
122
|
+
start_page_number == other.start_page_number &&
|
123
|
+
count_pages_to_extract == other.count_pages_to_extract
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(other)
|
129
|
+
self == other
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Fixnum] Hash code
|
134
|
+
def hash
|
135
|
+
[file_info, container_item_info, output_path, start_page_number, count_pages_to_extract].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
# Downcases first letter.
|
139
|
+
# @return downcased string
|
140
|
+
def uncap(str)
|
141
|
+
str[0, 1].downcase + str[1..-1]
|
142
|
+
end
|
143
|
+
|
144
|
+
# Builds the object from hash
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
+
# @return [Object] Returns the model itself
|
147
|
+
def build_from_hash(attributes)
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
149
|
+
self.class.swagger_types.each_pair do |key, type|
|
150
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
151
|
+
value = attributes[pname]
|
152
|
+
if type =~ /\AArray<(.*)>/i
|
153
|
+
# check to ensure the input is an array given that the the attribute
|
154
|
+
# is documented as an array but the input is not
|
155
|
+
if value.is_a?(Array)
|
156
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
157
|
+
end
|
158
|
+
elsif !value.nil?
|
159
|
+
self.send("#{key}=", _deserialize(type, value))
|
160
|
+
end
|
161
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
171
|
+
def _deserialize(type, value)
|
172
|
+
case type.to_sym
|
173
|
+
when :DateTime
|
174
|
+
Date.parse value
|
175
|
+
when :Date
|
176
|
+
Date.parse value
|
177
|
+
when :String
|
178
|
+
value.to_s
|
179
|
+
when :Integer
|
180
|
+
value.to_i
|
181
|
+
when :Float
|
182
|
+
value.to_f
|
183
|
+
when :BOOLEAN
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
185
|
+
true
|
186
|
+
else
|
187
|
+
false
|
188
|
+
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each do |k, v|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
else
|
204
|
+
# model
|
205
|
+
temp_model = GroupDocsParserCloud.const_get(type).new
|
206
|
+
temp_model.build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
next if value.nil?
|
229
|
+
hash[param] = _to_hash(value)
|
230
|
+
end
|
231
|
+
hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Outputs non-array value in the form of hash
|
235
|
+
# For object, use to_hash. Otherwise, just return the value
|
236
|
+
# @param [Object] value Any valid value
|
237
|
+
# @return [Hash] Returns the value in the form of hash
|
238
|
+
def _to_hash(value)
|
239
|
+
if value.is_a?(Array)
|
240
|
+
value.compact.map { |v| _to_hash(v) }
|
241
|
+
elsif value.is_a?(Hash)
|
242
|
+
{}.tap do |hash|
|
243
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
244
|
+
end
|
245
|
+
elsif value.respond_to? :to_hash
|
246
|
+
value.to_hash
|
247
|
+
else
|
248
|
+
value
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="barcodes_result.rb">
|
4
|
+
# Copyright (c) 2003-2023 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsParserCloud
|
31
|
+
# Barcodes result.
|
32
|
+
class BarcodesResult
|
33
|
+
|
34
|
+
# Gets or sets a collection of barcodes.
|
35
|
+
attr_accessor :barcodes
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'barcodes' => :'Barcodes'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'barcodes' => :'Array<Barcode>'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
return unless attributes.is_a?(Hash)
|
55
|
+
|
56
|
+
# convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
58
|
+
|
59
|
+
if attributes.key?(:'Barcodes')
|
60
|
+
if (value = attributes[:'Barcodes']).is_a?(Array)
|
61
|
+
self.barcodes = value
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properies with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
invalid_properties = []
|
71
|
+
return invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
return true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def ==(other)
|
83
|
+
return true if self.equal?(other)
|
84
|
+
self.class == other.class &&
|
85
|
+
barcodes == other.barcodes
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(other)
|
91
|
+
self == other
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Fixnum] Hash code
|
96
|
+
def hash
|
97
|
+
[barcodes].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Downcases first letter.
|
101
|
+
# @return downcased string
|
102
|
+
def uncap(str)
|
103
|
+
str[0, 1].downcase + str[1..-1]
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.swagger_types.each_pair do |key, type|
|
112
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
113
|
+
value = attributes[pname]
|
114
|
+
if type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if value.is_a?(Array)
|
118
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !value.nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, value))
|
122
|
+
end
|
123
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :DateTime
|
136
|
+
Date.parse value
|
137
|
+
when :Date
|
138
|
+
Date.parse value
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :BOOLEAN
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else
|
166
|
+
# model
|
167
|
+
temp_model = GroupDocsParserCloud.const_get(type).new
|
168
|
+
temp_model.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
next if value.nil?
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map { |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
3
|
# <copyright company="Aspose Pty Ltd" file="container_item.rb">
|
4
|
-
# Copyright (c) 2003-
|
4
|
+
# Copyright (c) 2003-2023 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
3
|
# <copyright company="Aspose Pty Ltd" file="container_item_info.rb">
|
4
|
-
# Copyright (c) 2003-
|
4
|
+
# Copyright (c) 2003-2023 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|