aspose_email_cloud 19.12.0 → 20.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +65 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +158 -1
  4. data/lib/aspose-email-cloud/models/ai_bcr_parse_ocr_data_rq.rb +230 -0
  5. data/lib/aspose-email-cloud/models/alternate_view.rb +279 -0
  6. data/lib/aspose-email-cloud/models/append_email_model_rq.rb +333 -0
  7. data/lib/aspose-email-cloud/models/associated_person.rb +241 -0
  8. data/lib/aspose-email-cloud/models/attachment.rb +321 -0
  9. data/lib/aspose-email-cloud/models/attachment_base.rb +251 -0
  10. data/lib/aspose-email-cloud/models/base_object.rb +86 -86
  11. data/lib/aspose-email-cloud/models/calendar_dto.rb +554 -0
  12. data/lib/aspose-email-cloud/models/calendar_dto_alternate_rq.rb +265 -0
  13. data/lib/aspose-email-cloud/models/calendar_dto_list.rb +212 -0
  14. data/lib/aspose-email-cloud/models/calendar_reminder.rb +315 -0
  15. data/lib/aspose-email-cloud/models/contact_dto.rb +696 -0
  16. data/lib/aspose-email-cloud/models/contact_dto_list.rb +212 -0
  17. data/lib/aspose-email-cloud/models/contact_photo.rb +228 -0
  18. data/lib/aspose-email-cloud/models/content_type.rb +264 -0
  19. data/lib/aspose-email-cloud/models/content_type_parameter.rb +223 -0
  20. data/lib/aspose-email-cloud/models/customer_event.rb +228 -0
  21. data/lib/aspose-email-cloud/models/email_address.rb +267 -0
  22. data/lib/aspose-email-cloud/models/email_dto.rb +678 -0
  23. data/lib/aspose-email-cloud/models/email_dto_list.rb +212 -0
  24. data/lib/aspose-email-cloud/models/enum_with_custom_of_associated_person_category.rb +227 -0
  25. data/lib/aspose-email-cloud/models/enum_with_custom_of_email_address_category.rb +227 -0
  26. data/lib/aspose-email-cloud/models/enum_with_custom_of_event_category.rb +227 -0
  27. data/lib/aspose-email-cloud/models/enum_with_custom_of_instant_messenger_category.rb +227 -0
  28. data/lib/aspose-email-cloud/models/enum_with_custom_of_phone_number_category.rb +227 -0
  29. data/lib/aspose-email-cloud/models/enum_with_custom_of_postal_address_category.rb +227 -0
  30. data/lib/aspose-email-cloud/models/enum_with_custom_of_url_category.rb +227 -0
  31. data/lib/aspose-email-cloud/models/hierarchical_object.rb +101 -101
  32. data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +119 -119
  33. data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +117 -117
  34. data/lib/aspose-email-cloud/models/instant_messenger_address.rb +241 -0
  35. data/lib/aspose-email-cloud/models/linked_resource.rb +264 -0
  36. data/lib/aspose-email-cloud/models/list_response_of_contact_dto.rb +211 -0
  37. data/lib/aspose-email-cloud/models/list_response_of_email_dto.rb +211 -0
  38. data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_calendar_dto.rb +211 -0
  39. data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_contact_dto.rb +211 -0
  40. data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_email_dto.rb +211 -0
  41. data/lib/aspose-email-cloud/models/mail_address.rb +241 -0
  42. data/lib/aspose-email-cloud/models/phone_number.rb +241 -0
  43. data/lib/aspose-email-cloud/models/postal_address.rb +350 -0
  44. data/lib/aspose-email-cloud/models/primitive_object.rb +99 -99
  45. data/lib/aspose-email-cloud/models/reminder_attendee.rb +210 -0
  46. data/lib/aspose-email-cloud/models/reminder_trigger.rb +246 -0
  47. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_model_request_data.rb +75 -0
  48. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_ocr_data_model_request_data.rb +75 -0
  49. data/lib/aspose-email-cloud/models/requests/append_email_model_message_request_data.rb +75 -0
  50. data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_alternate_request_data.rb +75 -0
  51. data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +83 -0
  52. data/lib/aspose-email-cloud/models/requests/fetch_email_model_request_data.rb +93 -0
  53. data/lib/aspose-email-cloud/models/requests/get_calendar_model_as_alternate_request_data.rb +91 -0
  54. data/lib/aspose-email-cloud/models/requests/get_calendar_model_list_request_data.rb +85 -0
  55. data/lib/aspose-email-cloud/models/requests/get_calendar_model_request_data.rb +81 -0
  56. data/lib/aspose-email-cloud/models/requests/get_contact_model_list_request_data.rb +87 -0
  57. data/lib/aspose-email-cloud/models/requests/get_contact_model_request_data.rb +88 -0
  58. data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +88 -0
  59. data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +87 -0
  60. data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +88 -0
  61. data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +1 -1
  62. data/lib/aspose-email-cloud/models/requests/list_email_models_request_data.rb +105 -0
  63. data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +82 -0
  64. data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +89 -0
  65. data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +89 -0
  66. data/lib/aspose-email-cloud/models/requests/send_email_model_request_data.rb +75 -0
  67. data/lib/aspose-email-cloud/models/send_email_model_rq.rb +273 -0
  68. data/lib/aspose-email-cloud/models/storage_model_of_calendar_dto.rb +222 -0
  69. data/lib/aspose-email-cloud/models/storage_model_of_contact_dto.rb +222 -0
  70. data/lib/aspose-email-cloud/models/storage_model_of_email_dto.rb +222 -0
  71. data/lib/aspose-email-cloud/models/storage_model_rq_of_calendar_dto.rb +222 -0
  72. data/lib/aspose-email-cloud/models/storage_model_rq_of_contact_dto.rb +222 -0
  73. data/lib/aspose-email-cloud/models/storage_model_rq_of_email_dto.rb +222 -0
  74. data/lib/aspose-email-cloud/models/url.rb +241 -0
  75. data/lib/aspose-email-cloud/models/value_response.rb +1 -1
  76. data/lib/aspose-email-cloud/version.rb +1 -1
  77. metadata +67 -2
