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,226 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="EmailDocument.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 Email document DTO.
31
+ class EmailDocument
32
+ # Links that originate from this document.
33
+ attr_accessor :links
34
+
35
+ # List of document properties.
36
+ attr_accessor :document_properties
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'links' => :'links',
42
+ :'document_properties' => :'documentProperties'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'links' => :'Array<Link>',
50
+ :'document_properties' => :'EmailProperties'
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?(:'links')
63
+ if (value = attributes[:'links']).is_a?(Array)
64
+ self.links = value
65
+ end
66
+ end
67
+
68
+ if attributes.has_key?(:'documentProperties')
69
+ self.document_properties = attributes[:'documentProperties']
70
+ end
71
+ end
72
+
73
+ # Initializes the object
74
+ def initialize(links=nil, document_properties=nil)
75
+ self.links = links
76
+ self.document_properties = document_properties
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @document_properties.nil?
84
+ invalid_properties.push('invalid value for "document_properties", document_properties cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @document_properties.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ links == o.links &&
103
+ document_properties == o.document_properties
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [links, document_properties].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ attribute_key = self.class.attribute_map[key]
125
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_key].is_a?(Array)
130
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[attribute_key].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :BOOLEAN
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ type = value[:type] || type
178
+ temp_model = AsposeEmailCloud.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+ end
@@ -1,122 +1,118 @@
1
- =begin
2
- #Aspose.Email for Cloud API Reference
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="EmailDocumentResponse.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
+ # ----------------------------------------------------------------------------
3
25
 
4
- #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
-
6
- OpenAPI spec version: 1.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: unset
10
-
11
- =end
12
26
 
13
27
  require 'date'
14
28
 
15
- module asposeemailcloud
16
- # Email document property DTO.
17
- class EmailDocumentResponse
18
- attr_accessor :code
19
-
20
- attr_accessor :status
21
-
22
- # Gets or sets email document.
23
- attr_accessor :document
24
-
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'code' => :'Code',
30
- :'status' => :'Status',
31
- :'document' => :'Document'
32
- }
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.swagger_types
37
- {
38
- :'code' => :'HttpStatusCode',
39
- :'status' => :'String',
40
- :'document' => :'EmailDocument'
41
- }
42
- end
43
-
44
- # Initializes the object
45
- # @param [Hash] attributes Model attributes in the form of hash
46
- def initialize(attributes = {})
47
- return unless attributes.is_a?(Hash)
48
-
49
- # convert string to symbol for hash key
50
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
51
-
52
- if attributes.has_key?(:'Code')
53
- self.code = attributes[:'Code']
54
- end
55
-
56
- if attributes.has_key?(:'Status')
57
- self.status = attributes[:'Status']
58
- end
59
-
60
- if attributes.has_key?(:'Document')
61
- self.document = attributes[:'Document']
62
- end
63
-
64
- end
65
-
66
- # Show invalid properties with the reasons. Usually used together with valid?
67
- # @return Array for valid properies with the reasons
68
- def list_invalid_properties
69
- invalid_properties = Array.new
70
- if @code.nil?
71
- invalid_properties.push("invalid value for 'code', code cannot be nil.")
72
- end
73
-
74
- return 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
- return false if @code.nil?
81
- return true
82
- end
83
-
84
- # Checks equality by comparing each attribute.
85
- # @param [Object] Object to be compared
86
- def ==(o)
87
- return true if self.equal?(o)
88
- self.class == o.class &&
89
- code == o.code &&
90
- status == o.status &&
91
- document == o.document
92
- end
93
-
94
- # @see the `==` method
95
- # @param [Object] Object to be compared
96
- def eql?(o)
97
- self == o
98
- end
99
-
100
- # Calculates hash code according to all attributes.
101
- # @return [Fixnum] Hash code
102
- def hash
103
- [code, status, document].hash
104
- end
105
-
29
+ module AsposeEmailCloud
30
+ # An email document response
31
+ class EmailDocumentResponse
32
+ # An email document requested
33
+ attr_accessor :document
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'document' => :'document'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'document' => :'EmailDocument'
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?(:'document')
58
+ self.document = attributes[:'document']
59
+ end
60
+ end
61
+
62
+ # Initializes the object
63
+ def initialize(document=nil)
64
+ self.document = document
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ document == o.document
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [document].hash
98
+ end
99
+
106
100
  # Builds the object from hash
107
101
  # @param [Hash] attributes Model attributes in the form of hash
108
102
  # @return [Object] Returns the model itself
109
103
  def build_from_hash(attributes)
110
104
  return nil unless attributes.is_a?(Hash)
111
105
  self.class.swagger_types.each_pair do |key, type|
106
+ attribute_key = self.class.attribute_map[key]
107
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
112
108
  if type =~ /\AArray<(.*)>/i
113
109
  # check to ensure the input is an array given that the the attribute
114
110
  # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
111
+ if attributes[attribute_key].is_a?(Array)
112
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
117
113
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ elsif !attributes[attribute_key].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
120
116
  end # or else data not found in attributes(hash), not an issue as the data can be optional
121
117
  end
122
118
 
@@ -160,7 +156,8 @@ module asposeemailcloud
160
156
  end
161
157
  end
162
158
  else # model
163
- temp_model = asposeemailcloud.const_get(type).new
159
+ type = value[:type] || type
160
+ temp_model = AsposeEmailCloud.const_get(type).new
164
161
  temp_model.build_from_hash(value)
165
162
  end
166
163
  end
@@ -195,7 +192,7 @@ module asposeemailcloud
195
192
  # @return [Hash] Returns the value in the form of hash
196
193
  def _to_hash(value)
197
194
  if value.is_a?(Array)
198
- value.compact.map{ |v| _to_hash(v) }
195
+ value.compact.map { |v| _to_hash(v) }
199
196
  elsif value.is_a?(Hash)
200
197
  {}.tap do |hash|
201
198
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -206,7 +203,6 @@ module asposeemailcloud
206
203
  value
207
204
  end
208
205
  end
209
-
206
+
210
207
  end
211
-
212
208
  end