aspose_email_cloud 20.5.0 → 20.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose-email-cloud.rb +74 -0
- data/lib/aspose-email-cloud/api/email_api.rb +147 -0
- data/lib/aspose-email-cloud/models/ai_bcr_image_storage_file.rb +3 -3
- data/lib/aspose-email-cloud/models/ai_bcr_parse_storage_rq.rb +3 -3
- data/lib/aspose-email-cloud/models/append_email_base_request.rb +3 -3
- data/lib/aspose-email-cloud/models/append_email_model_rq.rb +3 -3
- data/lib/aspose-email-cloud/models/calendar_dto.rb +17 -4
- data/lib/aspose-email-cloud/models/contact_photo.rb +29 -5
- data/lib/aspose-email-cloud/models/daily_recurrence_pattern_dto.rb +296 -0
- data/lib/aspose-email-cloud/models/mapi_attachment_dto.rb +226 -0
- data/lib/aspose-email-cloud/models/mapi_binary_property_dto.rb +250 -0
- data/lib/aspose-email-cloud/models/mapi_boolean_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_attendees_dto.rb +266 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_daily_recurrence_pattern_dto.rb +464 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_dto.rb +728 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_event_recurrence_dto.rb +293 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_exception_info_dto.rb +431 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_recurrence_pattern_dto.rb +449 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_dto.rb +228 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_info_dto.rb +313 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_rule_dto.rb +362 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_weekly_recurrence_pattern_dto.rb +464 -0
- data/lib/aspose-email-cloud/models/mapi_calendar_yearly_and_monthly_recurrence_pattern_dto.rb +500 -0
- data/lib/aspose-email-cloud/models/mapi_contact_dto.rb +569 -0
- data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_dto.rb +283 -0
- data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb +327 -0
- data/lib/aspose-email-cloud/models/mapi_contact_event_property_set_dto.rb +236 -0
- data/lib/aspose-email-cloud/models/mapi_contact_name_property_set_dto.rb +335 -0
- data/lib/aspose-email-cloud/models/mapi_contact_other_property_set_dto.rb +319 -0
- data/lib/aspose-email-cloud/models/mapi_contact_personal_info_property_set_dto.rb +454 -0
- data/lib/aspose-email-cloud/models/mapi_contact_photo_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_contact_physical_address_dto.rb +322 -0
- data/lib/aspose-email-cloud/models/mapi_contact_physical_address_property_set_dto.rb +239 -0
- data/lib/aspose-email-cloud/models/mapi_contact_professional_property_set_dto.rb +291 -0
- data/lib/aspose-email-cloud/models/mapi_contact_telephone_property_set_dto.rb +457 -0
- data/lib/aspose-email-cloud/models/mapi_date_time_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_electronic_address_dto.rb +265 -0
- data/lib/aspose-email-cloud/models/mapi_file_as_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_importance_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_int_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_known_property_descriptor.rb +237 -0
- data/lib/aspose-email-cloud/models/mapi_legacy_free_busy_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_message_dto.rb +801 -0
- data/lib/aspose-email-cloud/models/mapi_message_item_base_dto.rb +452 -0
- data/lib/aspose-email-cloud/models/mapi_multi_int_property_dto.rb +252 -0
- data/lib/aspose-email-cloud/models/mapi_multi_string_property_dto.rb +252 -0
- data/lib/aspose-email-cloud/models/mapi_physical_address_index_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_pid_lid_property_descriptor.rb +322 -0
- data/lib/aspose-email-cloud/models/mapi_pid_name_property_descriptor.rb +304 -0
- data/lib/aspose-email-cloud/models/mapi_pid_property_descriptor.rb +286 -0
- data/lib/aspose-email-cloud/models/mapi_pid_tag_property_descriptor.rb +322 -0
- data/lib/aspose-email-cloud/models/mapi_property_descriptor.rb +224 -0
- data/lib/aspose-email-cloud/models/mapi_property_dto.rb +237 -0
- data/lib/aspose-email-cloud/models/mapi_recipient_dto.rb +257 -0
- data/lib/aspose-email-cloud/models/mapi_response_type_property_dto.rb +255 -0
- data/lib/aspose-email-cloud/models/mapi_string_property_dto.rb +250 -0
- data/lib/aspose-email-cloud/models/monthly_recurrence_pattern_dto.rb +350 -0
- data/lib/aspose-email-cloud/models/recurrence_pattern_dto.rb +296 -0
- data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_mapi_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_contact_model_to_mapi_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_email_model_to_file_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/convert_email_model_to_mapi_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_calendar_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_contact_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_email_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_file_as_mapi_model_request_data.rb +80 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_file_as_mapi_model_request_data.rb +90 -0
- data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/get_email_file_as_mapi_model_request_data.rb +90 -0
- data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/get_mapi_calendar_model_request_data.rb +91 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_contact_model_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_message_model_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +2 -2
- data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +4 -4
- data/lib/aspose-email-cloud/models/requests/save_mapi_calendar_model_request_data.rb +99 -0
- data/lib/aspose-email-cloud/models/requests/save_mapi_contact_model_request_data.rb +99 -0
- data/lib/aspose-email-cloud/models/requests/save_mapi_message_model_request_data.rb +99 -0
- data/lib/aspose-email-cloud/models/send_email_base_request.rb +3 -3
- data/lib/aspose-email-cloud/models/send_email_model_rq.rb +3 -3
- data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_calendar_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_contact_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_message_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/task_regenerating_pattern_dto.rb +314 -0
- data/lib/aspose-email-cloud/models/weekly_recurrence_pattern_dto.rb +311 -0
- data/lib/aspose-email-cloud/models/yearly_recurrence_pattern_dto.rb +368 -0
- data/lib/aspose-email-cloud/version.rb +1 -1
- metadata +76 -2
@@ -0,0 +1,239 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="MapiContactPhysicalAddressPropertySetDto.rb">
|
3
|
+
# Copyright (c) 2018-2020 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
|
+
# Specify three physical addresses: Home Address, Work Address, and Other Address. One of the addresses can be marked as the Mailing Address
|
31
|
+
class MapiContactPhysicalAddressPropertySetDto
|
32
|
+
# Specifies the address of the contact's work
|
33
|
+
# @return [MapiContactPhysicalAddressDto]
|
34
|
+
attr_accessor :work_address
|
35
|
+
|
36
|
+
# Specifies the address of the contact's home
|
37
|
+
# @return [MapiContactPhysicalAddressDto]
|
38
|
+
attr_accessor :home_address
|
39
|
+
|
40
|
+
# Specifies the other contact's address
|
41
|
+
# @return [MapiContactPhysicalAddressDto]
|
42
|
+
attr_accessor :other_address
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'work_address' => :'workAddress',
|
48
|
+
:'home_address' => :'homeAddress',
|
49
|
+
:'other_address' => :'otherAddress'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.swagger_types
|
55
|
+
{
|
56
|
+
:'work_address' => :'MapiContactPhysicalAddressDto',
|
57
|
+
:'home_address' => :'MapiContactPhysicalAddressDto',
|
58
|
+
:'other_address' => :'MapiContactPhysicalAddressDto'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
return unless attributes.is_a?(Hash)
|
66
|
+
|
67
|
+
# convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
69
|
+
|
70
|
+
if attributes.has_key?(:'workAddress')
|
71
|
+
self.work_address = attributes[:'workAddress']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.has_key?(:'homeAddress')
|
75
|
+
self.home_address = attributes[:'homeAddress']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.has_key?(:'otherAddress')
|
79
|
+
self.other_address = attributes[:'otherAddress']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Initializes the object
|
84
|
+
# @param [MapiContactPhysicalAddressDto] work_address Specifies the address of the contact's work
|
85
|
+
# @param [MapiContactPhysicalAddressDto] home_address Specifies the address of the contact's home
|
86
|
+
# @param [MapiContactPhysicalAddressDto] other_address Specifies the other contact's address
|
87
|
+
def initialize(work_address=nil, home_address=nil, other_address=nil)
|
88
|
+
self.work_address = work_address if work_address
|
89
|
+
self.home_address = home_address if home_address
|
90
|
+
self.other_address = other_address if other_address
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
invalid_properties = Array.new
|
97
|
+
invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
106
|
+
# Checks equality by comparing each attribute.
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def ==(o)
|
109
|
+
return true if self.equal?(o)
|
110
|
+
self.class == o.class &&
|
111
|
+
work_address == o.work_address &&
|
112
|
+
home_address == o.home_address &&
|
113
|
+
other_address == o.other_address
|
114
|
+
end
|
115
|
+
|
116
|
+
# @see the `==` method
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def eql?(o)
|
119
|
+
self == o
|
120
|
+
end
|
121
|
+
|
122
|
+
# Calculates hash code according to all attributes.
|
123
|
+
# @return [Fixnum] Hash code
|
124
|
+
def hash
|
125
|
+
[work_address, home_address, other_address].hash
|
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
|
+
attribute_key = self.class.attribute_map[key]
|
135
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
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 attributes[attribute_key].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
141
|
+
end
|
142
|
+
elsif !attributes[attribute_key].nil?
|
143
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
144
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Deserializes the data based on type
|
151
|
+
# @param string type Data type
|
152
|
+
# @param string value Value to be deserialized
|
153
|
+
# @return [Object] Deserialized data
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :BOOLEAN
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
sub_type = value[:type] || value[:discriminator] || type
|
188
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
189
|
+
type = sub_type
|
190
|
+
end
|
191
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
192
|
+
temp_model.build_from_hash(value)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the string representation of the object
|
197
|
+
# @return [String] String presentation of the object
|
198
|
+
def to_s
|
199
|
+
to_hash.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# to_body is an alias to to_hash (backward compatibility)
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_body
|
205
|
+
to_hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = self.send(attr)
|
214
|
+
next if value.nil?
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
end
|
@@ -0,0 +1,291 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="MapiContactProfessionalPropertySetDto.rb">
|
3
|
+
# Copyright (c) 2018-2020 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
|
+
# Properties are used to store professional details for the person represented by the contact
|
31
|
+
class MapiContactProfessionalPropertySetDto
|
32
|
+
# Gets or sets the job title of the contact
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :title
|
35
|
+
|
36
|
+
# Gets or sets the company that employs the contact
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :company_name
|
39
|
+
|
40
|
+
# Gets or sets the name of the department to which the contact belongs
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :department_name
|
43
|
+
|
44
|
+
# Gets or sets the location of the office that the contact works in
|
45
|
+
# @return [String]
|
46
|
+
attr_accessor :office_location
|
47
|
+
|
48
|
+
# Gets or sets the name of the contact's manager
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :manager_name
|
51
|
+
|
52
|
+
# Gets or sets the name of the contact's assistant
|
53
|
+
# @return [String]
|
54
|
+
attr_accessor :assistant
|
55
|
+
|
56
|
+
# Gets or sets the profession of the contact
|
57
|
+
# @return [String]
|
58
|
+
attr_accessor :profession
|
59
|
+
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
61
|
+
def self.attribute_map
|
62
|
+
{
|
63
|
+
:'title' => :'title',
|
64
|
+
:'company_name' => :'companyName',
|
65
|
+
:'department_name' => :'departmentName',
|
66
|
+
:'office_location' => :'officeLocation',
|
67
|
+
:'manager_name' => :'managerName',
|
68
|
+
:'assistant' => :'assistant',
|
69
|
+
:'profession' => :'profession'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Attribute type mapping.
|
74
|
+
def self.swagger_types
|
75
|
+
{
|
76
|
+
:'title' => :'String',
|
77
|
+
:'company_name' => :'String',
|
78
|
+
:'department_name' => :'String',
|
79
|
+
:'office_location' => :'String',
|
80
|
+
:'manager_name' => :'String',
|
81
|
+
:'assistant' => :'String',
|
82
|
+
:'profession' => :'String'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
if attributes.has_key?(:'title')
|
95
|
+
self.title = attributes[:'title']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'companyName')
|
99
|
+
self.company_name = attributes[:'companyName']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'departmentName')
|
103
|
+
self.department_name = attributes[:'departmentName']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'officeLocation')
|
107
|
+
self.office_location = attributes[:'officeLocation']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'managerName')
|
111
|
+
self.manager_name = attributes[:'managerName']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'assistant')
|
115
|
+
self.assistant = attributes[:'assistant']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'profession')
|
119
|
+
self.profession = attributes[:'profession']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Initializes the object
|
124
|
+
# @param [String] title Gets or sets the job title of the contact
|
125
|
+
# @param [String] company_name Gets or sets the company that employs the contact
|
126
|
+
# @param [String] department_name Gets or sets the name of the department to which the contact belongs
|
127
|
+
# @param [String] office_location Gets or sets the location of the office that the contact works in
|
128
|
+
# @param [String] manager_name Gets or sets the name of the contact's manager
|
129
|
+
# @param [String] assistant Gets or sets the name of the contact's assistant
|
130
|
+
# @param [String] profession Gets or sets the profession of the contact
|
131
|
+
def initialize(title=nil, company_name=nil, department_name=nil, office_location=nil, manager_name=nil, assistant=nil, profession=nil)
|
132
|
+
self.title = title if title
|
133
|
+
self.company_name = company_name if company_name
|
134
|
+
self.department_name = department_name if department_name
|
135
|
+
self.office_location = office_location if office_location
|
136
|
+
self.manager_name = manager_name if manager_name
|
137
|
+
self.assistant = assistant if assistant
|
138
|
+
self.profession = profession if profession
|
139
|
+
end
|
140
|
+
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
142
|
+
# @return Array for valid properties with the reasons
|
143
|
+
def list_invalid_properties
|
144
|
+
invalid_properties = Array.new
|
145
|
+
invalid_properties
|
146
|
+
end
|
147
|
+
|
148
|
+
# Check to see if the all the properties in the model are valid
|
149
|
+
# @return true if the model is valid
|
150
|
+
def valid?
|
151
|
+
true
|
152
|
+
end
|
153
|
+
|
154
|
+
# Checks equality by comparing each attribute.
|
155
|
+
# @param [Object] Object to be compared
|
156
|
+
def ==(o)
|
157
|
+
return true if self.equal?(o)
|
158
|
+
self.class == o.class &&
|
159
|
+
title == o.title &&
|
160
|
+
company_name == o.company_name &&
|
161
|
+
department_name == o.department_name &&
|
162
|
+
office_location == o.office_location &&
|
163
|
+
manager_name == o.manager_name &&
|
164
|
+
assistant == o.assistant &&
|
165
|
+
profession == o.profession
|
166
|
+
end
|
167
|
+
|
168
|
+
# @see the `==` method
|
169
|
+
# @param [Object] Object to be compared
|
170
|
+
def eql?(o)
|
171
|
+
self == o
|
172
|
+
end
|
173
|
+
|
174
|
+
# Calculates hash code according to all attributes.
|
175
|
+
# @return [Fixnum] Hash code
|
176
|
+
def hash
|
177
|
+
[title, company_name, department_name, office_location, manager_name, assistant, profession].hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Builds the object from hash
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
182
|
+
# @return [Object] Returns the model itself
|
183
|
+
def build_from_hash(attributes)
|
184
|
+
return nil unless attributes.is_a?(Hash)
|
185
|
+
self.class.swagger_types.each_pair do |key, type|
|
186
|
+
attribute_key = self.class.attribute_map[key]
|
187
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
188
|
+
if type =~ /\AArray<(.*)>/i
|
189
|
+
# check to ensure the input is an array given that the the attribute
|
190
|
+
# is documented as an array but the input is not
|
191
|
+
if attributes[attribute_key].is_a?(Array)
|
192
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
193
|
+
end
|
194
|
+
elsif !attributes[attribute_key].nil?
|
195
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
196
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
197
|
+
end
|
198
|
+
|
199
|
+
self
|
200
|
+
end
|
201
|
+
|
202
|
+
# Deserializes the data based on type
|
203
|
+
# @param string type Data type
|
204
|
+
# @param string value Value to be deserialized
|
205
|
+
# @return [Object] Deserialized data
|
206
|
+
def _deserialize(type, value)
|
207
|
+
case type.to_sym
|
208
|
+
when :DateTime
|
209
|
+
DateTime.parse(value)
|
210
|
+
when :Date
|
211
|
+
Date.parse(value)
|
212
|
+
when :String
|
213
|
+
value.to_s
|
214
|
+
when :Integer
|
215
|
+
value.to_i
|
216
|
+
when :Float
|
217
|
+
value.to_f
|
218
|
+
when :BOOLEAN
|
219
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
220
|
+
true
|
221
|
+
else
|
222
|
+
false
|
223
|
+
end
|
224
|
+
when :Object
|
225
|
+
# generic object (usually a Hash), return directly
|
226
|
+
value
|
227
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
228
|
+
inner_type = Regexp.last_match[:inner_type]
|
229
|
+
value.map { |v| _deserialize(inner_type, v) }
|
230
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
231
|
+
k_type = Regexp.last_match[:k_type]
|
232
|
+
v_type = Regexp.last_match[:v_type]
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each do |k, v|
|
235
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else # model
|
239
|
+
sub_type = value[:type] || value[:discriminator] || type
|
240
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
241
|
+
type = sub_type
|
242
|
+
end
|
243
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
244
|
+
temp_model.build_from_hash(value)
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Returns the string representation of the object
|
249
|
+
# @return [String] String presentation of the object
|
250
|
+
def to_s
|
251
|
+
to_hash.to_s
|
252
|
+
end
|
253
|
+
|
254
|
+
# to_body is an alias to to_hash (backward compatibility)
|
255
|
+
# @return [Hash] Returns the object in the form of hash
|
256
|
+
def to_body
|
257
|
+
to_hash
|
258
|
+
end
|
259
|
+
|
260
|
+
# Returns the object in the form of hash
|
261
|
+
# @return [Hash] Returns the object in the form of hash
|
262
|
+
def to_hash
|
263
|
+
hash = {}
|
264
|
+
self.class.attribute_map.each_pair do |attr, param|
|
265
|
+
value = self.send(attr)
|
266
|
+
next if value.nil?
|
267
|
+
hash[param] = _to_hash(value)
|
268
|
+
end
|
269
|
+
hash
|
270
|
+
end
|
271
|
+
|
272
|
+
# Outputs non-array value in the form of hash
|
273
|
+
# For object, use to_hash. Otherwise, just return the value
|
274
|
+
# @param [Object] value Any valid value
|
275
|
+
# @return [Hash] Returns the value in the form of hash
|
276
|
+
def _to_hash(value)
|
277
|
+
if value.is_a?(Array)
|
278
|
+
value.compact.map { |v| _to_hash(v) }
|
279
|
+
elsif value.is_a?(Hash)
|
280
|
+
{}.tap do |hash|
|
281
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
282
|
+
end
|
283
|
+
elsif value.respond_to? :to_hash
|
284
|
+
value.to_hash
|
285
|
+
else
|
286
|
+
value
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
end
|
291
|
+
end
|