@@ -0,0 +1,264 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="LinkedResource.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'date'
28
+
29
+ module AsposeEmailCloud
30
+ # Represents an embedded resource in a message.
31
+ class LinkedResource
32
+ # Attachment file content as Base64 string.
33
+ # @return [String]
34
+ attr_accessor :base64_data
35
+
36
+ # Attachment content id
37
+ # @return [String]
38
+ attr_accessor :content_id
39
+
40
+ # Content type
41
+ # @return [ContentType]
42
+ attr_accessor :content_type
43
+
44
+ # Attachment headers.
45
+ # @return [Hash<String, String>]
46
+ attr_accessor :headers
47
+
48
+ # URI that the resource must match.
49
+ # @return [String]
50
+ attr_accessor :content_link
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'base64_data' => :'base64Data',
56
+ :'content_id' => :'contentId',
57
+ :'content_type' => :'contentType',
58
+ :'headers' => :'headers',
59
+ :'content_link' => :'contentLink'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'base64_data' => :'String',
67
+ :'content_id' => :'String',
68
+ :'content_type' => :'ContentType',
69
+ :'headers' => :'Hash<String, String>',
70
+ :'content_link' => :'String'
71
+ }
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ if attributes.has_key?(:'base64Data')
83
+ self.base64_data = attributes[:'base64Data']
84
+ end
85
+
86
+ if attributes.has_key?(:'contentId')
87
+ self.content_id = attributes[:'contentId']
88
+ end
89
+
90
+ if attributes.has_key?(:'contentType')
91
+ self.content_type = attributes[:'contentType']
92
+ end
93
+
94
+ if attributes.has_key?(:'headers')
95
+ if (value = attributes[:'headers']).is_a?(Hash)
96
+ self.headers = value
97
+ end
98
+ end
99
+
100
+ if attributes.has_key?(:'contentLink')
101
+ self.content_link = attributes[:'contentLink']
102
+ end
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [String] base64_data Attachment file content as Base64 string.
107
+ # @param [String] content_id Attachment content id
108
+ # @param [ContentType] content_type Content type
109
+ # @param [Hash<String, String>] headers Attachment headers.
110
+ # @param [String] content_link URI that the resource must match.
111
+ def initialize(base64_data=nil, content_id=nil, content_type=nil, headers=nil, content_link=nil)
112
+ self.base64_data = base64_data if base64_data
113
+ self.content_id = content_id if content_id
114
+ self.content_type = content_type if content_type
115
+ self.headers = headers if headers
116
+ self.content_link = content_link if content_link
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ base64_data == o.base64_data &&
138
+ content_id == o.content_id &&
139
+ content_type == o.content_type &&
140
+ headers == o.headers &&
141
+ content_link == o.content_link
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Fixnum] Hash code
152
+ def hash
153
+ [base64_data, content_id, content_type, headers, content_link].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ attribute_key = self.class.attribute_map[key]
163
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
164
+ if type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_key].is_a?(Array)
168
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[attribute_key].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
172
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :BOOLEAN
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ type = value[:type] || type
216
+ temp_model = AsposeEmailCloud.const_get(type).new
217
+ temp_model.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ next if value.nil?
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+ end
@@ -0,0 +1,211 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="ListResponseOfContactDto.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'date'
28
+
29
+ module AsposeEmailCloud
30
+ class ListResponseOfContactDto
31
+
32
+ # @return [Array<ContactDto>]
33
+ attr_accessor :value
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'value' => :'value'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'value' => :'Array<ContactDto>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'value')
58
+ if (value = attributes[:'value']).is_a?(Array)
59
+ self.value = value
60
+ end
61
+ end
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Array<ContactDto>] value
66
+ def initialize(value=nil)
67
+ self.value = value if value
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ value == o.value
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
+ [value].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
+ attribute_key = self.class.attribute_map[key]
110
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[attribute_key].is_a?(Array)
115
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[attribute_key].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ type = value[:type] || type
163
+ temp_model = AsposeEmailCloud.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+ end