aspose_email_cloud 18.7.0 → 19.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +145 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +577 -0
  4. data/{src/asposeemailcloud → lib/aspose-email-cloud}/api_client.rb +125 -133
  5. data/lib/aspose-email-cloud/api_error.rb +42 -0
  6. data/{src/asposeemailcloud → lib/aspose-email-cloud}/configuration.rb +56 -43
  7. data/lib/aspose-email-cloud/models/account_base_request.rb +250 -0
  8. data/lib/aspose-email-cloud/models/add_attachment_request.rb +219 -0
  9. data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +300 -0
  10. data/lib/aspose-email-cloud/models/append_email_base_request.rb +316 -0
  11. data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +335 -0
  12. data/lib/aspose-email-cloud/models/base_object.rb +225 -0
  13. data/lib/aspose-email-cloud/models/contact_format.rb +45 -0
  14. data/lib/aspose-email-cloud/models/create_email_request.rb +224 -0
  15. data/lib/aspose-email-cloud/models/create_folder_base_request.rb +297 -0
  16. data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +302 -0
  17. data/lib/aspose-email-cloud/models/delete_message_base_request.rb +302 -0
  18. data/lib/aspose-email-cloud/models/disc_usage.rb +229 -0
  19. data/lib/aspose-email-cloud/models/email_account_request.rb +342 -0
  20. data/lib/aspose-email-cloud/models/email_document.rb +226 -0
  21. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_document_response.rb +105 -109
  22. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_properties.rb +122 -97
  23. data/lib/aspose-email-cloud/models/email_property.rb +256 -0
  24. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_property_response.rb +105 -109
  25. data/lib/aspose-email-cloud/models/error.rb +241 -0
  26. data/lib/aspose-email-cloud/models/error_details.rb +224 -0
  27. data/lib/aspose-email-cloud/models/file_version.rb +289 -0
  28. data/lib/aspose-email-cloud/models/file_versions.rb +210 -0
  29. data/lib/aspose-email-cloud/models/files_list.rb +210 -0
  30. data/lib/aspose-email-cloud/models/files_upload_result.rb +223 -0
  31. data/lib/aspose-email-cloud/models/hierarchical_object.rb +238 -0
  32. data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +224 -0
  33. data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +219 -0
  34. data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +254 -0
  35. data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +252 -0
  36. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/link.rb +138 -116
  37. data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +208 -0
  38. data/{src/asposeemailcloud/models/email_document.rb → lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb} +105 -98
  39. data/{src/asposeemailcloud/models/list_folders_response.rb → lib/aspose-email-cloud/models/list_response_of_string.rb} +105 -111
  40. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mail_server_folder.rb +116 -96
  41. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mime_response.rb +105 -109
  42. data/lib/aspose-email-cloud/models/object_exist.rb +229 -0
  43. data/lib/aspose-email-cloud/models/primitive_object.rb +236 -0
  44. data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +89 -0
  45. data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +101 -0
  46. data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +89 -0
  47. data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +89 -0
  48. data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +75 -0
  49. data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +75 -0
  50. data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +92 -0
  51. data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +89 -0
  52. data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +82 -0
  53. data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +94 -0
  54. data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +75 -0
  55. data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +82 -0
  56. data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +78 -0
  57. data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +82 -0
  58. data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +96 -0
  59. data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +108 -0
  60. data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +75 -0
  61. data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +75 -0
  62. data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +81 -0
  63. data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +81 -0
  64. data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +89 -0
  65. data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +82 -0
  66. data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +81 -0
  67. data/lib/aspose-email-cloud/models/requests/email_request.rb +75 -0
  68. data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +93 -0
  69. data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +88 -0
  70. data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +95 -0
  71. data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +81 -0
  72. data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +100 -0
  73. data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +92 -0
  74. data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +93 -0
  75. data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +71 -0
  76. data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +88 -0
  77. data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +88 -0
  78. data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +81 -0
  79. data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +78 -0
  80. data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +78 -0
  81. data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +88 -0
  82. data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +81 -0
  83. data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +80 -0
  84. data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +81 -0
  85. data/lib/aspose-email-cloud/models/requests/http_request.rb +51 -0
  86. data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +88 -0
  87. data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +105 -0
  88. data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +92 -0
  89. data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +89 -0
  90. data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +81 -0
  91. data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +75 -0
  92. data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +75 -0
  93. data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +75 -0
  94. data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +75 -0
  95. data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +89 -0
  96. data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +75 -0
  97. data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +75 -0
  98. data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +82 -0
  99. data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +94 -0
  100. data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +82 -0
  101. data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +87 -0
  102. data/lib/aspose-email-cloud/models/save_email_account_request.rb +377 -0
  103. data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +447 -0
  104. data/lib/aspose-email-cloud/models/send_email_base_request.rb +267 -0
  105. data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +286 -0
  106. data/lib/aspose-email-cloud/models/set_email_property_request.rb +224 -0
  107. data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +302 -0
  108. data/{src/asposeemailcloud/models/email_property.rb → lib/aspose-email-cloud/models/storage_exist.rb} +110 -96
  109. data/lib/aspose-email-cloud/models/storage_file.rb +262 -0
  110. data/lib/aspose-email-cloud/models/storage_file_location.rb +254 -0
  111. data/lib/aspose-email-cloud/models/storage_folder_location.rb +219 -0
  112. data/{src/asposeemailcloud/models/list_response.rb → lib/aspose-email-cloud/models/value_response.rb} +105 -111
  113. data/{src/asposeemailcloud → lib/aspose-email-cloud}/version.rb +4 -4
  114. metadata +128 -38
  115. data/src/asposeemailcloud.rb +0 -55
  116. data/src/asposeemailcloud/api/email_api.rb +0 -418
  117. data/src/asposeemailcloud/api/email_client_api.rb +0 -960
  118. data/src/asposeemailcloud/api_error.rb +0 -38
  119. data/src/asposeemailcloud/models/http_status_code.rb +0 -76
  120. data/src/asposeemailcloud/models/protocol_type.rb +0 -34
  121. data/src/asposeemailcloud/models/saa_spose_response.rb +0 -202
  122. data/src/asposeemailcloud/models/security_options.rb +0 -33
