aspose_email_cloud 20.2.0 → 20.3.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 +13 -0
- data/lib/aspose-email-cloud/api/email_api.rb +921 -879
- data/lib/aspose-email-cloud/api_client.rb +386 -382
- data/lib/aspose-email-cloud/api_error.rb +41 -41
- data/lib/aspose-email-cloud/configuration.rb +240 -240
- data/lib/aspose-email-cloud/models/account_base_request.rb +263 -260
- data/lib/aspose-email-cloud/models/add_attachment_request.rb +226 -223
- data/lib/aspose-email-cloud/models/ai_bcr_base64_image.rb +231 -228
- data/lib/aspose-email-cloud/models/ai_bcr_base64_rq.rb +228 -225
- data/lib/aspose-email-cloud/models/ai_bcr_image.rb +218 -215
- data/lib/aspose-email-cloud/models/ai_bcr_image_storage_file.rb +231 -228
- data/lib/aspose-email-cloud/models/ai_bcr_ocr_data.rb +256 -253
- data/lib/aspose-email-cloud/models/ai_bcr_ocr_data_part.rb +300 -297
- data/lib/aspose-email-cloud/models/ai_bcr_options.rb +226 -223
- data/lib/aspose-email-cloud/models/ai_bcr_parse_ocr_data_rq.rb +233 -230
- data/lib/aspose-email-cloud/models/ai_bcr_parse_storage_rq.rb +251 -248
- data/lib/aspose-email-cloud/models/ai_bcr_rq.rb +213 -210
- data/lib/aspose-email-cloud/models/ai_bcr_storage_image_rq.rb +233 -230
- data/lib/aspose-email-cloud/models/ai_name_component.rb +267 -264
- data/lib/aspose-email-cloud/models/ai_name_cultural_context.rb +270 -267
- data/lib/aspose-email-cloud/models/ai_name_extracted.rb +233 -230
- data/lib/aspose-email-cloud/models/ai_name_extracted_component.rb +231 -228
- data/lib/aspose-email-cloud/models/ai_name_formatted.rb +226 -223
- data/lib/aspose-email-cloud/models/ai_name_gender_hypothesis.rb +236 -233
- data/lib/aspose-email-cloud/models/ai_name_match_result.rb +233 -230
- data/lib/aspose-email-cloud/models/ai_name_mismatch.rb +249 -246
- data/lib/aspose-email-cloud/models/ai_name_parsed_match_rq.rb +266 -263
- data/lib/aspose-email-cloud/models/ai_name_parsed_rq.rb +246 -243
- data/lib/aspose-email-cloud/models/ai_name_weighted.rb +231 -228
- data/lib/aspose-email-cloud/models/ai_name_weighted_variants.rb +228 -225
- data/lib/aspose-email-cloud/models/alternate_view.rb +282 -279
- data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +318 -315
- data/lib/aspose-email-cloud/models/append_email_base_request.rb +336 -333
- data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +355 -352
- data/lib/aspose-email-cloud/models/append_email_model_rq.rb +336 -333
- data/lib/aspose-email-cloud/models/associated_person.rb +244 -241
- data/lib/aspose-email-cloud/models/attachment.rb +324 -321
- data/lib/aspose-email-cloud/models/attachment_base.rb +254 -251
- data/lib/aspose-email-cloud/models/base_object.rb +5 -2
- data/lib/aspose-email-cloud/models/calendar_dto.rb +557 -554
- data/lib/aspose-email-cloud/models/calendar_dto_alternate_rq.rb +268 -265
- data/lib/aspose-email-cloud/models/calendar_dto_list.rb +215 -212
- data/lib/aspose-email-cloud/models/calendar_reminder.rb +318 -315
- data/lib/aspose-email-cloud/models/contact_dto.rb +699 -696
- data/lib/aspose-email-cloud/models/contact_dto_list.rb +215 -212
- data/lib/aspose-email-cloud/models/contact_photo.rb +231 -228
- data/lib/aspose-email-cloud/models/content_type.rb +267 -264
- data/lib/aspose-email-cloud/models/content_type_parameter.rb +226 -223
- data/lib/aspose-email-cloud/models/create_email_request.rb +231 -228
- data/lib/aspose-email-cloud/models/create_folder_base_request.rb +313 -310
- data/lib/aspose-email-cloud/models/customer_event.rb +231 -228
- data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +318 -315
- data/lib/aspose-email-cloud/models/delete_message_base_request.rb +318 -315
- data/lib/aspose-email-cloud/models/disc_usage.rb +236 -233
- data/lib/aspose-email-cloud/models/discover_email_config_oauth.rb +391 -388
- data/lib/aspose-email-cloud/models/discover_email_config_password.rb +304 -301
- data/lib/aspose-email-cloud/models/discover_email_config_rq.rb +268 -265
- data/lib/aspose-email-cloud/models/email_account_config.rb +323 -320
- data/lib/aspose-email-cloud/models/email_account_config_list.rb +215 -212
- data/lib/aspose-email-cloud/models/email_account_request.rb +397 -394
- data/lib/aspose-email-cloud/models/email_address.rb +270 -267
- data/lib/aspose-email-cloud/models/email_client_account.rb +337 -0
- data/lib/aspose-email-cloud/models/email_client_account_credentials.rb +261 -0
- data/lib/aspose-email-cloud/models/email_client_account_oauth_credentials.rb +385 -0
- data/lib/aspose-email-cloud/models/email_client_account_password_credentials.rb +298 -0
- data/lib/aspose-email-cloud/models/email_client_multi_account.rb +233 -0
- data/lib/aspose-email-cloud/models/email_document.rb +233 -230
- data/lib/aspose-email-cloud/models/email_document_response.rb +213 -210
- data/lib/aspose-email-cloud/models/email_dto.rb +681 -678
- data/lib/aspose-email-cloud/models/email_dto_list.rb +215 -212
- data/lib/aspose-email-cloud/models/email_properties.rb +233 -230
- data/lib/aspose-email-cloud/models/email_property.rb +268 -265
- data/lib/aspose-email-cloud/models/email_property_response.rb +213 -210
- data/lib/aspose-email-cloud/models/enum_with_custom_of_associated_person_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_email_address_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_event_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_instant_messenger_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_phone_number_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_postal_address_category.rb +230 -227
- data/lib/aspose-email-cloud/models/enum_with_custom_of_url_category.rb +230 -227
- data/lib/aspose-email-cloud/models/error.rb +252 -249
- data/lib/aspose-email-cloud/models/error_details.rb +231 -228
- data/lib/aspose-email-cloud/models/file_version.rb +306 -303
- data/lib/aspose-email-cloud/models/file_versions.rb +215 -212
- data/lib/aspose-email-cloud/models/files_list.rb +215 -212
- data/lib/aspose-email-cloud/models/files_upload_result.rb +230 -227
- data/lib/aspose-email-cloud/models/hierarchical_object.rb +5 -2
- data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +231 -228
- data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +226 -223
- data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +5 -2
- data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +5 -2
- data/lib/aspose-email-cloud/models/instant_messenger_address.rb +244 -241
- data/lib/aspose-email-cloud/models/link.rb +252 -249
- data/lib/aspose-email-cloud/models/linked_resource.rb +267 -264
- data/lib/aspose-email-cloud/models/list_response_of_ai_bcr_ocr_data.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_component.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_extracted.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_gender_hypothesis.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_contact_dto.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_email_account_config.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_email_dto.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_storage_file_location.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_calendar_dto.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_contact_dto.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_email_dto.rb +214 -211
- data/lib/aspose-email-cloud/models/list_response_of_string.rb +214 -211
- data/lib/aspose-email-cloud/models/mail_address.rb +244 -241
- data/lib/aspose-email-cloud/models/mail_server_folder.rb +226 -223
- data/lib/aspose-email-cloud/models/mime_response.rb +213 -210
- data/lib/aspose-email-cloud/models/name_value_pair.rb +226 -222
- data/lib/aspose-email-cloud/models/object_exist.rb +236 -233
- data/lib/aspose-email-cloud/models/phone_number.rb +244 -241
- data/lib/aspose-email-cloud/models/postal_address.rb +353 -350
- data/lib/aspose-email-cloud/models/primitive_object.rb +5 -2
- data/lib/aspose-email-cloud/models/reminder_attendee.rb +213 -210
- data/lib/aspose-email-cloud/models/reminder_trigger.rb +249 -246
- data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +109 -109
- data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_storage_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_model_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_ocr_data_model_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_storage_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_name_complete_request_data.rb +110 -110
- data/lib/aspose-email-cloud/models/requests/ai_name_expand_parsed_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_name_expand_request_data.rb +110 -110
- data/lib/aspose-email-cloud/models/requests/ai_name_format_parsed_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_name_format_request_data.rb +116 -116
- data/lib/aspose-email-cloud/models/requests/ai_name_genderize_parsed_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_name_genderize_request_data.rb +110 -110
- data/lib/aspose-email-cloud/models/requests/ai_name_match_parsed_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/ai_name_match_request_data.rb +121 -121
- data/lib/aspose-email-cloud/models/requests/ai_name_parse_email_address_request_data.rb +110 -110
- data/lib/aspose-email-cloud/models/requests/ai_name_parse_request_data.rb +110 -110
- data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/append_email_model_message_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_alternate_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +90 -90
- data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +108 -108
- data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +102 -102
- data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +85 -85
- data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +109 -109
- data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +119 -119
- data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/discover_email_config_oauth_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/discover_email_config_password_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/discover_email_config_request_data.rb +86 -86
- data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/email_request.rb +75 -75
- data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +109 -109
- data/lib/aspose-email-cloud/models/requests/fetch_email_model_request_data.rb +109 -109
- data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +108 -108
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_as_alternate_request_data.rb +107 -107
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_list_request_data.rb +98 -98
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +111 -111
- data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +103 -103
- data/lib/aspose-email-cloud/models/requests/get_contact_model_list_request_data.rb +103 -103
- data/lib/aspose-email-cloud/models/requests/get_contact_model_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +75 -75
- data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_email_client_account_request_data.rb +102 -0
- data/lib/aspose-email-cloud/models/requests/get_email_client_multi_account_request_data.rb +102 -0
- data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +103 -103
- data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +85 -85
- data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +85 -85
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +101 -101
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +93 -93
- data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/http_request.rb +51 -51
- data/lib/aspose-email-cloud/models/requests/is_email_address_disposable_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +104 -104
- data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +127 -127
- data/lib/aspose-email-cloud/models/requests/list_email_models_request_data.rb +127 -127
- data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +108 -108
- data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +102 -102
- data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +91 -91
- data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/save_email_client_account_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/save_email_client_multi_account_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/send_email_model_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +79 -79
- data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +99 -99
- data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +89 -89
- data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +97 -97
- data/lib/aspose-email-cloud/models/save_email_account_request.rb +434 -431
- data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +521 -505
- data/lib/aspose-email-cloud/models/send_email_base_request.rb +281 -278
- data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +300 -297
- data/lib/aspose-email-cloud/models/send_email_model_rq.rb +276 -273
- data/lib/aspose-email-cloud/models/set_email_property_request.rb +231 -228
- data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +318 -315
- data/lib/aspose-email-cloud/models/storage_exist.rb +218 -215
- data/lib/aspose-email-cloud/models/storage_file.rb +275 -272
- data/lib/aspose-email-cloud/models/storage_file_location.rb +263 -260
- data/lib/aspose-email-cloud/models/storage_file_rq_of_email_client_account.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_file_rq_of_email_client_multi_account.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_folder_location.rb +226 -223
- data/lib/aspose-email-cloud/models/storage_model_of_calendar_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/storage_model_of_contact_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/storage_model_of_email_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/storage_model_rq_of_calendar_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/storage_model_rq_of_contact_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/storage_model_rq_of_email_dto.rb +225 -222
- data/lib/aspose-email-cloud/models/url.rb +244 -241
- data/lib/aspose-email-cloud/models/value_response.rb +213 -210
- data/lib/aspose-email-cloud/models/value_t_of_boolean.rb +217 -0
- data/lib/aspose-email-cloud/version.rb +1 -1
- metadata +15 -2
@@ -1,350 +1,353 @@
|
|
1
|
-
# ----------------------------------------------------------------------------
|
2
|
-
# <copyright company="Aspose" file="PostalAddress.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
|
-
# A postal address
|
31
|
-
class PostalAddress
|
32
|
-
# Address.
|
33
|
-
# @return [String]
|
34
|
-
attr_accessor :address
|
35
|
-
|
36
|
-
# Address category.
|
37
|
-
# @return [EnumWithCustomOfPostalAddressCategory]
|
38
|
-
attr_accessor :category
|
39
|
-
|
40
|
-
# Address's city.
|
41
|
-
# @return [String]
|
42
|
-
attr_accessor :city
|
43
|
-
|
44
|
-
# Address's country.
|
45
|
-
# @return [String]
|
46
|
-
attr_accessor :country
|
47
|
-
|
48
|
-
# Country code.
|
49
|
-
# @return [String]
|
50
|
-
attr_accessor :country_code
|
51
|
-
|
52
|
-
# Defines whether address may be used for mailing.
|
53
|
-
# @return [BOOLEAN]
|
54
|
-
attr_accessor :is_mailing_address
|
55
|
-
|
56
|
-
# Postal code.
|
57
|
-
# @return [String]
|
58
|
-
attr_accessor :postal_code
|
59
|
-
|
60
|
-
# Post Office box.
|
61
|
-
# @return [String]
|
62
|
-
attr_accessor :post_office_box
|
63
|
-
|
64
|
-
# Defines whether postal address is preferred.
|
65
|
-
# @return [BOOLEAN]
|
66
|
-
attr_accessor :preferred
|
67
|
-
|
68
|
-
# Address's region.
|
69
|
-
# @return [String]
|
70
|
-
attr_accessor :state_or_province
|
71
|
-
|
72
|
-
# Address's street.
|
73
|
-
# @return [String]
|
74
|
-
attr_accessor :street
|
75
|
-
|
76
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
-
def self.attribute_map
|
78
|
-
{
|
79
|
-
:'address' => :'address',
|
80
|
-
:'category' => :'category',
|
81
|
-
:'city' => :'city',
|
82
|
-
:'country' => :'country',
|
83
|
-
:'country_code' => :'countryCode',
|
84
|
-
:'is_mailing_address' => :'isMailingAddress',
|
85
|
-
:'postal_code' => :'postalCode',
|
86
|
-
:'post_office_box' => :'postOfficeBox',
|
87
|
-
:'preferred' => :'preferred',
|
88
|
-
:'state_or_province' => :'stateOrProvince',
|
89
|
-
:'street' => :'street'
|
90
|
-
}
|
91
|
-
end
|
92
|
-
|
93
|
-
# Attribute type mapping.
|
94
|
-
def self.swagger_types
|
95
|
-
{
|
96
|
-
:'address' => :'String',
|
97
|
-
:'category' => :'EnumWithCustomOfPostalAddressCategory',
|
98
|
-
:'city' => :'String',
|
99
|
-
:'country' => :'String',
|
100
|
-
:'country_code' => :'String',
|
101
|
-
:'is_mailing_address' => :'BOOLEAN',
|
102
|
-
:'postal_code' => :'String',
|
103
|
-
:'post_office_box' => :'String',
|
104
|
-
:'preferred' => :'BOOLEAN',
|
105
|
-
:'state_or_province' => :'String',
|
106
|
-
:'street' => :'String'
|
107
|
-
}
|
108
|
-
end
|
109
|
-
|
110
|
-
# Initializes the object
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
def initialize(attributes = {})
|
113
|
-
return unless attributes.is_a?(Hash)
|
114
|
-
|
115
|
-
# convert string to symbol for hash key
|
116
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
117
|
-
|
118
|
-
if attributes.has_key?(:'address')
|
119
|
-
self.address = attributes[:'address']
|
120
|
-
end
|
121
|
-
|
122
|
-
if attributes.has_key?(:'category')
|
123
|
-
self.category = attributes[:'category']
|
124
|
-
end
|
125
|
-
|
126
|
-
if attributes.has_key?(:'city')
|
127
|
-
self.city = attributes[:'city']
|
128
|
-
end
|
129
|
-
|
130
|
-
if attributes.has_key?(:'country')
|
131
|
-
self.country = attributes[:'country']
|
132
|
-
end
|
133
|
-
|
134
|
-
if attributes.has_key?(:'countryCode')
|
135
|
-
self.country_code = attributes[:'countryCode']
|
136
|
-
end
|
137
|
-
|
138
|
-
if attributes.has_key?(:'isMailingAddress')
|
139
|
-
self.is_mailing_address = attributes[:'isMailingAddress']
|
140
|
-
end
|
141
|
-
|
142
|
-
if attributes.has_key?(:'postalCode')
|
143
|
-
self.postal_code = attributes[:'postalCode']
|
144
|
-
end
|
145
|
-
|
146
|
-
if attributes.has_key?(:'postOfficeBox')
|
147
|
-
self.post_office_box = attributes[:'postOfficeBox']
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.has_key?(:'preferred')
|
151
|
-
self.preferred = attributes[:'preferred']
|
152
|
-
end
|
153
|
-
|
154
|
-
if attributes.has_key?(:'stateOrProvince')
|
155
|
-
self.state_or_province = attributes[:'stateOrProvince']
|
156
|
-
end
|
157
|
-
|
158
|
-
if attributes.has_key?(:'street')
|
159
|
-
self.street = attributes[:'street']
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
# Initializes the object
|
164
|
-
# @param [String] address Address.
|
165
|
-
# @param [EnumWithCustomOfPostalAddressCategory] category Address category.
|
166
|
-
# @param [String] city Address's city.
|
167
|
-
# @param [String] country Address's country.
|
168
|
-
# @param [String] country_code Country code.
|
169
|
-
# @param [BOOLEAN] is_mailing_address Defines whether address may be used for mailing.
|
170
|
-
# @param [String] postal_code Postal code.
|
171
|
-
# @param [String] post_office_box Post Office box.
|
172
|
-
# @param [BOOLEAN] preferred Defines whether postal address is preferred.
|
173
|
-
# @param [String] state_or_province Address's region.
|
174
|
-
# @param [String] street Address's street.
|
175
|
-
def initialize(address=nil, category=nil, city=nil, country=nil, country_code=nil, is_mailing_address=nil, postal_code=nil, post_office_box=nil, preferred=nil, state_or_province=nil, street=nil)
|
176
|
-
self.address = address if address
|
177
|
-
self.category = category if category
|
178
|
-
self.city = city if city
|
179
|
-
self.country = country if country
|
180
|
-
self.country_code = country_code if country_code
|
181
|
-
self.is_mailing_address = is_mailing_address if is_mailing_address
|
182
|
-
self.postal_code = postal_code if postal_code
|
183
|
-
self.post_office_box = post_office_box if post_office_box
|
184
|
-
self.preferred = preferred if preferred
|
185
|
-
self.state_or_province = state_or_province if state_or_province
|
186
|
-
self.street = street if street
|
187
|
-
end
|
188
|
-
|
189
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
190
|
-
# @return Array for valid properties with the reasons
|
191
|
-
def list_invalid_properties
|
192
|
-
invalid_properties = Array.new
|
193
|
-
if @is_mailing_address.nil?
|
194
|
-
invalid_properties.push('invalid value for "is_mailing_address", is_mailing_address cannot be nil.')
|
195
|
-
end
|
196
|
-
|
197
|
-
if @preferred.nil?
|
198
|
-
invalid_properties.push('invalid value for "preferred", preferred cannot be nil.')
|
199
|
-
end
|
200
|
-
|
201
|
-
invalid_properties
|
202
|
-
end
|
203
|
-
|
204
|
-
# Check to see if the all the properties in the model are valid
|
205
|
-
# @return true if the model is valid
|
206
|
-
def valid?
|
207
|
-
return false if @is_mailing_address.nil?
|
208
|
-
return false if @preferred.nil?
|
209
|
-
true
|
210
|
-
end
|
211
|
-
|
212
|
-
# Checks equality by comparing each attribute.
|
213
|
-
# @param [Object] Object to be compared
|
214
|
-
def ==(o)
|
215
|
-
return true if self.equal?(o)
|
216
|
-
self.class == o.class &&
|
217
|
-
address == o.address &&
|
218
|
-
category == o.category &&
|
219
|
-
city == o.city &&
|
220
|
-
country == o.country &&
|
221
|
-
country_code == o.country_code &&
|
222
|
-
is_mailing_address == o.is_mailing_address &&
|
223
|
-
postal_code == o.postal_code &&
|
224
|
-
post_office_box == o.post_office_box &&
|
225
|
-
preferred == o.preferred &&
|
226
|
-
state_or_province == o.state_or_province &&
|
227
|
-
street == o.street
|
228
|
-
end
|
229
|
-
|
230
|
-
# @see the `==` method
|
231
|
-
# @param [Object] Object to be compared
|
232
|
-
def eql?(o)
|
233
|
-
self == o
|
234
|
-
end
|
235
|
-
|
236
|
-
# Calculates hash code according to all attributes.
|
237
|
-
# @return [Fixnum] Hash code
|
238
|
-
def hash
|
239
|
-
[address, category, city, country, country_code, is_mailing_address, postal_code, post_office_box, preferred, state_or_province, street].hash
|
240
|
-
end
|
241
|
-
|
242
|
-
# Builds the object from hash
|
243
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
244
|
-
# @return [Object] Returns the model itself
|
245
|
-
def build_from_hash(attributes)
|
246
|
-
return nil unless attributes.is_a?(Hash)
|
247
|
-
self.class.swagger_types.each_pair do |key, type|
|
248
|
-
attribute_key = self.class.attribute_map[key]
|
249
|
-
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
250
|
-
if type =~ /\AArray<(.*)>/i
|
251
|
-
# check to ensure the input is an array given that the the attribute
|
252
|
-
# is documented as an array but the input is not
|
253
|
-
if attributes[attribute_key].is_a?(Array)
|
254
|
-
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
255
|
-
end
|
256
|
-
elsif !attributes[attribute_key].nil?
|
257
|
-
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
258
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
259
|
-
end
|
260
|
-
|
261
|
-
self
|
262
|
-
end
|
263
|
-
|
264
|
-
# Deserializes the data based on type
|
265
|
-
# @param string type Data type
|
266
|
-
# @param string value Value to be deserialized
|
267
|
-
# @return [Object] Deserialized data
|
268
|
-
def _deserialize(type, value)
|
269
|
-
case type.to_sym
|
270
|
-
when :DateTime
|
271
|
-
DateTime.parse(value)
|
272
|
-
when :Date
|
273
|
-
Date.parse(value)
|
274
|
-
when :String
|
275
|
-
value.to_s
|
276
|
-
when :Integer
|
277
|
-
value.to_i
|
278
|
-
when :Float
|
279
|
-
value.to_f
|
280
|
-
when :BOOLEAN
|
281
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
282
|
-
true
|
283
|
-
else
|
284
|
-
false
|
285
|
-
end
|
286
|
-
when :Object
|
287
|
-
# generic object (usually a Hash), return directly
|
288
|
-
value
|
289
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
290
|
-
inner_type = Regexp.last_match[:inner_type]
|
291
|
-
value.map { |v| _deserialize(inner_type, v) }
|
292
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
293
|
-
k_type = Regexp.last_match[:k_type]
|
294
|
-
v_type = Regexp.last_match[:v_type]
|
295
|
-
{}.tap do |hash|
|
296
|
-
value.each do |k, v|
|
297
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
298
|
-
end
|
299
|
-
end
|
300
|
-
else # model
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
#
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
end
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="PostalAddress.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
|
+
# A postal address
|
31
|
+
class PostalAddress
|
32
|
+
# Address.
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :address
|
35
|
+
|
36
|
+
# Address category.
|
37
|
+
# @return [EnumWithCustomOfPostalAddressCategory]
|
38
|
+
attr_accessor :category
|
39
|
+
|
40
|
+
# Address's city.
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :city
|
43
|
+
|
44
|
+
# Address's country.
|
45
|
+
# @return [String]
|
46
|
+
attr_accessor :country
|
47
|
+
|
48
|
+
# Country code.
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :country_code
|
51
|
+
|
52
|
+
# Defines whether address may be used for mailing.
|
53
|
+
# @return [BOOLEAN]
|
54
|
+
attr_accessor :is_mailing_address
|
55
|
+
|
56
|
+
# Postal code.
|
57
|
+
# @return [String]
|
58
|
+
attr_accessor :postal_code
|
59
|
+
|
60
|
+
# Post Office box.
|
61
|
+
# @return [String]
|
62
|
+
attr_accessor :post_office_box
|
63
|
+
|
64
|
+
# Defines whether postal address is preferred.
|
65
|
+
# @return [BOOLEAN]
|
66
|
+
attr_accessor :preferred
|
67
|
+
|
68
|
+
# Address's region.
|
69
|
+
# @return [String]
|
70
|
+
attr_accessor :state_or_province
|
71
|
+
|
72
|
+
# Address's street.
|
73
|
+
# @return [String]
|
74
|
+
attr_accessor :street
|
75
|
+
|
76
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
+
def self.attribute_map
|
78
|
+
{
|
79
|
+
:'address' => :'address',
|
80
|
+
:'category' => :'category',
|
81
|
+
:'city' => :'city',
|
82
|
+
:'country' => :'country',
|
83
|
+
:'country_code' => :'countryCode',
|
84
|
+
:'is_mailing_address' => :'isMailingAddress',
|
85
|
+
:'postal_code' => :'postalCode',
|
86
|
+
:'post_office_box' => :'postOfficeBox',
|
87
|
+
:'preferred' => :'preferred',
|
88
|
+
:'state_or_province' => :'stateOrProvince',
|
89
|
+
:'street' => :'street'
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
# Attribute type mapping.
|
94
|
+
def self.swagger_types
|
95
|
+
{
|
96
|
+
:'address' => :'String',
|
97
|
+
:'category' => :'EnumWithCustomOfPostalAddressCategory',
|
98
|
+
:'city' => :'String',
|
99
|
+
:'country' => :'String',
|
100
|
+
:'country_code' => :'String',
|
101
|
+
:'is_mailing_address' => :'BOOLEAN',
|
102
|
+
:'postal_code' => :'String',
|
103
|
+
:'post_office_box' => :'String',
|
104
|
+
:'preferred' => :'BOOLEAN',
|
105
|
+
:'state_or_province' => :'String',
|
106
|
+
:'street' => :'String'
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
# Initializes the object
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
def initialize(attributes = {})
|
113
|
+
return unless attributes.is_a?(Hash)
|
114
|
+
|
115
|
+
# convert string to symbol for hash key
|
116
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
117
|
+
|
118
|
+
if attributes.has_key?(:'address')
|
119
|
+
self.address = attributes[:'address']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'category')
|
123
|
+
self.category = attributes[:'category']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'city')
|
127
|
+
self.city = attributes[:'city']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.has_key?(:'country')
|
131
|
+
self.country = attributes[:'country']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'countryCode')
|
135
|
+
self.country_code = attributes[:'countryCode']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'isMailingAddress')
|
139
|
+
self.is_mailing_address = attributes[:'isMailingAddress']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'postalCode')
|
143
|
+
self.postal_code = attributes[:'postalCode']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.has_key?(:'postOfficeBox')
|
147
|
+
self.post_office_box = attributes[:'postOfficeBox']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.has_key?(:'preferred')
|
151
|
+
self.preferred = attributes[:'preferred']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.has_key?(:'stateOrProvince')
|
155
|
+
self.state_or_province = attributes[:'stateOrProvince']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.has_key?(:'street')
|
159
|
+
self.street = attributes[:'street']
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# Initializes the object
|
164
|
+
# @param [String] address Address.
|
165
|
+
# @param [EnumWithCustomOfPostalAddressCategory] category Address category.
|
166
|
+
# @param [String] city Address's city.
|
167
|
+
# @param [String] country Address's country.
|
168
|
+
# @param [String] country_code Country code.
|
169
|
+
# @param [BOOLEAN] is_mailing_address Defines whether address may be used for mailing.
|
170
|
+
# @param [String] postal_code Postal code.
|
171
|
+
# @param [String] post_office_box Post Office box.
|
172
|
+
# @param [BOOLEAN] preferred Defines whether postal address is preferred.
|
173
|
+
# @param [String] state_or_province Address's region.
|
174
|
+
# @param [String] street Address's street.
|
175
|
+
def initialize(address=nil, category=nil, city=nil, country=nil, country_code=nil, is_mailing_address=nil, postal_code=nil, post_office_box=nil, preferred=nil, state_or_province=nil, street=nil)
|
176
|
+
self.address = address if address
|
177
|
+
self.category = category if category
|
178
|
+
self.city = city if city
|
179
|
+
self.country = country if country
|
180
|
+
self.country_code = country_code if country_code
|
181
|
+
self.is_mailing_address = is_mailing_address if is_mailing_address
|
182
|
+
self.postal_code = postal_code if postal_code
|
183
|
+
self.post_office_box = post_office_box if post_office_box
|
184
|
+
self.preferred = preferred if preferred
|
185
|
+
self.state_or_province = state_or_province if state_or_province
|
186
|
+
self.street = street if street
|
187
|
+
end
|
188
|
+
|
189
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
190
|
+
# @return Array for valid properties with the reasons
|
191
|
+
def list_invalid_properties
|
192
|
+
invalid_properties = Array.new
|
193
|
+
if @is_mailing_address.nil?
|
194
|
+
invalid_properties.push('invalid value for "is_mailing_address", is_mailing_address cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @preferred.nil?
|
198
|
+
invalid_properties.push('invalid value for "preferred", preferred cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
invalid_properties
|
202
|
+
end
|
203
|
+
|
204
|
+
# Check to see if the all the properties in the model are valid
|
205
|
+
# @return true if the model is valid
|
206
|
+
def valid?
|
207
|
+
return false if @is_mailing_address.nil?
|
208
|
+
return false if @preferred.nil?
|
209
|
+
true
|
210
|
+
end
|
211
|
+
|
212
|
+
# Checks equality by comparing each attribute.
|
213
|
+
# @param [Object] Object to be compared
|
214
|
+
def ==(o)
|
215
|
+
return true if self.equal?(o)
|
216
|
+
self.class == o.class &&
|
217
|
+
address == o.address &&
|
218
|
+
category == o.category &&
|
219
|
+
city == o.city &&
|
220
|
+
country == o.country &&
|
221
|
+
country_code == o.country_code &&
|
222
|
+
is_mailing_address == o.is_mailing_address &&
|
223
|
+
postal_code == o.postal_code &&
|
224
|
+
post_office_box == o.post_office_box &&
|
225
|
+
preferred == o.preferred &&
|
226
|
+
state_or_province == o.state_or_province &&
|
227
|
+
street == o.street
|
228
|
+
end
|
229
|
+
|
230
|
+
# @see the `==` method
|
231
|
+
# @param [Object] Object to be compared
|
232
|
+
def eql?(o)
|
233
|
+
self == o
|
234
|
+
end
|
235
|
+
|
236
|
+
# Calculates hash code according to all attributes.
|
237
|
+
# @return [Fixnum] Hash code
|
238
|
+
def hash
|
239
|
+
[address, category, city, country, country_code, is_mailing_address, postal_code, post_office_box, preferred, state_or_province, street].hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Builds the object from hash
|
243
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
244
|
+
# @return [Object] Returns the model itself
|
245
|
+
def build_from_hash(attributes)
|
246
|
+
return nil unless attributes.is_a?(Hash)
|
247
|
+
self.class.swagger_types.each_pair do |key, type|
|
248
|
+
attribute_key = self.class.attribute_map[key]
|
249
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
250
|
+
if type =~ /\AArray<(.*)>/i
|
251
|
+
# check to ensure the input is an array given that the the attribute
|
252
|
+
# is documented as an array but the input is not
|
253
|
+
if attributes[attribute_key].is_a?(Array)
|
254
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
255
|
+
end
|
256
|
+
elsif !attributes[attribute_key].nil?
|
257
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
258
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
259
|
+
end
|
260
|
+
|
261
|
+
self
|
262
|
+
end
|
263
|
+
|
264
|
+
# Deserializes the data based on type
|
265
|
+
# @param string type Data type
|
266
|
+
# @param string value Value to be deserialized
|
267
|
+
# @return [Object] Deserialized data
|
268
|
+
def _deserialize(type, value)
|
269
|
+
case type.to_sym
|
270
|
+
when :DateTime
|
271
|
+
DateTime.parse(value)
|
272
|
+
when :Date
|
273
|
+
Date.parse(value)
|
274
|
+
when :String
|
275
|
+
value.to_s
|
276
|
+
when :Integer
|
277
|
+
value.to_i
|
278
|
+
when :Float
|
279
|
+
value.to_f
|
280
|
+
when :BOOLEAN
|
281
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
282
|
+
true
|
283
|
+
else
|
284
|
+
false
|
285
|
+
end
|
286
|
+
when :Object
|
287
|
+
# generic object (usually a Hash), return directly
|
288
|
+
value
|
289
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
290
|
+
inner_type = Regexp.last_match[:inner_type]
|
291
|
+
value.map { |v| _deserialize(inner_type, v) }
|
292
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
293
|
+
k_type = Regexp.last_match[:k_type]
|
294
|
+
v_type = Regexp.last_match[:v_type]
|
295
|
+
{}.tap do |hash|
|
296
|
+
value.each do |k, v|
|
297
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
298
|
+
end
|
299
|
+
end
|
300
|
+
else # model
|
301
|
+
sub_type = value[:type] || value[:discriminator] || type
|
302
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
303
|
+
type = sub_type
|
304
|
+
end
|
305
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
306
|
+
temp_model.build_from_hash(value)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
# Returns the string representation of the object
|
311
|
+
# @return [String] String presentation of the object
|
312
|
+
def to_s
|
313
|
+
to_hash.to_s
|
314
|
+
end
|
315
|
+
|
316
|
+
# to_body is an alias to to_hash (backward compatibility)
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
318
|
+
def to_body
|
319
|
+
to_hash
|
320
|
+
end
|
321
|
+
|
322
|
+
# Returns the object in the form of hash
|
323
|
+
# @return [Hash] Returns the object in the form of hash
|
324
|
+
def to_hash
|
325
|
+
hash = {}
|
326
|
+
self.class.attribute_map.each_pair do |attr, param|
|
327
|
+
value = self.send(attr)
|
328
|
+
next if value.nil?
|
329
|
+
hash[param] = _to_hash(value)
|
330
|
+
end
|
331
|
+
hash
|
332
|
+
end
|
333
|
+
|
334
|
+
# Outputs non-array value in the form of hash
|
335
|
+
# For object, use to_hash. Otherwise, just return the value
|
336
|
+
# @param [Object] value Any valid value
|
337
|
+
# @return [Hash] Returns the value in the form of hash
|
338
|
+
def _to_hash(value)
|
339
|
+
if value.is_a?(Array)
|
340
|
+
value.compact.map { |v| _to_hash(v) }
|
341
|
+
elsif value.is_a?(Hash)
|
342
|
+
{}.tap do |hash|
|
343
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
344
|
+
end
|
345
|
+
elsif value.respond_to? :to_hash
|
346
|
+
value.to_hash
|
347
|
+
else
|
348
|
+
value
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
end
|
353
|
+
end
|