aspose_email_cloud 20.2.0 → 20.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------------
|
|
2
|
+
# <copyright company="Aspose" file="EmailClientAccountOauthCredentials.rb">
|
|
3
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
|
4
|
+
# </copyright>
|
|
5
|
+
# <summary>
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
7
|
+
# copy of this software and associated documentation files (the "Software"),
|
|
8
|
+
# to deal in the Software without restriction, including without limitation
|
|
9
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
10
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
|
11
|
+
# Software is furnished to do so, subject to the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
|
14
|
+
# all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
22
|
+
# DEALINGS IN THE SOFTWARE.
|
|
23
|
+
# </summary>
|
|
24
|
+
# ----------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
require 'date'
|
|
28
|
+
|
|
29
|
+
module AsposeEmailCloud
|
|
30
|
+
# Represents email client account OAuth 2.0 credentials
|
|
31
|
+
class EmailClientAccountOauthCredentials
|
|
32
|
+
# Email client account login
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :login
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# @return [String]
|
|
38
|
+
def discriminator #getter method
|
|
39
|
+
self.class.name.split('::').last
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def discriminator=(discriminator) #setter method, parameter ignored
|
|
43
|
+
@discriminator = self.class.name.split('::').last
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# The client ID obtained from the Google Cloud Console during application registration.
|
|
47
|
+
# @return [String]
|
|
48
|
+
attr_accessor :client_id
|
|
49
|
+
|
|
50
|
+
# The client secret obtained during application registration.
|
|
51
|
+
# @return [String]
|
|
52
|
+
attr_accessor :client_secret
|
|
53
|
+
|
|
54
|
+
# OAuth 2.0 refresh token
|
|
55
|
+
# @return [String]
|
|
56
|
+
attr_accessor :refresh_token
|
|
57
|
+
|
|
58
|
+
# The url to obtain access token. If not specified, will try to discover from email client account host.
|
|
59
|
+
# @return [String]
|
|
60
|
+
attr_accessor :request_url
|
|
61
|
+
|
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
|
+
def self.attribute_map
|
|
64
|
+
{
|
|
65
|
+
:'login' => :'login',
|
|
66
|
+
:'discriminator' => :'discriminator',
|
|
67
|
+
:'client_id' => :'clientId',
|
|
68
|
+
:'client_secret' => :'clientSecret',
|
|
69
|
+
:'refresh_token' => :'refreshToken',
|
|
70
|
+
:'request_url' => :'requestUrl'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.swagger_types
|
|
76
|
+
{
|
|
77
|
+
:'login' => :'String',
|
|
78
|
+
:'discriminator' => :'String',
|
|
79
|
+
:'client_id' => :'String',
|
|
80
|
+
:'client_secret' => :'String',
|
|
81
|
+
:'refresh_token' => :'String',
|
|
82
|
+
:'request_url' => :'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?(:'login')
|
|
95
|
+
self.login = attributes[:'login']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.has_key?(:'discriminator')
|
|
99
|
+
@discriminator = self.class.name.split('::').last
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.has_key?(:'clientId')
|
|
103
|
+
self.client_id = attributes[:'clientId']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.has_key?(:'clientSecret')
|
|
107
|
+
self.client_secret = attributes[:'clientSecret']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.has_key?(:'refreshToken')
|
|
111
|
+
self.refresh_token = attributes[:'refreshToken']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.has_key?(:'requestUrl')
|
|
115
|
+
self.request_url = attributes[:'requestUrl']
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Initializes the object
|
|
120
|
+
# @param [String] login Email client account login
|
|
121
|
+
# @param [String] discriminator
|
|
122
|
+
# @param [String] client_id The client ID obtained from the Google Cloud Console during application registration.
|
|
123
|
+
# @param [String] client_secret The client secret obtained during application registration.
|
|
124
|
+
# @param [String] refresh_token OAuth 2.0 refresh token
|
|
125
|
+
# @param [String] request_url The url to obtain access token. If not specified, will try to discover from email client account host.
|
|
126
|
+
def initialize(login=nil, discriminator=nil, client_id=nil, client_secret=nil, refresh_token=nil, request_url=nil)
|
|
127
|
+
self.login = login if login
|
|
128
|
+
@discriminator = self.class.name.split('::').last
|
|
129
|
+
self.client_id = client_id if client_id
|
|
130
|
+
self.client_secret = client_secret if client_secret
|
|
131
|
+
self.refresh_token = refresh_token if refresh_token
|
|
132
|
+
self.request_url = request_url if request_url
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
136
|
+
# @return Array for valid properties with the reasons
|
|
137
|
+
def list_invalid_properties
|
|
138
|
+
invalid_properties = Array.new
|
|
139
|
+
if @login.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "login", login cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if @login.to_s.length < 1
|
|
144
|
+
invalid_properties.push('invalid value for "login", the character length must be great than or equal to 1.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @discriminator.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @client_id.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @client_id.to_s.length < 1
|
|
156
|
+
invalid_properties.push('invalid value for "client_id", the character length must be great than or equal to 1.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @client_secret.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "client_secret", client_secret cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @client_secret.to_s.length < 1
|
|
164
|
+
invalid_properties.push('invalid value for "client_secret", the character length must be great than or equal to 1.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if @refresh_token.nil?
|
|
168
|
+
invalid_properties.push('invalid value for "refresh_token", refresh_token cannot be nil.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if @refresh_token.to_s.length < 1
|
|
172
|
+
invalid_properties.push('invalid value for "refresh_token", the character length must be great than or equal to 1.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
invalid_properties
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Check to see if the all the properties in the model are valid
|
|
179
|
+
# @return true if the model is valid
|
|
180
|
+
def valid?
|
|
181
|
+
return false if @login.nil?
|
|
182
|
+
return false if @login.to_s.length < 1
|
|
183
|
+
return false if @discriminator.nil?
|
|
184
|
+
return false if @client_id.nil?
|
|
185
|
+
return false if @client_id.to_s.length < 1
|
|
186
|
+
return false if @client_secret.nil?
|
|
187
|
+
return false if @client_secret.to_s.length < 1
|
|
188
|
+
return false if @refresh_token.nil?
|
|
189
|
+
return false if @refresh_token.to_s.length < 1
|
|
190
|
+
true
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method with validation
|
|
194
|
+
# @param [Object] login Value to be assigned
|
|
195
|
+
def login=(login)
|
|
196
|
+
if login.nil?
|
|
197
|
+
fail ArgumentError, 'login cannot be nil'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if login.to_s.length < 1
|
|
201
|
+
fail ArgumentError, 'invalid value for "login", the character length must be great than or equal to 1.'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@login = login
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method with validation
|
|
208
|
+
# @param [Object] client_id Value to be assigned
|
|
209
|
+
def client_id=(client_id)
|
|
210
|
+
if client_id.nil?
|
|
211
|
+
fail ArgumentError, 'client_id cannot be nil'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if client_id.to_s.length < 1
|
|
215
|
+
fail ArgumentError, 'invalid value for "client_id", the character length must be great than or equal to 1.'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@client_id = client_id
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] client_secret Value to be assigned
|
|
223
|
+
def client_secret=(client_secret)
|
|
224
|
+
if client_secret.nil?
|
|
225
|
+
fail ArgumentError, 'client_secret cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if client_secret.to_s.length < 1
|
|
229
|
+
fail ArgumentError, 'invalid value for "client_secret", the character length must be great than or equal to 1.'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@client_secret = client_secret
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] refresh_token Value to be assigned
|
|
237
|
+
def refresh_token=(refresh_token)
|
|
238
|
+
if refresh_token.nil?
|
|
239
|
+
fail ArgumentError, 'refresh_token cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if refresh_token.to_s.length < 1
|
|
243
|
+
fail ArgumentError, 'invalid value for "refresh_token", the character length must be great than or equal to 1.'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
@refresh_token = refresh_token
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Checks equality by comparing each attribute.
|
|
250
|
+
# @param [Object] Object to be compared
|
|
251
|
+
def ==(o)
|
|
252
|
+
return true if self.equal?(o)
|
|
253
|
+
self.class == o.class &&
|
|
254
|
+
login == o.login &&
|
|
255
|
+
discriminator == o.discriminator &&
|
|
256
|
+
client_id == o.client_id &&
|
|
257
|
+
client_secret == o.client_secret &&
|
|
258
|
+
refresh_token == o.refresh_token &&
|
|
259
|
+
request_url == o.request_url
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# @see the `==` method
|
|
263
|
+
# @param [Object] Object to be compared
|
|
264
|
+
def eql?(o)
|
|
265
|
+
self == o
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Calculates hash code according to all attributes.
|
|
269
|
+
# @return [Fixnum] Hash code
|
|
270
|
+
def hash
|
|
271
|
+
[login, discriminator, client_id, client_secret, refresh_token, request_url].hash
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Builds the object from hash
|
|
275
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
276
|
+
# @return [Object] Returns the model itself
|
|
277
|
+
def build_from_hash(attributes)
|
|
278
|
+
return nil unless attributes.is_a?(Hash)
|
|
279
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
280
|
+
attribute_key = self.class.attribute_map[key]
|
|
281
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
|
282
|
+
if type =~ /\AArray<(.*)>/i
|
|
283
|
+
# check to ensure the input is an array given that the the attribute
|
|
284
|
+
# is documented as an array but the input is not
|
|
285
|
+
if attributes[attribute_key].is_a?(Array)
|
|
286
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
|
287
|
+
end
|
|
288
|
+
elsif !attributes[attribute_key].nil?
|
|
289
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
|
290
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
self
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Deserializes the data based on type
|
|
297
|
+
# @param string type Data type
|
|
298
|
+
# @param string value Value to be deserialized
|
|
299
|
+
# @return [Object] Deserialized data
|
|
300
|
+
def _deserialize(type, value)
|
|
301
|
+
case type.to_sym
|
|
302
|
+
when :DateTime
|
|
303
|
+
DateTime.parse(value)
|
|
304
|
+
when :Date
|
|
305
|
+
Date.parse(value)
|
|
306
|
+
when :String
|
|
307
|
+
value.to_s
|
|
308
|
+
when :Integer
|
|
309
|
+
value.to_i
|
|
310
|
+
when :Float
|
|
311
|
+
value.to_f
|
|
312
|
+
when :BOOLEAN
|
|
313
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
314
|
+
true
|
|
315
|
+
else
|
|
316
|
+
false
|
|
317
|
+
end
|
|
318
|
+
when :Object
|
|
319
|
+
# generic object (usually a Hash), return directly
|
|
320
|
+
value
|
|
321
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
322
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
323
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
324
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
325
|
+
k_type = Regexp.last_match[:k_type]
|
|
326
|
+
v_type = Regexp.last_match[:v_type]
|
|
327
|
+
{}.tap do |hash|
|
|
328
|
+
value.each do |k, v|
|
|
329
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
else # model
|
|
333
|
+
sub_type = value[:type] || value[:discriminator] || type
|
|
334
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
|
335
|
+
type = sub_type
|
|
336
|
+
end
|
|
337
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
|
338
|
+
temp_model.build_from_hash(value)
|
|
339
|
+
end
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# Returns the string representation of the object
|
|
343
|
+
# @return [String] String presentation of the object
|
|
344
|
+
def to_s
|
|
345
|
+
to_hash.to_s
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
|
350
|
+
def to_body
|
|
351
|
+
to_hash
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Returns the object in the form of hash
|
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
|
356
|
+
def to_hash
|
|
357
|
+
hash = {}
|
|
358
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
359
|
+
value = self.send(attr)
|
|
360
|
+
next if value.nil?
|
|
361
|
+
hash[param] = _to_hash(value)
|
|
362
|
+
end
|
|
363
|
+
hash
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Outputs non-array value in the form of hash
|
|
367
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
368
|
+
# @param [Object] value Any valid value
|
|
369
|
+
# @return [Hash] Returns the value in the form of hash
|
|
370
|
+
def _to_hash(value)
|
|
371
|
+
if value.is_a?(Array)
|
|
372
|
+
value.compact.map { |v| _to_hash(v) }
|
|
373
|
+
elsif value.is_a?(Hash)
|
|
374
|
+
{}.tap do |hash|
|
|
375
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
376
|
+
end
|
|
377
|
+
elsif value.respond_to? :to_hash
|
|
378
|
+
value.to_hash
|
|
379
|
+
else
|
|
380
|
+
value
|
|
381
|
+
end
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
end
|
|
385
|
+
end
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------------
|
|
2
|
+
# <copyright company="Aspose" file="EmailClientAccountPasswordCredentials.rb">
|
|
3
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
|
4
|
+
# </copyright>
|
|
5
|
+
# <summary>
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
7
|
+
# copy of this software and associated documentation files (the "Software"),
|
|
8
|
+
# to deal in the Software without restriction, including without limitation
|
|
9
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
10
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
|
11
|
+
# Software is furnished to do so, subject to the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
|
14
|
+
# all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
22
|
+
# DEALINGS IN THE SOFTWARE.
|
|
23
|
+
# </summary>
|
|
24
|
+
# ----------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
require 'date'
|
|
28
|
+
|
|
29
|
+
module AsposeEmailCloud
|
|
30
|
+
# Represents email client account password credentials
|
|
31
|
+
class EmailClientAccountPasswordCredentials
|
|
32
|
+
# Email client account login
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :login
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# @return [String]
|
|
38
|
+
def discriminator #getter method
|
|
39
|
+
self.class.name.split('::').last
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def discriminator=(discriminator) #setter method, parameter ignored
|
|
43
|
+
@discriminator = self.class.name.split('::').last
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Email client account password
|
|
47
|
+
# @return [String]
|
|
48
|
+
attr_accessor :password
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'login' => :'login',
|
|
54
|
+
:'discriminator' => :'discriminator',
|
|
55
|
+
:'password' => :'password'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.swagger_types
|
|
61
|
+
{
|
|
62
|
+
:'login' => :'String',
|
|
63
|
+
:'discriminator' => :'String',
|
|
64
|
+
:'password' => :'String'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Initializes the object
|
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
70
|
+
def initialize(attributes = {})
|
|
71
|
+
return unless attributes.is_a?(Hash)
|
|
72
|
+
|
|
73
|
+
# convert string to symbol for hash key
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'login')
|
|
77
|
+
self.login = attributes[:'login']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'discriminator')
|
|
81
|
+
@discriminator = self.class.name.split('::').last
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'password')
|
|
85
|
+
self.password = attributes[:'password']
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Initializes the object
|
|
90
|
+
# @param [String] login Email client account login
|
|
91
|
+
# @param [String] discriminator
|
|
92
|
+
# @param [String] password Email client account password
|
|
93
|
+
def initialize(login=nil, discriminator=nil, password=nil)
|
|
94
|
+
self.login = login if login
|
|
95
|
+
@discriminator = self.class.name.split('::').last
|
|
96
|
+
self.password = password if password
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
invalid_properties = Array.new
|
|
103
|
+
if @login.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "login", login cannot be nil.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if @login.to_s.length < 1
|
|
108
|
+
invalid_properties.push('invalid value for "login", the character length must be great than or equal to 1.')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @discriminator.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @password.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "password", password cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if @password.to_s.length < 1
|
|
120
|
+
invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
invalid_properties
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Check to see if the all the properties in the model are valid
|
|
127
|
+
# @return true if the model is valid
|
|
128
|
+
def valid?
|
|
129
|
+
return false if @login.nil?
|
|
130
|
+
return false if @login.to_s.length < 1
|
|
131
|
+
return false if @discriminator.nil?
|
|
132
|
+
return false if @password.nil?
|
|
133
|
+
return false if @password.to_s.length < 1
|
|
134
|
+
true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method with validation
|
|
138
|
+
# @param [Object] login Value to be assigned
|
|
139
|
+
def login=(login)
|
|
140
|
+
if login.nil?
|
|
141
|
+
fail ArgumentError, 'login cannot be nil'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if login.to_s.length < 1
|
|
145
|
+
fail ArgumentError, 'invalid value for "login", the character length must be great than or equal to 1.'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@login = login
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Custom attribute writer method with validation
|
|
152
|
+
# @param [Object] password Value to be assigned
|
|
153
|
+
def password=(password)
|
|
154
|
+
if password.nil?
|
|
155
|
+
fail ArgumentError, 'password cannot be nil'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if password.to_s.length < 1
|
|
159
|
+
fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@password = password
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Checks equality by comparing each attribute.
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def ==(o)
|
|
168
|
+
return true if self.equal?(o)
|
|
169
|
+
self.class == o.class &&
|
|
170
|
+
login == o.login &&
|
|
171
|
+
discriminator == o.discriminator &&
|
|
172
|
+
password == o.password
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# @see the `==` method
|
|
176
|
+
# @param [Object] Object to be compared
|
|
177
|
+
def eql?(o)
|
|
178
|
+
self == o
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Calculates hash code according to all attributes.
|
|
182
|
+
# @return [Fixnum] Hash code
|
|
183
|
+
def hash
|
|
184
|
+
[login, discriminator, password].hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Builds the object from hash
|
|
188
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
189
|
+
# @return [Object] Returns the model itself
|
|
190
|
+
def build_from_hash(attributes)
|
|
191
|
+
return nil unless attributes.is_a?(Hash)
|
|
192
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
193
|
+
attribute_key = self.class.attribute_map[key]
|
|
194
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
|
195
|
+
if type =~ /\AArray<(.*)>/i
|
|
196
|
+
# check to ensure the input is an array given that the the attribute
|
|
197
|
+
# is documented as an array but the input is not
|
|
198
|
+
if attributes[attribute_key].is_a?(Array)
|
|
199
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
|
200
|
+
end
|
|
201
|
+
elsif !attributes[attribute_key].nil?
|
|
202
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
|
203
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
self
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Deserializes the data based on type
|
|
210
|
+
# @param string type Data type
|
|
211
|
+
# @param string value Value to be deserialized
|
|
212
|
+
# @return [Object] Deserialized data
|
|
213
|
+
def _deserialize(type, value)
|
|
214
|
+
case type.to_sym
|
|
215
|
+
when :DateTime
|
|
216
|
+
DateTime.parse(value)
|
|
217
|
+
when :Date
|
|
218
|
+
Date.parse(value)
|
|
219
|
+
when :String
|
|
220
|
+
value.to_s
|
|
221
|
+
when :Integer
|
|
222
|
+
value.to_i
|
|
223
|
+
when :Float
|
|
224
|
+
value.to_f
|
|
225
|
+
when :BOOLEAN
|
|
226
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
227
|
+
true
|
|
228
|
+
else
|
|
229
|
+
false
|
|
230
|
+
end
|
|
231
|
+
when :Object
|
|
232
|
+
# generic object (usually a Hash), return directly
|
|
233
|
+
value
|
|
234
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
235
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
236
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
237
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
238
|
+
k_type = Regexp.last_match[:k_type]
|
|
239
|
+
v_type = Regexp.last_match[:v_type]
|
|
240
|
+
{}.tap do |hash|
|
|
241
|
+
value.each do |k, v|
|
|
242
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
else # model
|
|
246
|
+
sub_type = value[:type] || value[:discriminator] || type
|
|
247
|
+
if AsposeEmailCloud.const_defined?(sub_type)
|
|
248
|
+
type = sub_type
|
|
249
|
+
end
|
|
250
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
|
251
|
+
temp_model.build_from_hash(value)
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Returns the string representation of the object
|
|
256
|
+
# @return [String] String presentation of the object
|
|
257
|
+
def to_s
|
|
258
|
+
to_hash.to_s
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
262
|
+
# @return [Hash] Returns the object in the form of hash
|
|
263
|
+
def to_body
|
|
264
|
+
to_hash
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the object in the form of hash
|
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
|
269
|
+
def to_hash
|
|
270
|
+
hash = {}
|
|
271
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
272
|
+
value = self.send(attr)
|
|
273
|
+
next if value.nil?
|
|
274
|
+
hash[param] = _to_hash(value)
|
|
275
|
+
end
|
|
276
|
+
hash
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Outputs non-array value in the form of hash
|
|
280
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
281
|
+
# @param [Object] value Any valid value
|
|
282
|
+
# @return [Hash] Returns the value in the form of hash
|
|
283
|
+
def _to_hash(value)
|
|
284
|
+
if value.is_a?(Array)
|
|
285
|
+
value.compact.map { |v| _to_hash(v) }
|
|
286
|
+
elsif value.is_a?(Hash)
|
|
287
|
+
{}.tap do |hash|
|
|
288
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
289
|
+
end
|
|
290
|
+
elsif value.respond_to? :to_hash
|
|
291
|
+
value.to_hash
|
|
292
|
+
else
|
|
293
|
+
value
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
298
|
+
end
|