@@ -0,0 +1,224 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="ErrorDetails.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
+ # The error details
31
+ class ErrorDetails
32
+ # The request id
33
+ attr_accessor :request_id
34
+
35
+ # Date
36
+ attr_accessor :date
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'request_id' => :'requestId',
42
+ :'date' => :'date'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'request_id' => :'String',
50
+ :'date' => :'DateTime'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'requestId')
63
+ self.request_id = attributes[:'requestId']
64
+ end
65
+
66
+ if attributes.has_key?(:'date')
67
+ self.date = attributes[:'date']
68
+ end
69
+ end
70
+
71
+ # Initializes the object
72
+ def initialize(request_id=nil, date=nil)
73
+ self.request_id = request_id
74
+ self.date = date
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @date.nil?
82
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @date.nil?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ request_id == o.request_id &&
101
+ date == o.date
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [request_id, date].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ attribute_key = self.class.attribute_map[key]
123
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[attribute_key].is_a?(Array)
128
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[attribute_key].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ type = value[:type] || type
176
+ temp_model = AsposeEmailCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+ end
@@ -0,0 +1,289 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="FileVersion.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
+ # File Version
31
+ class FileVersion
32
+ # File or folder name.
33
+ attr_accessor :name
34
+
35
+ # True if it is a folder.
36
+ attr_accessor :is_folder
37
+
38
+ # File or folder last modified DateTime.
39
+ attr_accessor :modified_date
40
+
41
+ # File or folder size.
42
+ attr_accessor :size
43
+
44
+ # File or folder path.
45
+ attr_accessor :path
46
+
47
+ # File Version ID.
48
+ attr_accessor :version_id
49
+
50
+ # Specifies whether the file is (true) or is not (false) the latest version of an file.
51
+ attr_accessor :is_latest
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'name' => :'name',
57
+ :'is_folder' => :'isFolder',
58
+ :'modified_date' => :'modifiedDate',
59
+ :'size' => :'size',
60
+ :'path' => :'path',
61
+ :'version_id' => :'versionId',
62
+ :'is_latest' => :'isLatest'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'name' => :'String',
70
+ :'is_folder' => :'BOOLEAN',
71
+ :'modified_date' => :'DateTime',
72
+ :'size' => :'Integer',
73
+ :'path' => :'String',
74
+ :'version_id' => :'String',
75
+ :'is_latest' => :'BOOLEAN'
76
+ }
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ return unless attributes.is_a?(Hash)
83
+
84
+ # convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
86
+
87
+ if attributes.has_key?(:'name')
88
+ self.name = attributes[:'name']
89
+ end
90
+
91
+ if attributes.has_key?(:'isFolder')
92
+ self.is_folder = attributes[:'isFolder']
93
+ end
94
+
95
+ if attributes.has_key?(:'modifiedDate')
96
+ self.modified_date = attributes[:'modifiedDate']
97
+ end
98
+
99
+ if attributes.has_key?(:'size')
100
+ self.size = attributes[:'size']
101
+ end
102
+
103
+ if attributes.has_key?(:'path')
104
+ self.path = attributes[:'path']
105
+ end
106
+
107
+ if attributes.has_key?(:'versionId')
108
+ self.version_id = attributes[:'versionId']
109
+ end
110
+
111
+ if attributes.has_key?(:'isLatest')
112
+ self.is_latest = attributes[:'isLatest']
113
+ end
114
+ end
115
+
116
+ # Initializes the object
117
+ def initialize(name=nil, is_folder=nil, modified_date=nil, size=nil, path=nil, version_id=nil, is_latest=nil)
118
+ self.name = name
119
+ self.is_folder = is_folder
120
+ self.modified_date = modified_date
121
+ self.size = size
122
+ self.path = path
123
+ self.version_id = version_id
124
+ self.is_latest = is_latest
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ if @is_folder.nil?
132
+ invalid_properties.push('invalid value for "is_folder", is_folder cannot be nil.')
133
+ end
134
+
135
+ if @size.nil?
136
+ invalid_properties.push('invalid value for "size", size cannot be nil.')
137
+ end
138
+
139
+ if @is_latest.nil?
140
+ invalid_properties.push('invalid value for "is_latest", is_latest cannot be nil.')
141
+ end
142
+
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ return false if @is_folder.nil?
150
+ return false if @size.nil?
151
+ return false if @is_latest.nil?
152
+ true
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ name == o.name &&
161
+ is_folder == o.is_folder &&
162
+ modified_date == o.modified_date &&
163
+ size == o.size &&
164
+ path == o.path &&
165
+ version_id == o.version_id &&
166
+ is_latest == o.is_latest
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Fixnum] Hash code
177
+ def hash
178
+ [name, is_folder, modified_date, size, path, version_id, is_latest].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ self.class.swagger_types.each_pair do |key, type|
187
+ attribute_key = self.class.attribute_map[key]
188
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
189
+ if type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_key].is_a?(Array)
193
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
194
+ end
195
+ elsif !attributes[attribute_key].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
197
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ DateTime.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :BOOLEAN
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ type = value[:type] || type
241
+ temp_model = AsposeEmailCloud.const_get(type).new
242
+ temp_model.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ next if value.nil?
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ hash
268
+ end
269
+
270
+ # Outputs non-array value in the form of hash
271
+ # For object, use to_hash. Otherwise, just return the value
272
+ # @param [Object] value Any valid value
273
+ # @return [Hash] Returns the value in the form of hash
274
+ def _to_hash(value)
275
+ if value.is_a?(Array)
276
+ value.compact.map { |v| _to_hash(v) }
277
+ elsif value.is_a?(Hash)
278
+ {}.tap do |hash|
279
+ value.each { |k, v| hash[k] = _to_hash(v) }
280
+ end
281
+ elsif value.respond_to? :to_hash
282
+ value.to_hash
283
+ else
284
+ value
285
+ end
286
+ end
287
+
288
+ end
289
+ end