aspose_email_cloud 19.11.0 → 20.5.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 +155 -2
- data/lib/aspose-email-cloud/api/email_api.rb +1039 -577
- data/lib/aspose-email-cloud/api_client.rb +385 -381
- data/lib/aspose-email-cloud/api_error.rb +41 -41
- data/lib/aspose-email-cloud/configuration.rb +240 -236
- data/lib/aspose-email-cloud/models/account_base_request.rb +154 -141
- data/lib/aspose-email-cloud/models/add_attachment_request.rb +150 -143
- data/lib/aspose-email-cloud/models/ai_bcr_base64_image.rb +231 -0
- data/lib/aspose-email-cloud/models/ai_bcr_base64_rq.rb +228 -0
- data/lib/aspose-email-cloud/models/ai_bcr_image.rb +218 -0
- data/lib/aspose-email-cloud/models/ai_bcr_image_storage_file.rb +231 -0
- data/lib/aspose-email-cloud/models/ai_bcr_ocr_data.rb +256 -0
- data/lib/aspose-email-cloud/models/ai_bcr_ocr_data_part.rb +300 -0
- data/lib/aspose-email-cloud/models/ai_bcr_options.rb +226 -0
- data/lib/aspose-email-cloud/models/ai_bcr_parse_ocr_data_rq.rb +233 -0
- data/lib/aspose-email-cloud/models/ai_bcr_parse_storage_rq.rb +251 -0
- data/lib/aspose-email-cloud/models/ai_bcr_rq.rb +213 -0
- data/lib/aspose-email-cloud/models/ai_bcr_storage_image_rq.rb +233 -0
- data/lib/aspose-email-cloud/models/ai_name_component.rb +267 -0
- data/lib/aspose-email-cloud/models/ai_name_cultural_context.rb +270 -0
- data/lib/aspose-email-cloud/models/ai_name_extracted.rb +233 -0
- data/lib/aspose-email-cloud/models/ai_name_extracted_component.rb +231 -0
- data/lib/aspose-email-cloud/models/ai_name_formatted.rb +226 -0
- data/lib/aspose-email-cloud/models/ai_name_gender_hypothesis.rb +236 -0
- data/lib/aspose-email-cloud/models/ai_name_match_result.rb +233 -0
- data/lib/aspose-email-cloud/models/ai_name_mismatch.rb +249 -0
- data/lib/aspose-email-cloud/models/ai_name_parsed_match_rq.rb +266 -0
- data/lib/aspose-email-cloud/models/ai_name_parsed_rq.rb +246 -0
- data/lib/aspose-email-cloud/models/ai_name_weighted.rb +231 -0
- data/lib/aspose-email-cloud/models/ai_name_weighted_variants.rb +228 -0
- data/lib/aspose-email-cloud/models/alternate_view.rb +282 -0
- data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +162 -144
- data/lib/aspose-email-cloud/models/append_email_base_request.rb +167 -147
- data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +166 -146
- data/lib/aspose-email-cloud/models/append_email_model_rq.rb +336 -0
- data/lib/aspose-email-cloud/models/associated_person.rb +244 -0
- data/lib/aspose-email-cloud/models/attachment.rb +324 -0
- data/lib/aspose-email-cloud/models/attachment_base.rb +254 -0
- data/lib/aspose-email-cloud/models/base_object.rb +91 -84
- data/lib/aspose-email-cloud/models/calendar_dto.rb +557 -0
- data/lib/aspose-email-cloud/models/calendar_dto_alternate_rq.rb +268 -0
- data/lib/aspose-email-cloud/models/calendar_dto_list.rb +215 -0
- data/lib/aspose-email-cloud/models/calendar_reminder.rb +318 -0
- data/lib/aspose-email-cloud/models/contact_dto.rb +699 -0
- data/lib/aspose-email-cloud/models/contact_dto_list.rb +215 -0
- data/lib/aspose-email-cloud/models/contact_photo.rb +231 -0
- data/lib/aspose-email-cloud/models/content_type.rb +267 -0
- data/lib/aspose-email-cloud/models/content_type_parameter.rb +226 -0
- data/lib/aspose-email-cloud/models/create_email_request.rb +150 -143
- data/lib/aspose-email-cloud/models/create_folder_base_request.rb +162 -146
- data/lib/aspose-email-cloud/models/customer_event.rb +231 -0
- data/lib/aspose-email-cloud/models/delete_email_thread_account_rq.rb +276 -0
- data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +162 -146
- data/lib/aspose-email-cloud/models/delete_message_base_request.rb +177 -148
- data/lib/aspose-email-cloud/models/disc_usage.rb +149 -143
- data/lib/aspose-email-cloud/models/discover_email_config_oauth.rb +391 -0
- data/lib/aspose-email-cloud/models/discover_email_config_password.rb +304 -0
- data/lib/aspose-email-cloud/models/discover_email_config_rq.rb +268 -0
- data/lib/aspose-email-cloud/models/email_account_config.rb +323 -0
- data/lib/aspose-email-cloud/models/email_account_config_list.rb +215 -0
- data/lib/aspose-email-cloud/models/email_account_request.rb +210 -155
- data/lib/aspose-email-cloud/models/email_address.rb +283 -0
- data/lib/aspose-email-cloud/models/email_client_account.rb +350 -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 +150 -143
- data/lib/aspose-email-cloud/models/email_document_response.rb +146 -141
- data/lib/aspose-email-cloud/models/email_dto.rb +681 -0
- data/lib/aspose-email-cloud/models/email_dto_list.rb +215 -0
- data/lib/aspose-email-cloud/models/email_properties.rb +150 -142
- data/lib/aspose-email-cloud/models/email_property.rb +154 -142
- data/lib/aspose-email-cloud/models/email_property_response.rb +146 -141
- data/lib/aspose-email-cloud/models/email_thread.rb +254 -0
- data/lib/aspose-email-cloud/models/email_thread_list.rb +215 -0
- data/lib/aspose-email-cloud/models/email_thread_read_flag_rq.rb +294 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_associated_person_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_email_address_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_event_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_instant_messenger_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_phone_number_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_postal_address_category.rb +230 -0
- data/lib/aspose-email-cloud/models/enum_with_custom_of_url_category.rb +230 -0
- data/lib/aspose-email-cloud/models/error.rb +157 -147
- data/lib/aspose-email-cloud/models/error_details.rb +149 -143
- data/lib/aspose-email-cloud/models/file_version.rb +169 -153
- data/lib/aspose-email-cloud/models/file_versions.rb +145 -141
- data/lib/aspose-email-cloud/models/files_list.rb +145 -141
- data/lib/aspose-email-cloud/models/files_upload_result.rb +149 -143
- data/lib/aspose-email-cloud/models/hierarchical_object.rb +106 -97
- data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +150 -143
- data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +150 -143
- data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +124 -113
- data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +122 -111
- data/lib/aspose-email-cloud/models/instant_messenger_address.rb +244 -0
- data/lib/aspose-email-cloud/models/link.rb +158 -147
- data/lib/aspose-email-cloud/models/linked_resource.rb +267 -0
- data/lib/aspose-email-cloud/models/list_response_of_ai_bcr_ocr_data.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_component.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_extracted.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_ai_name_gender_hypothesis.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_contact_dto.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_email_account_config.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_email_dto.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_email_thread.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +145 -139
- data/lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb +145 -139
- data/lib/aspose-email-cloud/models/list_response_of_storage_file_location.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_calendar_dto.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_contact_dto.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_storage_model_of_email_dto.rb +214 -0
- data/lib/aspose-email-cloud/models/list_response_of_string.rb +145 -139
- data/lib/aspose-email-cloud/models/mail_address.rb +257 -0
- data/lib/aspose-email-cloud/models/mail_server_folder.rb +150 -143
- data/lib/aspose-email-cloud/models/mime_response.rb +146 -141
- data/lib/aspose-email-cloud/models/move_email_message_rq.rb +302 -0
- data/lib/aspose-email-cloud/models/move_email_thread_rq.rb +276 -0
- data/lib/aspose-email-cloud/models/name_value_pair.rb +226 -0
- data/lib/aspose-email-cloud/models/object_exist.rb +149 -143
- data/lib/aspose-email-cloud/models/phone_number.rb +244 -0
- data/lib/aspose-email-cloud/models/postal_address.rb +353 -0
- data/lib/aspose-email-cloud/models/primitive_object.rb +104 -95
- data/lib/aspose-email-cloud/models/reminder_attendee.rb +213 -0
- data/lib/aspose-email-cloud/models/reminder_trigger.rb +249 -0
- data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +99 -89
- data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +109 -101
- data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +99 -89
- data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +99 -89
- data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_storage_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_ocr_data_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_storage_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_complete_request_data.rb +110 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_expand_parsed_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_expand_request_data.rb +110 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_format_parsed_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_format_request_data.rb +116 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_genderize_parsed_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_genderize_request_data.rb +110 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_match_parsed_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_match_request_data.rb +121 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_parse_email_address_request_data.rb +110 -0
- data/lib/aspose-email-cloud/models/requests/ai_name_parse_request_data.rb +110 -0
- data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/append_email_model_message_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_alternate_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/convert_calendar_request_data.rb +90 -0
- data/lib/aspose-email-cloud/models/requests/convert_contact_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/convert_contact_request_data.rb +100 -0
- data/lib/aspose-email-cloud/models/requests/convert_email_model_to_file_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +90 -0
- data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +107 -92
- data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +101 -89
- data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +99 -94
- data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +84 -78
- data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +109 -96
- data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +119 -108
- data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/delete_email_thread_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +90 -81
- data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +90 -81
- data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +99 -89
- data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/discover_email_config_oauth_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/discover_email_config_password_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/discover_email_config_request_data.rb +86 -0
- data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +90 -81
- 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 +115 -93
- data/lib/aspose-email-cloud/models/requests/fetch_email_model_request_data.rb +115 -0
- data/lib/aspose-email-cloud/models/requests/fetch_email_thread_messages_request_data.rb +114 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_as_file_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +101 -88
- data/lib/aspose-email-cloud/models/requests/get_calendar_file_as_model_request_data.rb +80 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +108 -95
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_as_alternate_request_data.rb +107 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_list_request_data.rb +98 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_model_request_data.rb +91 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +91 -81
- data/lib/aspose-email-cloud/models/requests/get_contact_as_file_request_data.rb +111 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +111 -100
- data/lib/aspose-email-cloud/models/requests/get_contact_file_as_model_request_data.rb +90 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +103 -92
- data/lib/aspose-email-cloud/models/requests/get_contact_model_list_request_data.rb +103 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_model_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +101 -93
- data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +74 -71
- data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +101 -88
- 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_file_as_model_request_data.rb +80 -0
- data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +103 -0
- data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +101 -88
- data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +91 -81
- data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +84 -78
- data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +84 -78
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +101 -88
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +91 -81
- data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +93 -80
- data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +91 -81
- 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 -88
- data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +127 -105
- data/lib/aspose-email-cloud/models/requests/list_email_models_request_data.rb +122 -0
- data/lib/aspose-email-cloud/models/requests/list_email_threads_request_data.rb +121 -0
- data/lib/aspose-email-cloud/models/requests/move_email_message_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/move_email_thread_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +107 -92
- data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +101 -89
- data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +90 -81
- data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +99 -0
- 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 -0
- data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/send_email_model_request_data.rb +79 -0
- data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +99 -89
- data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +79 -75
- data/lib/aspose-email-cloud/models/requests/set_email_thread_read_flag_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +78 -75
- data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +99 -94
- data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +89 -82
- data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +96 -87
- data/lib/aspose-email-cloud/models/save_email_account_request.rb +214 -157
- data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +240 -166
- data/lib/aspose-email-cloud/models/send_email_base_request.rb +159 -145
- data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +158 -144
- data/lib/aspose-email-cloud/models/send_email_model_rq.rb +276 -0
- data/lib/aspose-email-cloud/models/set_email_property_request.rb +150 -143
- data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +162 -146
- data/lib/aspose-email-cloud/models/storage_exist.rb +145 -141
- data/lib/aspose-email-cloud/models/storage_file.rb +161 -149
- data/lib/aspose-email-cloud/models/storage_file_location.rb +154 -145
- 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 +150 -143
- data/lib/aspose-email-cloud/models/storage_model_of_calendar_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_of_contact_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_of_email_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_rq_of_calendar_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_rq_of_contact_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/storage_model_rq_of_email_dto.rb +225 -0
- data/lib/aspose-email-cloud/models/url.rb +244 -0
- data/lib/aspose-email-cloud/models/value_response.rb +146 -141
- data/lib/aspose-email-cloud/models/value_t_of_boolean.rb +217 -0
- data/lib/aspose-email-cloud/version.rb +15 -15
- metadata +206 -53
- data/lib/aspose-email-cloud/models/contact_format.rb +0 -45
@@ -1,42 +1,52 @@
|
|
1
|
-
# ----------------------------------------------------------------------------
|
2
|
-
# <copyright company="Aspose" file="AppendEmailAccountBaseRequest.rb">
|
3
|
-
# Copyright (c) 2018-
|
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
|
-
# Append email to account request
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="AppendEmailAccountBaseRequest.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
|
+
# Append email to account request
|
31
31
|
class AppendEmailAccountBaseRequest
|
32
|
+
# First account storage file name
|
33
|
+
# @return [String]
|
32
34
|
attr_accessor :first_account
|
33
35
|
|
36
|
+
# Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
|
37
|
+
# @return [String]
|
34
38
|
attr_accessor :second_account
|
35
39
|
|
40
|
+
# Storage folder location of account files
|
41
|
+
# @return [StorageFolderLocation]
|
36
42
|
attr_accessor :storage_folder
|
37
43
|
|
44
|
+
# Email account folder to store a message
|
45
|
+
# @return [String]
|
38
46
|
attr_accessor :folder
|
39
47
|
|
48
|
+
# Mark message as sent
|
49
|
+
# @return [BOOLEAN]
|
40
50
|
attr_accessor :mark_as_sent
|
41
51
|
|
42
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -91,12 +101,17 @@ module AsposeEmailCloud
|
|
91
101
|
end
|
92
102
|
|
93
103
|
# Initializes the object
|
104
|
+
# @param [String] first_account First account storage file name
|
105
|
+
# @param [String] second_account Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
|
106
|
+
# @param [StorageFolderLocation] storage_folder Storage folder location of account files
|
107
|
+
# @param [String] folder Email account folder to store a message
|
108
|
+
# @param [BOOLEAN] mark_as_sent Mark message as sent
|
94
109
|
def initialize(first_account=nil, second_account=nil, storage_folder=nil, folder=nil, mark_as_sent=nil)
|
95
|
-
self.first_account = first_account
|
96
|
-
self.second_account = second_account
|
97
|
-
self.storage_folder = storage_folder
|
98
|
-
self.folder = folder
|
99
|
-
self.mark_as_sent = mark_as_sent
|
110
|
+
self.first_account = first_account if first_account
|
111
|
+
self.second_account = second_account if second_account
|
112
|
+
self.storage_folder = storage_folder if storage_folder
|
113
|
+
self.folder = folder if folder
|
114
|
+
self.mark_as_sent = mark_as_sent if mark_as_sent
|
100
115
|
end
|
101
116
|
|
102
117
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -189,112 +204,115 @@ module AsposeEmailCloud
|
|
189
204
|
[first_account, second_account, storage_folder, folder, mark_as_sent].hash
|
190
205
|
end
|
191
206
|
|
192
|
-
# Builds the object from hash
|
193
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
-
# @return [Object] Returns the model itself
|
195
|
-
def build_from_hash(attributes)
|
196
|
-
return nil unless attributes.is_a?(Hash)
|
197
|
-
self.class.swagger_types.each_pair do |key, type|
|
198
|
-
attribute_key = self.class.attribute_map[key]
|
199
|
-
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
200
|
-
if type =~ /\AArray<(.*)>/i
|
201
|
-
# check to ensure the input is an array given that the the attribute
|
202
|
-
# is documented as an array but the input is not
|
203
|
-
if attributes[attribute_key].is_a?(Array)
|
204
|
-
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
205
|
-
end
|
206
|
-
elsif !attributes[attribute_key].nil?
|
207
|
-
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
208
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
209
|
-
end
|
210
|
-
|
211
|
-
self
|
212
|
-
end
|
213
|
-
|
214
|
-
# Deserializes the data based on type
|
215
|
-
# @param string type Data type
|
216
|
-
# @param string value Value to be deserialized
|
217
|
-
# @return [Object] Deserialized data
|
218
|
-
def _deserialize(type, value)
|
219
|
-
case type.to_sym
|
220
|
-
when :DateTime
|
221
|
-
DateTime.parse(value)
|
222
|
-
when :Date
|
223
|
-
Date.parse(value)
|
224
|
-
when :String
|
225
|
-
value.to_s
|
226
|
-
when :Integer
|
227
|
-
value.to_i
|
228
|
-
when :Float
|
229
|
-
value.to_f
|
230
|
-
when :BOOLEAN
|
231
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
232
|
-
true
|
233
|
-
else
|
234
|
-
false
|
235
|
-
end
|
236
|
-
when :Object
|
237
|
-
# generic object (usually a Hash), return directly
|
238
|
-
value
|
239
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
240
|
-
inner_type = Regexp.last_match[:inner_type]
|
241
|
-
value.map { |v| _deserialize(inner_type, v) }
|
242
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
243
|
-
k_type = Regexp.last_match[:k_type]
|
244
|
-
v_type = Regexp.last_match[:v_type]
|
245
|
-
{}.tap do |hash|
|
246
|
-
value.each do |k, v|
|
247
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
248
|
-
end
|
249
|
-
end
|
250
|
-
else # model
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
#
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
end
|
207
|
+
# Builds the object from hash
|
208
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
209
|
+
# @return [Object] Returns the model itself
|
210
|
+
def build_from_hash(attributes)
|
211
|
+
return nil unless attributes.is_a?(Hash)
|
212
|
+
self.class.swagger_types.each_pair do |key, type|
|
213
|
+
attribute_key = self.class.attribute_map[key]
|
214
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
215
|
+
if type =~ /\AArray<(.*)>/i
|
216
|
+
# check to ensure the input is an array given that the the attribute
|
217
|
+
# is documented as an array but the input is not
|
218
|
+
if attributes[attribute_key].is_a?(Array)
|
219
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
220
|
+
end
|
221
|
+
elsif !attributes[attribute_key].nil?
|
222
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
223
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
224
|
+
end
|
225
|
+
|
226
|
+
self
|
227
|
+
end
|
228
|
+
|
229
|
+
# Deserializes the data based on type
|
230
|
+
# @param string type Data type
|
231
|
+
# @param string value Value to be deserialized
|
232
|
+
# @return [Object] Deserialized data
|
233
|
+
def _deserialize(type, value)
|
234
|
+
case type.to_sym
|
235
|
+
when :DateTime
|
236
|
+
DateTime.parse(value)
|
237
|
+
when :Date
|
238
|
+
Date.parse(value)
|
239
|
+
when :String
|
240
|
+
value.to_s
|
241
|
+
when :Integer
|
242
|
+
value.to_i
|
243
|
+
when :Float
|
244
|
+
value.to_f
|
245
|
+
when :BOOLEAN
|
246
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
247
|
+
true
|
248
|
+
else
|
249
|
+
false
|
250
|
+
end
|
251
|
+
when :Object
|
252
|
+
# generic object (usually a Hash), return directly
|
253
|
+
value
|
254
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
255
|
+
inner_type = Regexp.last_match[:inner_type]
|
256
|
+
value.map { |v| _deserialize(inner_type, v) }
|
257
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
258
|
+
k_type = Regexp.last_match[:k_type]
|
259
|
+
v_type = Regexp.last_match[:v_type]
|
260
|
+
{}.tap do |hash|
|
261
|
+
value.each do |k, v|
|
262
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
else # model
|
266
|
+
sub_type = value[:type] || value[:discriminator] || type
|
267
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
268
|
+
type = sub_type
|
269
|
+
end
|
270
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
271
|
+
temp_model.build_from_hash(value)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
# Returns the string representation of the object
|
276
|
+
# @return [String] String presentation of the object
|
277
|
+
def to_s
|
278
|
+
to_hash.to_s
|
279
|
+
end
|
280
|
+
|
281
|
+
# to_body is an alias to to_hash (backward compatibility)
|
282
|
+
# @return [Hash] Returns the object in the form of hash
|
283
|
+
def to_body
|
284
|
+
to_hash
|
285
|
+
end
|
286
|
+
|
287
|
+
# Returns the object in the form of hash
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
289
|
+
def to_hash
|
290
|
+
hash = {}
|
291
|
+
self.class.attribute_map.each_pair do |attr, param|
|
292
|
+
value = self.send(attr)
|
293
|
+
next if value.nil?
|
294
|
+
hash[param] = _to_hash(value)
|
295
|
+
end
|
296
|
+
hash
|
297
|
+
end
|
298
|
+
|
299
|
+
# Outputs non-array value in the form of hash
|
300
|
+
# For object, use to_hash. Otherwise, just return the value
|
301
|
+
# @param [Object] value Any valid value
|
302
|
+
# @return [Hash] Returns the value in the form of hash
|
303
|
+
def _to_hash(value)
|
304
|
+
if value.is_a?(Array)
|
305
|
+
value.compact.map { |v| _to_hash(v) }
|
306
|
+
elsif value.is_a?(Hash)
|
307
|
+
{}.tap do |hash|
|
308
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
309
|
+
end
|
310
|
+
elsif value.respond_to? :to_hash
|
311
|
+
value.to_hash
|
312
|
+
else
|
313
|
+
value
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
end
|
318
|
+
end
|
@@ -1,45 +1,56 @@
|
|
1
|
-
# ----------------------------------------------------------------------------
|
2
|
-
# <copyright company="Aspose" file="AppendEmailBaseRequest.rb">
|
3
|
-
# Copyright (c) 2018-
|
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
|
-
# Append email from storage file to account request
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="AppendEmailBaseRequest.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
|
+
# Append email from storage file to account request
|
31
31
|
class AppendEmailBaseRequest
|
32
|
+
# First account storage file name
|
33
|
+
# @return [String]
|
32
34
|
attr_accessor :first_account
|
33
35
|
|
36
|
+
# Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
|
37
|
+
# @return [String]
|
34
38
|
attr_accessor :second_account
|
35
39
|
|
40
|
+
# Storage folder location of account files
|
41
|
+
# @return [StorageFolderLocation]
|
36
42
|
attr_accessor :storage_folder
|
37
43
|
|
44
|
+
# Email account folder to store a message
|
45
|
+
# @return [String]
|
38
46
|
attr_accessor :folder
|
39
47
|
|
48
|
+
# Mark message as sent
|
49
|
+
# @return [BOOLEAN]
|
40
50
|
attr_accessor :mark_as_sent
|
41
51
|
|
42
|
-
# Email document file location in storage
|
52
|
+
# Email document file location in storage
|
53
|
+
# @return [Object]
|
43
54
|
attr_accessor :email_file
|
44
55
|
|
45
56
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -62,7 +73,7 @@ module AsposeEmailCloud
|
|
62
73
|
:'storage_folder' => :'StorageFolderLocation',
|
63
74
|
:'folder' => :'String',
|
64
75
|
:'mark_as_sent' => :'BOOLEAN',
|
65
|
-
:'email_file' => :'
|
76
|
+
:'email_file' => :'Object'
|
66
77
|
}
|
67
78
|
end
|
68
79
|
|
@@ -100,13 +111,19 @@ module AsposeEmailCloud
|
|
100
111
|
end
|
101
112
|
|
102
113
|
# Initializes the object
|
114
|
+
# @param [String] first_account First account storage file name
|
115
|
+
# @param [String] second_account Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
|
116
|
+
# @param [StorageFolderLocation] storage_folder Storage folder location of account files
|
117
|
+
# @param [String] folder Email account folder to store a message
|
118
|
+
# @param [BOOLEAN] mark_as_sent Mark message as sent
|
119
|
+
# @param [Object] email_file Email document file location in storage
|
103
120
|
def initialize(first_account=nil, second_account=nil, storage_folder=nil, folder=nil, mark_as_sent=nil, email_file=nil)
|
104
|
-
self.first_account = first_account
|
105
|
-
self.second_account = second_account
|
106
|
-
self.storage_folder = storage_folder
|
107
|
-
self.folder = folder
|
108
|
-
self.mark_as_sent = mark_as_sent
|
109
|
-
self.email_file = email_file
|
121
|
+
self.first_account = first_account if first_account
|
122
|
+
self.second_account = second_account if second_account
|
123
|
+
self.storage_folder = storage_folder if storage_folder
|
124
|
+
self.folder = folder if folder
|
125
|
+
self.mark_as_sent = mark_as_sent if mark_as_sent
|
126
|
+
self.email_file = email_file if email_file
|
110
127
|
end
|
111
128
|
|
112
129
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -205,112 +222,115 @@ module AsposeEmailCloud
|
|
205
222
|
[first_account, second_account, storage_folder, folder, mark_as_sent, email_file].hash
|
206
223
|
end
|
207
224
|
|
208
|
-
# Builds the object from hash
|
209
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
210
|
-
# @return [Object] Returns the model itself
|
211
|
-
def build_from_hash(attributes)
|
212
|
-
return nil unless attributes.is_a?(Hash)
|
213
|
-
self.class.swagger_types.each_pair do |key, type|
|
214
|
-
attribute_key = self.class.attribute_map[key]
|
215
|
-
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
216
|
-
if type =~ /\AArray<(.*)>/i
|
217
|
-
# check to ensure the input is an array given that the the attribute
|
218
|
-
# is documented as an array but the input is not
|
219
|
-
if attributes[attribute_key].is_a?(Array)
|
220
|
-
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
221
|
-
end
|
222
|
-
elsif !attributes[attribute_key].nil?
|
223
|
-
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
224
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
225
|
-
end
|
226
|
-
|
227
|
-
self
|
228
|
-
end
|
229
|
-
|
230
|
-
# Deserializes the data based on type
|
231
|
-
# @param string type Data type
|
232
|
-
# @param string value Value to be deserialized
|
233
|
-
# @return [Object] Deserialized data
|
234
|
-
def _deserialize(type, value)
|
235
|
-
case type.to_sym
|
236
|
-
when :DateTime
|
237
|
-
DateTime.parse(value)
|
238
|
-
when :Date
|
239
|
-
Date.parse(value)
|
240
|
-
when :String
|
241
|
-
value.to_s
|
242
|
-
when :Integer
|
243
|
-
value.to_i
|
244
|
-
when :Float
|
245
|
-
value.to_f
|
246
|
-
when :BOOLEAN
|
247
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
248
|
-
true
|
249
|
-
else
|
250
|
-
false
|
251
|
-
end
|
252
|
-
when :Object
|
253
|
-
# generic object (usually a Hash), return directly
|
254
|
-
value
|
255
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
256
|
-
inner_type = Regexp.last_match[:inner_type]
|
257
|
-
value.map { |v| _deserialize(inner_type, v) }
|
258
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
259
|
-
k_type = Regexp.last_match[:k_type]
|
260
|
-
v_type = Regexp.last_match[:v_type]
|
261
|
-
{}.tap do |hash|
|
262
|
-
value.each do |k, v|
|
263
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
264
|
-
end
|
265
|
-
end
|
266
|
-
else # model
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
#
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
end
|
225
|
+
# Builds the object from hash
|
226
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
227
|
+
# @return [Object] Returns the model itself
|
228
|
+
def build_from_hash(attributes)
|
229
|
+
return nil unless attributes.is_a?(Hash)
|
230
|
+
self.class.swagger_types.each_pair do |key, type|
|
231
|
+
attribute_key = self.class.attribute_map[key]
|
232
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
233
|
+
if type =~ /\AArray<(.*)>/i
|
234
|
+
# check to ensure the input is an array given that the the attribute
|
235
|
+
# is documented as an array but the input is not
|
236
|
+
if attributes[attribute_key].is_a?(Array)
|
237
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
238
|
+
end
|
239
|
+
elsif !attributes[attribute_key].nil?
|
240
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
241
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
242
|
+
end
|
243
|
+
|
244
|
+
self
|
245
|
+
end
|
246
|
+
|
247
|
+
# Deserializes the data based on type
|
248
|
+
# @param string type Data type
|
249
|
+
# @param string value Value to be deserialized
|
250
|
+
# @return [Object] Deserialized data
|
251
|
+
def _deserialize(type, value)
|
252
|
+
case type.to_sym
|
253
|
+
when :DateTime
|
254
|
+
DateTime.parse(value)
|
255
|
+
when :Date
|
256
|
+
Date.parse(value)
|
257
|
+
when :String
|
258
|
+
value.to_s
|
259
|
+
when :Integer
|
260
|
+
value.to_i
|
261
|
+
when :Float
|
262
|
+
value.to_f
|
263
|
+
when :BOOLEAN
|
264
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
265
|
+
true
|
266
|
+
else
|
267
|
+
false
|
268
|
+
end
|
269
|
+
when :Object
|
270
|
+
# generic object (usually a Hash), return directly
|
271
|
+
value
|
272
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
273
|
+
inner_type = Regexp.last_match[:inner_type]
|
274
|
+
value.map { |v| _deserialize(inner_type, v) }
|
275
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
276
|
+
k_type = Regexp.last_match[:k_type]
|
277
|
+
v_type = Regexp.last_match[:v_type]
|
278
|
+
{}.tap do |hash|
|
279
|
+
value.each do |k, v|
|
280
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
else # model
|
284
|
+
sub_type = value[:type] || value[:discriminator] || type
|
285
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
286
|
+
type = sub_type
|
287
|
+
end
|
288
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
289
|
+
temp_model.build_from_hash(value)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
# Returns the string representation of the object
|
294
|
+
# @return [String] String presentation of the object
|
295
|
+
def to_s
|
296
|
+
to_hash.to_s
|
297
|
+
end
|
298
|
+
|
299
|
+
# to_body is an alias to to_hash (backward compatibility)
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
301
|
+
def to_body
|
302
|
+
to_hash
|
303
|
+
end
|
304
|
+
|
305
|
+
# Returns the object in the form of hash
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_hash
|
308
|
+
hash = {}
|
309
|
+
self.class.attribute_map.each_pair do |attr, param|
|
310
|
+
value = self.send(attr)
|
311
|
+
next if value.nil?
|
312
|
+
hash[param] = _to_hash(value)
|
313
|
+
end
|
314
|
+
hash
|
315
|
+
end
|
316
|
+
|
317
|
+
# Outputs non-array value in the form of hash
|
318
|
+
# For object, use to_hash. Otherwise, just return the value
|
319
|
+
# @param [Object] value Any valid value
|
320
|
+
# @return [Hash] Returns the value in the form of hash
|
321
|
+
def _to_hash(value)
|
322
|
+
if value.is_a?(Array)
|
323
|
+
value.compact.map { |v| _to_hash(v) }
|
324
|
+
elsif value.is_a?(Hash)
|
325
|
+
{}.tap do |hash|
|
326
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
327
|
+
end
|
328
|
+
elsif value.respond_to? :to_hash
|
329
|
+
value.to_hash
|
330
|
+
else
|
331
|
+
value
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
end
|
336
|
+
end
|