groupdocs_annotation_cloud 18.7 → 19.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/groupdocs_annotation_cloud.rb +23 -39
- data/lib/groupdocs_annotation_cloud/api/annotate_api.rb +664 -0
- data/lib/groupdocs_annotation_cloud/api/file_api.rb +729 -0
- data/lib/groupdocs_annotation_cloud/api/folder_api.rb +694 -0
- data/lib/groupdocs_annotation_cloud/api/{pdf_file_api.rb → info_api.rb} +101 -105
- data/lib/groupdocs_annotation_cloud/api/preview_api.rb +380 -0
- data/lib/groupdocs_annotation_cloud/api/storage_api.rb +541 -0
- data/lib/groupdocs_annotation_cloud/api_client.rb +7 -17
- data/lib/groupdocs_annotation_cloud/api_error.rb +5 -3
- data/lib/groupdocs_annotation_cloud/configuration.rb +3 -3
- data/lib/groupdocs_annotation_cloud/models/annotation_api_link.rb +24 -16
- data/lib/groupdocs_annotation_cloud/models/annotation_info.rb +97 -82
- data/lib/groupdocs_annotation_cloud/models/annotation_reply_info.rb +31 -23
- data/lib/groupdocs_annotation_cloud/models/disc_usage.rb +234 -0
- data/lib/groupdocs_annotation_cloud/models/document_info.rb +44 -22
- data/lib/groupdocs_annotation_cloud/models/error.rb +244 -0
- data/lib/groupdocs_annotation_cloud/models/error_details.rb +229 -0
- data/lib/groupdocs_annotation_cloud/models/file_version.rb +289 -0
- data/lib/groupdocs_annotation_cloud/models/{value_type.rb → file_versions.rb} +33 -13
- data/lib/groupdocs_annotation_cloud/models/files_list.rb +216 -0
- data/lib/groupdocs_annotation_cloud/models/files_upload_result.rb +228 -0
- data/lib/groupdocs_annotation_cloud/models/format.rb +224 -0
- data/lib/groupdocs_annotation_cloud/models/formats_result.rb +216 -0
- data/lib/groupdocs_annotation_cloud/models/link.rb +24 -16
- data/lib/groupdocs_annotation_cloud/models/link_element.rb +18 -10
- data/lib/groupdocs_annotation_cloud/models/object_exist.rb +234 -0
- data/lib/groupdocs_annotation_cloud/models/{image_page.rb → page_image.rb} +28 -13
- data/lib/groupdocs_annotation_cloud/models/{image_pages.rb → page_images.rb} +26 -14
- data/lib/groupdocs_annotation_cloud/models/page_info.rb +41 -23
- data/lib/groupdocs_annotation_cloud/models/point.rb +31 -13
- data/lib/groupdocs_annotation_cloud/models/rectangle.rb +45 -17
- data/lib/groupdocs_annotation_cloud/models/row_info.rb +38 -16
- data/lib/groupdocs_annotation_cloud/models/storage_exist.rb +219 -0
- data/lib/groupdocs_annotation_cloud/models/storage_file.rb +264 -0
- data/lib/groupdocs_annotation_cloud/version.rb +2 -2
- metadata +22 -39
- data/lib/groupdocs_annotation_cloud/api/annotation_api.rb +0 -344
- data/lib/groupdocs_annotation_cloud/api/image_info_api.rb +0 -218
- data/lib/groupdocs_annotation_cloud/api/image_pages_api.rb +0 -395
- data/lib/groupdocs_annotation_cloud/models/requests/delete_clean_document_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/delete_pages_request.rb +0 -49
- data/lib/groupdocs_annotation_cloud/models/requests/get_import_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/get_info_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/get_page_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/get_pages_request.rb +0 -49
- data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/get_pdf_stream_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/post_pages_request.rb +0 -53
- data/lib/groupdocs_annotation_cloud/models/requests/put_export_request.rb +0 -57
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
3
|
# <copyright company="Aspose Pty Ltd" file="row_info.rb">
|
4
|
-
# Copyright (c) 2003-
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -28,26 +28,40 @@
|
|
28
28
|
require 'date'
|
29
29
|
|
30
30
|
module GroupDocsAnnotationCloud
|
31
|
-
|
31
|
+
# Describes text row information
|
32
32
|
class RowInfo
|
33
|
+
|
34
|
+
# Gets or sets the list of character coordinates
|
33
35
|
attr_accessor :character_coordinates
|
36
|
+
|
37
|
+
# Gets or sets the text line height
|
34
38
|
attr_accessor :line_height
|
39
|
+
|
40
|
+
# Gets or sets the x coordinate of the text line upper left corner
|
35
41
|
attr_accessor :line_left
|
42
|
+
|
43
|
+
# Gets or sets the y coordinate of the text line upper left corner
|
36
44
|
attr_accessor :line_top
|
45
|
+
|
46
|
+
# Gets or sets the text line width
|
37
47
|
attr_accessor :line_width
|
48
|
+
|
49
|
+
# Gets or sets the text
|
38
50
|
attr_accessor :text
|
51
|
+
|
52
|
+
# Gets or sets the list of text coordinates
|
39
53
|
attr_accessor :text_coordinates
|
40
54
|
|
41
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
56
|
def self.attribute_map
|
43
57
|
{
|
44
|
-
:'character_coordinates' => :'
|
45
|
-
:'line_height' => :'
|
46
|
-
:'line_left' => :'
|
47
|
-
:'line_top' => :'
|
48
|
-
:'line_width' => :'
|
49
|
-
:'text' => :'
|
50
|
-
:'text_coordinates' => :'
|
58
|
+
:'character_coordinates' => :'CharacterCoordinates',
|
59
|
+
:'line_height' => :'LineHeight',
|
60
|
+
:'line_left' => :'LineLeft',
|
61
|
+
:'line_top' => :'LineTop',
|
62
|
+
:'line_width' => :'LineWidth',
|
63
|
+
:'text' => :'Text',
|
64
|
+
:'text_coordinates' => :'TextCoordinates'
|
51
65
|
}
|
52
66
|
end
|
53
67
|
|
@@ -165,20 +179,28 @@ module GroupDocsAnnotationCloud
|
|
165
179
|
[character_coordinates, line_height, line_left, line_top, line_width, text, text_coordinates].hash
|
166
180
|
end
|
167
181
|
|
182
|
+
# Downcases first letter.
|
183
|
+
# @return downcased string
|
184
|
+
def uncap(str)
|
185
|
+
str[0, 1].downcase + str[1..-1]
|
186
|
+
end
|
187
|
+
|
168
188
|
# Builds the object from hash
|
169
189
|
# @param [Hash] attributes Model attributes in the form of hash
|
170
190
|
# @return [Object] Returns the model itself
|
171
191
|
def build_from_hash(attributes)
|
172
192
|
return nil unless attributes.is_a?(Hash)
|
173
193
|
self.class.swagger_types.each_pair do |key, type|
|
194
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
195
|
+
value = attributes[pname]
|
174
196
|
if type =~ /\AArray<(.*)>/i
|
175
197
|
# check to ensure the input is an array given that the the attribute
|
176
|
-
# is documented as an array but the input is not
|
177
|
-
if
|
178
|
-
self.send("#{key}=",
|
198
|
+
# is documented as an array but the input is not
|
199
|
+
if value.is_a?(Array)
|
200
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
179
201
|
end
|
180
|
-
elsif !
|
181
|
-
self.send("#{key}=", _deserialize(type,
|
202
|
+
elsif !value.nil?
|
203
|
+
self.send("#{key}=", _deserialize(type, value))
|
182
204
|
end
|
183
205
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
184
206
|
end
|
@@ -193,9 +215,9 @@ module GroupDocsAnnotationCloud
|
|
193
215
|
def _deserialize(type, value)
|
194
216
|
case type.to_sym
|
195
217
|
when :DateTime
|
196
|
-
|
218
|
+
Date.parse value
|
197
219
|
when :Date
|
198
|
-
|
220
|
+
Date.parse value
|
199
221
|
when :String
|
200
222
|
value.to_s
|
201
223
|
when :Integer
|
@@ -0,0 +1,219 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="storage_exist.rb">
|
4
|
+
# Copyright (c) 2003-2019 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 GroupDocsAnnotationCloud
|
31
|
+
# Storage exists
|
32
|
+
class StorageExist
|
33
|
+
|
34
|
+
# Shows that the storage exists.
|
35
|
+
attr_accessor :exists
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'exists' => :'Exists'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.swagger_types
|
46
|
+
{
|
47
|
+
:'exists' => :'BOOLEAN'
|
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?(:'Exists')
|
60
|
+
self.exists = attributes[:'Exists']
|
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
|
+
if @exists.nil?
|
70
|
+
invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
|
71
|
+
end
|
72
|
+
|
73
|
+
return invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
return false if @exists.nil?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(other)
|
86
|
+
return true if self.equal?(other)
|
87
|
+
self.class == other.class &&
|
88
|
+
exists == other.exists
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(other)
|
94
|
+
self == other
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Fixnum] Hash code
|
99
|
+
def hash
|
100
|
+
[exists].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Downcases first letter.
|
104
|
+
# @return downcased string
|
105
|
+
def uncap(str)
|
106
|
+
str[0, 1].downcase + str[1..-1]
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
self.class.swagger_types.each_pair do |key, type|
|
115
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
116
|
+
value = attributes[pname]
|
117
|
+
if type =~ /\AArray<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if value.is_a?(Array)
|
121
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
122
|
+
end
|
123
|
+
elsif !value.nil?
|
124
|
+
self.send("#{key}=", _deserialize(type, value))
|
125
|
+
end
|
126
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
127
|
+
end
|
128
|
+
|
129
|
+
self
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def _deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :DateTime
|
139
|
+
Date.parse value
|
140
|
+
when :Date
|
141
|
+
Date.parse value
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :BOOLEAN
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else
|
169
|
+
# model
|
170
|
+
temp_model = GroupDocsAnnotationCloud.const_get(type).new
|
171
|
+
temp_model.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
next if value.nil?
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
@@ -0,0 +1,264 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="storage_file.rb">
|
4
|
+
# Copyright (c) 2003-2019 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 GroupDocsAnnotationCloud
|
31
|
+
# File or folder information
|
32
|
+
class StorageFile
|
33
|
+
|
34
|
+
# File or folder name.
|
35
|
+
attr_accessor :name
|
36
|
+
|
37
|
+
# True if it is a folder.
|
38
|
+
attr_accessor :is_folder
|
39
|
+
|
40
|
+
# File or folder last modified DateTime.
|
41
|
+
attr_accessor :modified_date
|
42
|
+
|
43
|
+
# File or folder size.
|
44
|
+
attr_accessor :size
|
45
|
+
|
46
|
+
# File or folder path.
|
47
|
+
attr_accessor :path
|
48
|
+
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
50
|
+
def self.attribute_map
|
51
|
+
{
|
52
|
+
:'name' => :'Name',
|
53
|
+
:'is_folder' => :'IsFolder',
|
54
|
+
:'modified_date' => :'ModifiedDate',
|
55
|
+
:'size' => :'Size',
|
56
|
+
:'path' => :'Path'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# Attribute type mapping.
|
61
|
+
def self.swagger_types
|
62
|
+
{
|
63
|
+
:'name' => :'String',
|
64
|
+
:'is_folder' => :'BOOLEAN',
|
65
|
+
:'modified_date' => :'DateTime',
|
66
|
+
:'size' => :'Integer',
|
67
|
+
:'path' => :'String'
|
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?(:'Name')
|
80
|
+
self.name = attributes[:'Name']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'IsFolder')
|
84
|
+
self.is_folder = attributes[:'IsFolder']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'ModifiedDate')
|
88
|
+
self.modified_date = attributes[:'ModifiedDate']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'Size')
|
92
|
+
self.size = attributes[:'Size']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'Path')
|
96
|
+
self.path = attributes[:'Path']
|
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
|
+
if @is_folder.nil?
|
106
|
+
invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
|
107
|
+
end
|
108
|
+
|
109
|
+
if @size.nil?
|
110
|
+
invalid_properties.push("invalid value for 'size', size cannot be nil.")
|
111
|
+
end
|
112
|
+
|
113
|
+
return invalid_properties
|
114
|
+
end
|
115
|
+
|
116
|
+
# Check to see if the all the properties in the model are valid
|
117
|
+
# @return true if the model is valid
|
118
|
+
def valid?
|
119
|
+
return false if @is_folder.nil?
|
120
|
+
return false if @size.nil?
|
121
|
+
return true
|
122
|
+
end
|
123
|
+
|
124
|
+
# Checks equality by comparing each attribute.
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def ==(other)
|
127
|
+
return true if self.equal?(other)
|
128
|
+
self.class == other.class &&
|
129
|
+
name == other.name &&
|
130
|
+
is_folder == other.is_folder &&
|
131
|
+
modified_date == other.modified_date &&
|
132
|
+
size == other.size &&
|
133
|
+
path == other.path
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see the `==` method
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def eql?(other)
|
139
|
+
self == other
|
140
|
+
end
|
141
|
+
|
142
|
+
# Calculates hash code according to all attributes.
|
143
|
+
# @return [Fixnum] Hash code
|
144
|
+
def hash
|
145
|
+
[name, is_folder, modified_date, size, path].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Downcases first letter.
|
149
|
+
# @return downcased string
|
150
|
+
def uncap(str)
|
151
|
+
str[0, 1].downcase + str[1..-1]
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def build_from_hash(attributes)
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
159
|
+
self.class.swagger_types.each_pair do |key, type|
|
160
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
161
|
+
value = attributes[pname]
|
162
|
+
if type =~ /\AArray<(.*)>/i
|
163
|
+
# check to ensure the input is an array given that the the attribute
|
164
|
+
# is documented as an array but the input is not
|
165
|
+
if value.is_a?(Array)
|
166
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
167
|
+
end
|
168
|
+
elsif !value.nil?
|
169
|
+
self.send("#{key}=", _deserialize(type, value))
|
170
|
+
end
|
171
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
172
|
+
end
|
173
|
+
|
174
|
+
self
|
175
|
+
end
|
176
|
+
|
177
|
+
# Deserializes the data based on type
|
178
|
+
# @param string type Data type
|
179
|
+
# @param string value Value to be deserialized
|
180
|
+
# @return [Object] Deserialized data
|
181
|
+
def _deserialize(type, value)
|
182
|
+
case type.to_sym
|
183
|
+
when :DateTime
|
184
|
+
Date.parse value
|
185
|
+
when :Date
|
186
|
+
Date.parse value
|
187
|
+
when :String
|
188
|
+
value.to_s
|
189
|
+
when :Integer
|
190
|
+
value.to_i
|
191
|
+
when :Float
|
192
|
+
value.to_f
|
193
|
+
when :BOOLEAN
|
194
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
195
|
+
true
|
196
|
+
else
|
197
|
+
false
|
198
|
+
end
|
199
|
+
when :Object
|
200
|
+
# generic object (usually a Hash), return directly
|
201
|
+
value
|
202
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
203
|
+
inner_type = Regexp.last_match[:inner_type]
|
204
|
+
value.map { |v| _deserialize(inner_type, v) }
|
205
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
206
|
+
k_type = Regexp.last_match[:k_type]
|
207
|
+
v_type = Regexp.last_match[:v_type]
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each do |k, v|
|
210
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
else
|
214
|
+
# model
|
215
|
+
temp_model = GroupDocsAnnotationCloud.const_get(type).new
|
216
|
+
temp_model.build_from_hash(value)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the string representation of the object
|
221
|
+
# @return [String] String presentation of the object
|
222
|
+
def to_s
|
223
|
+
to_hash.to_s
|
224
|
+
end
|
225
|
+
|
226
|
+
# to_body is an alias to to_hash (backward compatibility)
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
228
|
+
def to_body
|
229
|
+
to_hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the object in the form of hash
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_hash
|
235
|
+
hash = {}
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
237
|
+
value = self.send(attr)
|
238
|
+
next if value.nil?
|
239
|
+
hash[param] = _to_hash(value)
|
240
|
+
end
|
241
|
+
hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Outputs non-array value in the form of hash
|
245
|
+
# For object, use to_hash. Otherwise, just return the value
|
246
|
+
# @param [Object] value Any valid value
|
247
|
+
# @return [Hash] Returns the value in the form of hash
|
248
|
+
def _to_hash(value)
|
249
|
+
if value.is_a?(Array)
|
250
|
+
value.compact.map { |v| _to_hash(v) }
|
251
|
+
elsif value.is_a?(Hash)
|
252
|
+
{}.tap do |hash|
|
253
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
254
|
+
end
|
255
|
+
elsif value.respond_to? :to_hash
|
256
|
+
value.to_hash
|
257
|
+
else
|
258
|
+
value
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|