groupdocs_metadata_cloud 26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_metadata_cloud/api/file_api.rb +729 -0
  3. data/lib/groupdocs_metadata_cloud/api/folder_api.rb +694 -0
  4. data/lib/groupdocs_metadata_cloud/api/info_api.rb +363 -0
  5. data/lib/groupdocs_metadata_cloud/api/metadata_api.rb +508 -0
  6. data/lib/groupdocs_metadata_cloud/api/storage_api.rb +541 -0
  7. data/lib/groupdocs_metadata_cloud/api_client.rb +379 -0
  8. data/lib/groupdocs_metadata_cloud/api_client_error.rb +71 -0
  9. data/lib/groupdocs_metadata_cloud/configuration.rb +95 -0
  10. data/lib/groupdocs_metadata_cloud/models/add_options.rb +236 -0
  11. data/lib/groupdocs_metadata_cloud/models/add_property.rb +234 -0
  12. data/lib/groupdocs_metadata_cloud/models/add_result.rb +239 -0
  13. data/lib/groupdocs_metadata_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_metadata_cloud/models/error.rb +244 -0
  15. data/lib/groupdocs_metadata_cloud/models/error_details.rb +229 -0
  16. data/lib/groupdocs_metadata_cloud/models/extract_options.rb +224 -0
  17. data/lib/groupdocs_metadata_cloud/models/extract_result.rb +226 -0
  18. data/lib/groupdocs_metadata_cloud/models/file_info.rb +224 -0
  19. data/lib/groupdocs_metadata_cloud/models/file_type.rb +234 -0
  20. data/lib/groupdocs_metadata_cloud/models/file_version.rb +289 -0
  21. data/lib/groupdocs_metadata_cloud/models/file_versions.rb +216 -0
  22. data/lib/groupdocs_metadata_cloud/models/files_list.rb +216 -0
  23. data/lib/groupdocs_metadata_cloud/models/files_upload_result.rb +228 -0
  24. data/lib/groupdocs_metadata_cloud/models/format.rb +224 -0
  25. data/lib/groupdocs_metadata_cloud/models/formats_result.rb +216 -0
  26. data/lib/groupdocs_metadata_cloud/models/info_options.rb +214 -0
  27. data/lib/groupdocs_metadata_cloud/models/info_result.rb +259 -0
  28. data/lib/groupdocs_metadata_cloud/models/match_options.rb +234 -0
  29. data/lib/groupdocs_metadata_cloud/models/metadata_package.rb +238 -0
  30. data/lib/groupdocs_metadata_cloud/models/metadata_property.rb +256 -0
  31. data/lib/groupdocs_metadata_cloud/models/name_options.rb +224 -0
  32. data/lib/groupdocs_metadata_cloud/models/object_exist.rb +234 -0
  33. data/lib/groupdocs_metadata_cloud/models/remove_options.rb +234 -0
  34. data/lib/groupdocs_metadata_cloud/models/remove_result.rb +239 -0
  35. data/lib/groupdocs_metadata_cloud/models/search_criteria.rb +234 -0
  36. data/lib/groupdocs_metadata_cloud/models/search_criteria_without_value.rb +224 -0
  37. data/lib/groupdocs_metadata_cloud/models/set_options.rb +236 -0
  38. data/lib/groupdocs_metadata_cloud/models/set_property.rb +234 -0
  39. data/lib/groupdocs_metadata_cloud/models/set_result.rb +239 -0
  40. data/lib/groupdocs_metadata_cloud/models/storage_exist.rb +219 -0
  41. data/lib/groupdocs_metadata_cloud/models/storage_file.rb +264 -0
  42. data/lib/groupdocs_metadata_cloud/models/tag.rb +224 -0
  43. data/lib/groupdocs_metadata_cloud/models/tag_options.rb +224 -0
  44. data/lib/groupdocs_metadata_cloud/models/tags_options.rb +214 -0
  45. data/lib/groupdocs_metadata_cloud/models/tags_result.rb +214 -0
  46. data/lib/groupdocs_metadata_cloud/models/value_options.rb +224 -0
  47. data/lib/groupdocs_metadata_cloud/version.rb +29 -0
  48. data/lib/groupdocs_metadata_cloud.rb +76 -0
  49. metadata +144 -0
