aspose_email_cloud 18.7.0 → 19.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose-email-cloud.rb +145 -0
- data/lib/aspose-email-cloud/api/email_api.rb +577 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/api_client.rb +125 -133
- data/lib/aspose-email-cloud/api_error.rb +42 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/configuration.rb +56 -43
- data/lib/aspose-email-cloud/models/account_base_request.rb +250 -0
- data/lib/aspose-email-cloud/models/add_attachment_request.rb +219 -0
- data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +300 -0
- data/lib/aspose-email-cloud/models/append_email_base_request.rb +316 -0
- data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +335 -0
- data/lib/aspose-email-cloud/models/base_object.rb +225 -0
- data/lib/aspose-email-cloud/models/contact_format.rb +45 -0
- data/lib/aspose-email-cloud/models/create_email_request.rb +224 -0
- data/lib/aspose-email-cloud/models/create_folder_base_request.rb +297 -0
- data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +302 -0
- data/lib/aspose-email-cloud/models/delete_message_base_request.rb +302 -0
- data/lib/aspose-email-cloud/models/disc_usage.rb +229 -0
- data/lib/aspose-email-cloud/models/email_account_request.rb +342 -0
- data/lib/aspose-email-cloud/models/email_document.rb +226 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_document_response.rb +105 -109
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_properties.rb +122 -97
- data/lib/aspose-email-cloud/models/email_property.rb +256 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_property_response.rb +105 -109
- data/lib/aspose-email-cloud/models/error.rb +241 -0
- data/lib/aspose-email-cloud/models/error_details.rb +224 -0
- data/lib/aspose-email-cloud/models/file_version.rb +289 -0
- data/lib/aspose-email-cloud/models/file_versions.rb +210 -0
- data/lib/aspose-email-cloud/models/files_list.rb +210 -0
- data/lib/aspose-email-cloud/models/files_upload_result.rb +223 -0
- data/lib/aspose-email-cloud/models/hierarchical_object.rb +238 -0
- data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +224 -0
- data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +219 -0
- data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +254 -0
- data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +252 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/link.rb +138 -116
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +208 -0
- data/{src/asposeemailcloud/models/email_document.rb → lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb} +105 -98
- data/{src/asposeemailcloud/models/list_folders_response.rb → lib/aspose-email-cloud/models/list_response_of_string.rb} +105 -111
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mail_server_folder.rb +116 -96
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mime_response.rb +105 -109
- data/lib/aspose-email-cloud/models/object_exist.rb +229 -0
- data/lib/aspose-email-cloud/models/primitive_object.rb +236 -0
- data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +94 -0
- data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +96 -0
- data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +108 -0
- data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/email_request.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +93 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +95 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +100 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +93 -0
- data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +71 -0
- data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +80 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/http_request.rb +51 -0
- data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +105 -0
- data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +94 -0
- data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +87 -0
- data/lib/aspose-email-cloud/models/save_email_account_request.rb +377 -0
- data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +447 -0
- data/lib/aspose-email-cloud/models/send_email_base_request.rb +267 -0
- data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +286 -0
- data/lib/aspose-email-cloud/models/set_email_property_request.rb +224 -0
- data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +302 -0
- data/{src/asposeemailcloud/models/email_property.rb → lib/aspose-email-cloud/models/storage_exist.rb} +110 -96
- data/lib/aspose-email-cloud/models/storage_file.rb +262 -0
- data/lib/aspose-email-cloud/models/storage_file_location.rb +254 -0
- data/lib/aspose-email-cloud/models/storage_folder_location.rb +219 -0
- data/{src/asposeemailcloud/models/list_response.rb → lib/aspose-email-cloud/models/value_response.rb} +105 -111
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/version.rb +4 -4
- metadata +128 -38
- data/src/asposeemailcloud.rb +0 -55
- data/src/asposeemailcloud/api/email_api.rb +0 -418
- data/src/asposeemailcloud/api/email_client_api.rb +0 -960
- data/src/asposeemailcloud/api_error.rb +0 -38
- data/src/asposeemailcloud/models/http_status_code.rb +0 -76
- data/src/asposeemailcloud/models/protocol_type.rb +0 -34
- data/src/asposeemailcloud/models/saa_spose_response.rb +0 -202
- data/src/asposeemailcloud/models/security_options.rb +0 -33
@@ -0,0 +1,75 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose" file="storage_exists_request_data.rb">
|
4
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
# copy of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
12
|
+
# Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
23
|
+
# DEALINGS IN THE SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# ----------------------------------------------------------------------------
|
26
|
+
|
27
|
+
|
28
|
+
require_relative './email_request'
|
29
|
+
require_relative './http_request'
|
30
|
+
|
31
|
+
module AsposeEmailCloud
|
32
|
+
# Request model for storage_exists operation.
|
33
|
+
class StorageExistsRequestData < EmailRequest
|
34
|
+
|
35
|
+
# Check if storage exists
|
36
|
+
# @param [String] storage_name Storage name
|
37
|
+
def initialize(storage_name)
|
38
|
+
@storage_name = storage_name
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_http_info(api_client)
|
42
|
+
# verify the required parameter 'storage_name' is set
|
43
|
+
if api_client.config.client_side_validation && @storage_name.nil?
|
44
|
+
raise ArgumentError, "Missing the required parameter 'storage_name' when calling EmailApi.storage_exists"
|
45
|
+
end
|
46
|
+
|
47
|
+
# resource path
|
48
|
+
local_var_path = '/email/storage/{storageName}/exist'.sub('{' + 'storageName' + '}', @storage_name.to_s)
|
49
|
+
|
50
|
+
# query parameters
|
51
|
+
query_params = {}
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = nil
|
58
|
+
auth_names = ['JWT']
|
59
|
+
|
60
|
+
# header parameters
|
61
|
+
header_params = {}
|
62
|
+
# HTTP header 'Accept' (if needed)
|
63
|
+
header_params['Accept'] = select_header_accept(['application/json'])
|
64
|
+
# HTTP header 'Content-Type'
|
65
|
+
header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
|
66
|
+
|
67
|
+
AsposeEmailCloud::HttpRequest.new(local_var_path,
|
68
|
+
header_params,
|
69
|
+
query_params,
|
70
|
+
form_params,
|
71
|
+
post_body,
|
72
|
+
auth_names)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose" file="update_calendar_properties_request_data.rb">
|
4
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
# copy of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
12
|
+
# Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
23
|
+
# DEALINGS IN THE SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# ----------------------------------------------------------------------------
|
26
|
+
|
27
|
+
|
28
|
+
require_relative './email_request'
|
29
|
+
require_relative './http_request'
|
30
|
+
|
31
|
+
module AsposeEmailCloud
|
32
|
+
# Request model for update_calendar_properties operation.
|
33
|
+
class UpdateCalendarPropertiesRequestData < EmailRequest
|
34
|
+
|
35
|
+
# Update calendar file properties
|
36
|
+
# @param [String] name iCalendar file name in storage
|
37
|
+
# @param [HierarchicalObjectRequest] request Calendar properties update request
|
38
|
+
def initialize(name, request)
|
39
|
+
@name = name
|
40
|
+
@request = request
|
41
|
+
end
|
42
|
+
|
43
|
+
def to_http_info(api_client)
|
44
|
+
# verify the required parameter 'name' is set
|
45
|
+
if api_client.config.client_side_validation && @name.nil?
|
46
|
+
raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.update_calendar_properties"
|
47
|
+
end
|
48
|
+
|
49
|
+
# verify the required parameter 'request' is set
|
50
|
+
if api_client.config.client_side_validation && @request.nil?
|
51
|
+
raise ArgumentError, "Missing the required parameter 'request' when calling EmailApi.update_calendar_properties"
|
52
|
+
end
|
53
|
+
|
54
|
+
# resource path
|
55
|
+
local_var_path = '/email/Calendar/{name}/properties'.sub('{' + 'name' + '}', @name.to_s)
|
56
|
+
|
57
|
+
# query parameters
|
58
|
+
query_params = {}
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = api_client.object_to_http_body(@request)
|
65
|
+
auth_names = ['JWT']
|
66
|
+
|
67
|
+
# header parameters
|
68
|
+
header_params = {}
|
69
|
+
# HTTP header 'Accept' (if needed)
|
70
|
+
header_params['Accept'] = select_header_accept(['application/json'])
|
71
|
+
# HTTP header 'Content-Type'
|
72
|
+
header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
|
73
|
+
|
74
|
+
AsposeEmailCloud::HttpRequest.new(local_var_path,
|
75
|
+
header_params,
|
76
|
+
query_params,
|
77
|
+
form_params,
|
78
|
+
post_body,
|
79
|
+
auth_names)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose" file="update_contact_properties_request_data.rb">
|
4
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
# copy of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
12
|
+
# Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
23
|
+
# DEALINGS IN THE SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# ----------------------------------------------------------------------------
|
26
|
+
|
27
|
+
|
28
|
+
require_relative './email_request'
|
29
|
+
require_relative './http_request'
|
30
|
+
|
31
|
+
module AsposeEmailCloud
|
32
|
+
# Request model for update_contact_properties operation.
|
33
|
+
class UpdateContactPropertiesRequestData < EmailRequest
|
34
|
+
|
35
|
+
# Update contact document properties
|
36
|
+
# @param [String] format Contact document format
|
37
|
+
# @param [String] name Contact document file name
|
38
|
+
# @param [HierarchicalObjectRequest] request Properties that should be updated/added
|
39
|
+
def initialize(format, name, request)
|
40
|
+
@format = format
|
41
|
+
@name = name
|
42
|
+
@request = request
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_http_info(api_client)
|
46
|
+
# verify the required parameter 'format' is set
|
47
|
+
if api_client.config.client_side_validation && @format.nil?
|
48
|
+
raise ArgumentError, "Missing the required parameter 'format' when calling EmailApi.update_contact_properties"
|
49
|
+
end
|
50
|
+
|
51
|
+
# verify enum value
|
52
|
+
if api_client.config.client_side_validation && !['VCard', 'WebDav', 'Msg'].include?(@format)
|
53
|
+
raise ArgumentError, "invalid value for 'format', must be one of VCard, WebDav, Msg"
|
54
|
+
end
|
55
|
+
|
56
|
+
# verify the required parameter 'name' is set
|
57
|
+
if api_client.config.client_side_validation && @name.nil?
|
58
|
+
raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.update_contact_properties"
|
59
|
+
end
|
60
|
+
|
61
|
+
# verify the required parameter 'request' is set
|
62
|
+
if api_client.config.client_side_validation && @request.nil?
|
63
|
+
raise ArgumentError, "Missing the required parameter 'request' when calling EmailApi.update_contact_properties"
|
64
|
+
end
|
65
|
+
|
66
|
+
# resource path
|
67
|
+
local_var_path = '/email/Contact/{format}/{name}/properties'.sub('{' + 'format' + '}', @format.to_s).sub('{' + 'name' + '}', @name.to_s)
|
68
|
+
|
69
|
+
# query parameters
|
70
|
+
query_params = {}
|
71
|
+
|
72
|
+
# form parameters
|
73
|
+
form_params = {}
|
74
|
+
|
75
|
+
# http body (model)
|
76
|
+
post_body = api_client.object_to_http_body(@request)
|
77
|
+
auth_names = ['JWT']
|
78
|
+
|
79
|
+
# header parameters
|
80
|
+
header_params = {}
|
81
|
+
# HTTP header 'Accept' (if needed)
|
82
|
+
header_params['Accept'] = select_header_accept(['application/json'])
|
83
|
+
# HTTP header 'Content-Type'
|
84
|
+
header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
|
85
|
+
|
86
|
+
AsposeEmailCloud::HttpRequest.new(local_var_path,
|
87
|
+
header_params,
|
88
|
+
query_params,
|
89
|
+
form_params,
|
90
|
+
post_body,
|
91
|
+
auth_names)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose" file="update_mapi_properties_request_data.rb">
|
4
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
# copy of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
12
|
+
# Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
23
|
+
# DEALINGS IN THE SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# ----------------------------------------------------------------------------
|
26
|
+
|
27
|
+
|
28
|
+
require_relative './email_request'
|
29
|
+
require_relative './http_request'
|
30
|
+
|
31
|
+
module AsposeEmailCloud
|
32
|
+
# Request model for update_mapi_properties operation.
|
33
|
+
class UpdateMapiPropertiesRequestData < EmailRequest
|
34
|
+
|
35
|
+
# Update document properties
|
36
|
+
# @param [String] name Document file name
|
37
|
+
# @param [HierarchicalObjectRequest] request Properties that should be updated/added
|
38
|
+
def initialize(name, request)
|
39
|
+
@name = name
|
40
|
+
@request = request
|
41
|
+
end
|
42
|
+
|
43
|
+
def to_http_info(api_client)
|
44
|
+
# verify the required parameter 'name' is set
|
45
|
+
if api_client.config.client_side_validation && @name.nil?
|
46
|
+
raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.update_mapi_properties"
|
47
|
+
end
|
48
|
+
|
49
|
+
# verify the required parameter 'request' is set
|
50
|
+
if api_client.config.client_side_validation && @request.nil?
|
51
|
+
raise ArgumentError, "Missing the required parameter 'request' when calling EmailApi.update_mapi_properties"
|
52
|
+
end
|
53
|
+
|
54
|
+
# resource path
|
55
|
+
local_var_path = '/email/Mapi/{name}/properties'.sub('{' + 'name' + '}', @name.to_s)
|
56
|
+
|
57
|
+
# query parameters
|
58
|
+
query_params = {}
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = api_client.object_to_http_body(@request)
|
65
|
+
auth_names = ['JWT']
|
66
|
+
|
67
|
+
# header parameters
|
68
|
+
header_params = {}
|
69
|
+
# HTTP header 'Accept' (if needed)
|
70
|
+
header_params['Accept'] = select_header_accept(['application/json'])
|
71
|
+
# HTTP header 'Content-Type'
|
72
|
+
header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
|
73
|
+
|
74
|
+
AsposeEmailCloud::HttpRequest.new(local_var_path,
|
75
|
+
header_params,
|
76
|
+
query_params,
|
77
|
+
form_params,
|
78
|
+
post_body,
|
79
|
+
auth_names)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose" file="upload_file_request_data.rb">
|
4
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
# copy of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
12
|
+
# Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
23
|
+
# DEALINGS IN THE SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# ----------------------------------------------------------------------------
|
26
|
+
|
27
|
+
|
28
|
+
require_relative './email_request'
|
29
|
+
require_relative './http_request'
|
30
|
+
|
31
|
+
module AsposeEmailCloud
|
32
|
+
# Request model for upload_file operation.
|
33
|
+
class UploadFileRequestData < EmailRequest
|
34
|
+
|
35
|
+
# Upload file
|
36
|
+
# @param [String] path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header.
|
37
|
+
# @param [File] file File to upload
|
38
|
+
# @param [String] storage_name Storage name
|
39
|
+
def initialize(path, file, storage_name = nil)
|
40
|
+
@path = path
|
41
|
+
@file = file
|
42
|
+
@storage_name = storage_name
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_http_info(api_client)
|
46
|
+
# verify the required parameter 'path' is set
|
47
|
+
if api_client.config.client_side_validation && @path.nil?
|
48
|
+
raise ArgumentError, "Missing the required parameter 'path' when calling EmailApi.upload_file"
|
49
|
+
end
|
50
|
+
|
51
|
+
# verify the required parameter 'file' is set
|
52
|
+
if api_client.config.client_side_validation && @file.nil?
|
53
|
+
raise ArgumentError, "Missing the required parameter 'file' when calling EmailApi.upload_file"
|
54
|
+
end
|
55
|
+
|
56
|
+
# resource path
|
57
|
+
local_var_path = '/email/storage/file/{path}'.sub('{' + 'path' + '}', @path.to_s)
|
58
|
+
|
59
|
+
# query parameters
|
60
|
+
query_params = {}
|
61
|
+
query_params[:storageName] = @storage_name unless @storage_name.nil?
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = {}
|
65
|
+
form_params['File'] = @file
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = nil
|
69
|
+
auth_names = ['JWT']
|
70
|
+
|
71
|
+
# header parameters
|
72
|
+
header_params = {}
|
73
|
+
# HTTP header 'Accept' (if needed)
|
74
|
+
header_params['Accept'] = select_header_accept(['application/json'])
|
75
|
+
# HTTP header 'Content-Type'
|
76
|
+
header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['multipart/form-data'])
|
77
|
+
|
78
|
+
AsposeEmailCloud::HttpRequest.new(local_var_path,
|
79
|
+
header_params,
|
80
|
+
query_params,
|
81
|
+
form_params,
|
82
|
+
post_body,
|
83
|
+
auth_names)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
@@ -0,0 +1,377 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="SaveEmailAccountRequest.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
|
+
# Save email account settings with login/password authentication request
|
31
|
+
class SaveEmailAccountRequest
|
32
|
+
# Email account host
|
33
|
+
attr_accessor :host
|
34
|
+
|
35
|
+
# Email account port
|
36
|
+
attr_accessor :port
|
37
|
+
|
38
|
+
# Email account login
|
39
|
+
attr_accessor :login
|
40
|
+
|
41
|
+
# Email account security options
|
42
|
+
attr_accessor :security_options
|
43
|
+
|
44
|
+
# Email account protocol type
|
45
|
+
attr_accessor :protocol_type
|
46
|
+
|
47
|
+
# Email account description
|
48
|
+
attr_accessor :description
|
49
|
+
|
50
|
+
# A storage file location info to store email account
|
51
|
+
attr_accessor :storage_file
|
52
|
+
|
53
|
+
# Email account password
|
54
|
+
attr_accessor :password
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'host' => :'host',
|
60
|
+
:'port' => :'port',
|
61
|
+
:'login' => :'login',
|
62
|
+
:'security_options' => :'securityOptions',
|
63
|
+
:'protocol_type' => :'protocolType',
|
64
|
+
:'description' => :'description',
|
65
|
+
:'storage_file' => :'storageFile',
|
66
|
+
:'password' => :'password'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.swagger_types
|
72
|
+
{
|
73
|
+
:'host' => :'String',
|
74
|
+
:'port' => :'Integer',
|
75
|
+
:'login' => :'String',
|
76
|
+
:'security_options' => :'Object',
|
77
|
+
:'protocol_type' => :'Object',
|
78
|
+
:'description' => :'String',
|
79
|
+
:'storage_file' => :'StorageFileLocation',
|
80
|
+
:'password' => :'String'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Initializes the object
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
86
|
+
def initialize(attributes = {})
|
87
|
+
return unless attributes.is_a?(Hash)
|
88
|
+
|
89
|
+
# convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
91
|
+
|
92
|
+
if attributes.has_key?(:'host')
|
93
|
+
self.host = attributes[:'host']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.has_key?(:'port')
|
97
|
+
self.port = attributes[:'port']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.has_key?(:'login')
|
101
|
+
self.login = attributes[:'login']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.has_key?(:'securityOptions')
|
105
|
+
self.security_options = attributes[:'securityOptions']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.has_key?(:'protocolType')
|
109
|
+
self.protocol_type = attributes[:'protocolType']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'description')
|
113
|
+
self.description = attributes[:'description']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.has_key?(:'storageFile')
|
117
|
+
self.storage_file = attributes[:'storageFile']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.has_key?(:'password')
|
121
|
+
self.password = attributes[:'password']
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# Initializes the object
|
126
|
+
def initialize(host=nil, port=nil, login=nil, security_options=nil, protocol_type=nil, description=nil, storage_file=nil, password=nil)
|
127
|
+
self.host = host
|
128
|
+
self.port = port
|
129
|
+
self.login = login
|
130
|
+
self.security_options = security_options
|
131
|
+
self.protocol_type = protocol_type
|
132
|
+
self.description = description
|
133
|
+
self.storage_file = storage_file
|
134
|
+
self.password = password
|
135
|
+
end
|
136
|
+
|
137
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
138
|
+
# @return Array for valid properties with the reasons
|
139
|
+
def list_invalid_properties
|
140
|
+
invalid_properties = Array.new
|
141
|
+
if @host.nil?
|
142
|
+
invalid_properties.push('invalid value for "host", host cannot be nil.')
|
143
|
+
end
|
144
|
+
|
145
|
+
if @host.to_s.length < 1
|
146
|
+
invalid_properties.push('invalid value for "host", the character length must be great than or equal to 1.')
|
147
|
+
end
|
148
|
+
|
149
|
+
if @port.nil?
|
150
|
+
invalid_properties.push('invalid value for "port", port cannot be nil.')
|
151
|
+
end
|
152
|
+
|
153
|
+
if @login.nil?
|
154
|
+
invalid_properties.push('invalid value for "login", login cannot be nil.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if @login.to_s.length < 1
|
158
|
+
invalid_properties.push('invalid value for "login", the character length must be great than or equal to 1.')
|
159
|
+
end
|
160
|
+
|
161
|
+
if @security_options.nil?
|
162
|
+
invalid_properties.push('invalid value for "security_options", security_options cannot be nil.')
|
163
|
+
end
|
164
|
+
|
165
|
+
if @protocol_type.nil?
|
166
|
+
invalid_properties.push('invalid value for "protocol_type", protocol_type cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @storage_file.nil?
|
170
|
+
invalid_properties.push('invalid value for "storage_file", storage_file cannot be nil.')
|
171
|
+
end
|
172
|
+
|
173
|
+
if @password.nil?
|
174
|
+
invalid_properties.push('invalid value for "password", password cannot be nil.')
|
175
|
+
end
|
176
|
+
|
177
|
+
if @password.to_s.length < 1
|
178
|
+
invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
|
179
|
+
end
|
180
|
+
|
181
|
+
invalid_properties
|
182
|
+
end
|
183
|
+
|
184
|
+
# Check to see if the all the properties in the model are valid
|
185
|
+
# @return true if the model is valid
|
186
|
+
def valid?
|
187
|
+
return false if @host.nil?
|
188
|
+
return false if @host.to_s.length < 1
|
189
|
+
return false if @port.nil?
|
190
|
+
return false if @login.nil?
|
191
|
+
return false if @login.to_s.length < 1
|
192
|
+
return false if @security_options.nil?
|
193
|
+
return false if @protocol_type.nil?
|
194
|
+
return false if @storage_file.nil?
|
195
|
+
return false if @password.nil?
|
196
|
+
return false if @password.to_s.length < 1
|
197
|
+
true
|
198
|
+
end
|
199
|
+
|
200
|
+
# Custom attribute writer method with validation
|
201
|
+
# @param [Object] host Value to be assigned
|
202
|
+
def host=(host)
|
203
|
+
if host.nil?
|
204
|
+
fail ArgumentError, 'host cannot be nil'
|
205
|
+
end
|
206
|
+
|
207
|
+
if host.to_s.length < 1
|
208
|
+
fail ArgumentError, 'invalid value for "host", the character length must be great than or equal to 1.'
|
209
|
+
end
|
210
|
+
|
211
|
+
@host = host
|
212
|
+
end
|
213
|
+
|
214
|
+
# Custom attribute writer method with validation
|
215
|
+
# @param [Object] login Value to be assigned
|
216
|
+
def login=(login)
|
217
|
+
if login.nil?
|
218
|
+
fail ArgumentError, 'login cannot be nil'
|
219
|
+
end
|
220
|
+
|
221
|
+
if login.to_s.length < 1
|
222
|
+
fail ArgumentError, 'invalid value for "login", the character length must be great than or equal to 1.'
|
223
|
+
end
|
224
|
+
|
225
|
+
@login = login
|
226
|
+
end
|
227
|
+
|
228
|
+
# Custom attribute writer method with validation
|
229
|
+
# @param [Object] password Value to be assigned
|
230
|
+
def password=(password)
|
231
|
+
if password.nil?
|
232
|
+
fail ArgumentError, 'password cannot be nil'
|
233
|
+
end
|
234
|
+
|
235
|
+
if password.to_s.length < 1
|
236
|
+
fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
|
237
|
+
end
|
238
|
+
|
239
|
+
@password = password
|
240
|
+
end
|
241
|
+
|
242
|
+
# Checks equality by comparing each attribute.
|
243
|
+
# @param [Object] Object to be compared
|
244
|
+
def ==(o)
|
245
|
+
return true if self.equal?(o)
|
246
|
+
self.class == o.class &&
|
247
|
+
host == o.host &&
|
248
|
+
port == o.port &&
|
249
|
+
login == o.login &&
|
250
|
+
security_options == o.security_options &&
|
251
|
+
protocol_type == o.protocol_type &&
|
252
|
+
description == o.description &&
|
253
|
+
storage_file == o.storage_file &&
|
254
|
+
password == o.password
|
255
|
+
end
|
256
|
+
|
257
|
+
# @see the `==` method
|
258
|
+
# @param [Object] Object to be compared
|
259
|
+
def eql?(o)
|
260
|
+
self == o
|
261
|
+
end
|
262
|
+
|
263
|
+
# Calculates hash code according to all attributes.
|
264
|
+
# @return [Fixnum] Hash code
|
265
|
+
def hash
|
266
|
+
[host, port, login, security_options, protocol_type, description, storage_file, password].hash
|
267
|
+
end
|
268
|
+
|
269
|
+
# Builds the object from hash
|
270
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
271
|
+
# @return [Object] Returns the model itself
|
272
|
+
def build_from_hash(attributes)
|
273
|
+
return nil unless attributes.is_a?(Hash)
|
274
|
+
self.class.swagger_types.each_pair do |key, type|
|
275
|
+
attribute_key = self.class.attribute_map[key]
|
276
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
277
|
+
if type =~ /\AArray<(.*)>/i
|
278
|
+
# check to ensure the input is an array given that the the attribute
|
279
|
+
# is documented as an array but the input is not
|
280
|
+
if attributes[attribute_key].is_a?(Array)
|
281
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
282
|
+
end
|
283
|
+
elsif !attributes[attribute_key].nil?
|
284
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
285
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
286
|
+
end
|
287
|
+
|
288
|
+
self
|
289
|
+
end
|
290
|
+
|
291
|
+
# Deserializes the data based on type
|
292
|
+
# @param string type Data type
|
293
|
+
# @param string value Value to be deserialized
|
294
|
+
# @return [Object] Deserialized data
|
295
|
+
def _deserialize(type, value)
|
296
|
+
case type.to_sym
|
297
|
+
when :DateTime
|
298
|
+
DateTime.parse(value)
|
299
|
+
when :Date
|
300
|
+
Date.parse(value)
|
301
|
+
when :String
|
302
|
+
value.to_s
|
303
|
+
when :Integer
|
304
|
+
value.to_i
|
305
|
+
when :Float
|
306
|
+
value.to_f
|
307
|
+
when :BOOLEAN
|
308
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
309
|
+
true
|
310
|
+
else
|
311
|
+
false
|
312
|
+
end
|
313
|
+
when :Object
|
314
|
+
# generic object (usually a Hash), return directly
|
315
|
+
value
|
316
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
317
|
+
inner_type = Regexp.last_match[:inner_type]
|
318
|
+
value.map { |v| _deserialize(inner_type, v) }
|
319
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
320
|
+
k_type = Regexp.last_match[:k_type]
|
321
|
+
v_type = Regexp.last_match[:v_type]
|
322
|
+
{}.tap do |hash|
|
323
|
+
value.each do |k, v|
|
324
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
325
|
+
end
|
326
|
+
end
|
327
|
+
else # model
|
328
|
+
type = value[:type] || type
|
329
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
330
|
+
temp_model.build_from_hash(value)
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
# Returns the string representation of the object
|
335
|
+
# @return [String] String presentation of the object
|
336
|
+
def to_s
|
337
|
+
to_hash.to_s
|
338
|
+
end
|
339
|
+
|
340
|
+
# to_body is an alias to to_hash (backward compatibility)
|
341
|
+
# @return [Hash] Returns the object in the form of hash
|
342
|
+
def to_body
|
343
|
+
to_hash
|
344
|
+
end
|
345
|
+
|
346
|
+
# Returns the object in the form of hash
|
347
|
+
# @return [Hash] Returns the object in the form of hash
|
348
|
+
def to_hash
|
349
|
+
hash = {}
|
350
|
+
self.class.attribute_map.each_pair do |attr, param|
|
351
|
+
value = self.send(attr)
|
352
|
+
next if value.nil?
|
353
|
+
hash[param] = _to_hash(value)
|
354
|
+
end
|
355
|
+
hash
|
356
|
+
end
|
357
|
+
|
358
|
+
# Outputs non-array value in the form of hash
|
359
|
+
# For object, use to_hash. Otherwise, just return the value
|
360
|
+
# @param [Object] value Any valid value
|
361
|
+
# @return [Hash] Returns the value in the form of hash
|
362
|
+
def _to_hash(value)
|
363
|
+
if value.is_a?(Array)
|
364
|
+
value.compact.map { |v| _to_hash(v) }
|
365
|
+
elsif value.is_a?(Hash)
|
366
|
+
{}.tap do |hash|
|
367
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
368
|
+
end
|
369
|
+
elsif value.respond_to? :to_hash
|
370
|
+
value.to_hash
|
371
|
+
else
|
372
|
+
value
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
end
|
377
|
+
end
|