@@ -0,0 +1,238 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="metadata_package.rb">
4
+ # Copyright (c) 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 GroupDocsMetadataCloud
31
+ # Metadata package
32
+ class MetadataPackage
33
+
34
+ # Name of the metadata package.
35
+ attr_accessor :package_name
36
+
37
+ # Properties of the metadata package.
38
+ attr_accessor :package_properties
39
+
40
+ # Inner packages of current metadata package.
41
+ attr_accessor :inner_packages
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'package_name' => :'PackageName',
47
+ :'package_properties' => :'PackageProperties',
48
+ :'inner_packages' => :'InnerPackages'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'package_name' => :'String',
56
+ :'package_properties' => :'Array<MetadataProperty>',
57
+ :'inner_packages' => :'Array<MetadataPackage>'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'PackageName')
70
+ self.package_name = attributes[:'PackageName']
71
+ end
72
+
73
+ if attributes.key?(:'PackageProperties')
74
+ if (value = attributes[:'PackageProperties']).is_a?(Array)
75
+ self.package_properties = value
76
+ end
77
+ end
78
+
79
+ if attributes.key?(:'InnerPackages')
80
+ if (value = attributes[:'InnerPackages']).is_a?(Array)
81
+ self.inner_packages = value
82
+ end
83
+ end
84
+
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properies with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = []
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(other)
103
+ return true if self.equal?(other)
104
+ self.class == other.class &&
105
+ package_name == other.package_name &&
106
+ package_properties == other.package_properties &&
107
+ inner_packages == other.inner_packages
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(other)
113
+ self == other
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Fixnum] Hash code
118
+ def hash
119
+ [package_name, package_properties, inner_packages].hash
120
+ end
121
+
122
+ # Downcases first letter.
123
+ # @return downcased string
124
+ def uncap(str)
125
+ str[0, 1].downcase + str[1..-1]
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ pname = uncap(self.class.attribute_map[key]).intern
135
+ value = attributes[pname]
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the the attribute
138
+ # is documented as an array but the input is not
139
+ if value.is_a?(Array)
140
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !value.nil?
143
+ self.send("#{key}=", _deserialize(type, value))
144
+ end
145
+ # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ Date.parse value
159
+ when :Date
160
+ Date.parse value
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :BOOLEAN
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else
188
+ # model
189
+ temp_model = GroupDocsMetadataCloud.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,256 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="metadata_property.rb">
4
+ # Copyright (c) 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 GroupDocsMetadataCloud
31
+ # Metadata property
32
+ class MetadataProperty
33
+
34
+ # Name of the property.
35
+ attr_accessor :name
36
+
37
+ # Value of the property.
38
+ attr_accessor :value
39
+
40
+ # Property type.
41
+ attr_accessor :property_type
42
+
43
+ # Property access level.
44
+ attr_accessor :access_level
45
+
46
+ # Collection of the property tags.
47
+ attr_accessor :tags
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'name' => :'Name',
53
+ :'value' => :'Value',
54
+ :'property_type' => :'PropertyType',
55
+ :'access_level' => :'AccessLevel',
56
+ :'tags' => :'Tags'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'name' => :'String',
64
+ :'value' => :'String',
65
+ :'property_type' => :'String',
66
+ :'access_level' => :'String',
67
+ :'tags' => :'Array<Tag>'
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?(:'Value')
84
+ self.value = attributes[:'Value']
85
+ end
86
+
87
+ if attributes.key?(:'PropertyType')
88
+ self.property_type = attributes[:'PropertyType']
89
+ end
90
+
91
+ if attributes.key?(:'AccessLevel')
92
+ self.access_level = attributes[:'AccessLevel']
93
+ end
94
+
95
+ if attributes.key?(:'Tags')
96
+ if (value = attributes[:'Tags']).is_a?(Array)
97
+ self.tags = value
98
+ end
99
+ end
100
+
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properies with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = []
107
+ return invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(other)
119
+ return true if self.equal?(other)
120
+ self.class == other.class &&
121
+ name == other.name &&
122
+ value == other.value &&
123
+ property_type == other.property_type &&
124
+ access_level == other.access_level &&
125
+ tags == other.tags
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(other)
131
+ self == other
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [name, value, property_type, access_level, tags].hash
138
+ end
139
+
140
+ # Downcases first letter.
141
+ # @return downcased string
142
+ def uncap(str)
143
+ str[0, 1].downcase + str[1..-1]
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.swagger_types.each_pair do |key, type|
152
+ pname = uncap(self.class.attribute_map[key]).intern
153
+ value = attributes[pname]
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the the attribute
156
+ # is documented as an array but the input is not
157
+ if value.is_a?(Array)
158
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !value.nil?
161
+ self.send("#{key}=", _deserialize(type, value))
162
+ end
163
+ # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ Date.parse value
177
+ when :Date
178
+ Date.parse value
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :BOOLEAN
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else
206
+ # model
207
+ temp_model = GroupDocsMetadataCloud.const_get(type).new
208
+ temp_model.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -0,0 +1,224 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="name_options.rb">
4
+ # Copyright (c) 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 GroupDocsMetadataCloud
31
+ # Name options
32
+ class NameOptions
33
+
34
+ # The value for name matching.
35
+ attr_accessor :value
36
+
37
+ # Specifies how to find property name.
38
+ attr_accessor :match_options
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'value' => :'Value',
44
+ :'match_options' => :'MatchOptions'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'value' => :'String',
52
+ :'match_options' => :'MatchOptions'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
+
64
+ if attributes.key?(:'Value')
65
+ self.value = attributes[:'Value']
66
+ end
67
+
68
+ if attributes.key?(:'MatchOptions')
69
+ self.match_options = attributes[:'MatchOptions']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = []
78
+ return invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(other)
90
+ return true if self.equal?(other)
91
+ self.class == other.class &&
92
+ value == other.value &&
93
+ match_options == other.match_options
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(other)
99
+ self == other
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Fixnum] Hash code
104
+ def hash
105
+ [value, match_options].hash
106
+ end
107
+
108
+ # Downcases first letter.
109
+ # @return downcased string
110
+ def uncap(str)
111
+ str[0, 1].downcase + str[1..-1]
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ pname = uncap(self.class.attribute_map[key]).intern
121
+ value = attributes[pname]
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if value.is_a?(Array)
126
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !value.nil?
129
+ self.send("#{key}=", _deserialize(type, value))
130
+ end
131
+ # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ Date.parse value
145
+ when :Date
146
+ Date.parse value
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :BOOLEAN
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else
174
+ # model
175
+ temp_model = GroupDocsMetadataCloud.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end