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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +145 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +577 -0
  4. data/{src/asposeemailcloud → lib/aspose-email-cloud}/api_client.rb +125 -133
  5. data/lib/aspose-email-cloud/api_error.rb +42 -0
  6. data/{src/asposeemailcloud → lib/aspose-email-cloud}/configuration.rb +56 -43
  7. data/lib/aspose-email-cloud/models/account_base_request.rb +250 -0
  8. data/lib/aspose-email-cloud/models/add_attachment_request.rb +219 -0
  9. data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +300 -0
  10. data/lib/aspose-email-cloud/models/append_email_base_request.rb +316 -0
  11. data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +335 -0
  12. data/lib/aspose-email-cloud/models/base_object.rb +225 -0
  13. data/lib/aspose-email-cloud/models/contact_format.rb +45 -0
  14. data/lib/aspose-email-cloud/models/create_email_request.rb +224 -0
  15. data/lib/aspose-email-cloud/models/create_folder_base_request.rb +297 -0
  16. data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +302 -0
  17. data/lib/aspose-email-cloud/models/delete_message_base_request.rb +302 -0
  18. data/lib/aspose-email-cloud/models/disc_usage.rb +229 -0
  19. data/lib/aspose-email-cloud/models/email_account_request.rb +342 -0
  20. data/lib/aspose-email-cloud/models/email_document.rb +226 -0
  21. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_document_response.rb +105 -109
  22. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_properties.rb +122 -97
  23. data/lib/aspose-email-cloud/models/email_property.rb +256 -0
  24. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_property_response.rb +105 -109
  25. data/lib/aspose-email-cloud/models/error.rb +241 -0
  26. data/lib/aspose-email-cloud/models/error_details.rb +224 -0
  27. data/lib/aspose-email-cloud/models/file_version.rb +289 -0
  28. data/lib/aspose-email-cloud/models/file_versions.rb +210 -0
  29. data/lib/aspose-email-cloud/models/files_list.rb +210 -0
  30. data/lib/aspose-email-cloud/models/files_upload_result.rb +223 -0
  31. data/lib/aspose-email-cloud/models/hierarchical_object.rb +238 -0
  32. data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +224 -0
  33. data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +219 -0
  34. data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +254 -0
  35. data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +252 -0
  36. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/link.rb +138 -116
  37. data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +208 -0
  38. data/{src/asposeemailcloud/models/email_document.rb → lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb} +105 -98
  39. data/{src/asposeemailcloud/models/list_folders_response.rb → lib/aspose-email-cloud/models/list_response_of_string.rb} +105 -111
  40. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mail_server_folder.rb +116 -96
  41. data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mime_response.rb +105 -109
  42. data/lib/aspose-email-cloud/models/object_exist.rb +229 -0
  43. data/lib/aspose-email-cloud/models/primitive_object.rb +236 -0
  44. data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +89 -0
  45. data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +101 -0
  46. data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +89 -0
  47. data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +89 -0
  48. data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +75 -0
  49. data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +75 -0
  50. data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +92 -0
  51. data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +89 -0
  52. data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +82 -0
  53. data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +94 -0
  54. data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +75 -0
  55. data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +82 -0
  56. data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +78 -0
  57. data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +82 -0
  58. data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +96 -0
  59. data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +108 -0
  60. data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +75 -0
  61. data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +75 -0
  62. data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +81 -0
  63. data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +81 -0
  64. data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +89 -0
  65. data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +82 -0
  66. data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +81 -0
  67. data/lib/aspose-email-cloud/models/requests/email_request.rb +75 -0
  68. data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +93 -0
  69. data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +88 -0
  70. data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +95 -0
  71. data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +81 -0
  72. data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +100 -0
  73. data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +92 -0
  74. data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +93 -0
  75. data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +71 -0
  76. data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +88 -0
  77. data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +88 -0
  78. data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +81 -0
  79. data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +78 -0
  80. data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +78 -0
  81. data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +88 -0
  82. data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +81 -0
  83. data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +80 -0
  84. data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +81 -0
  85. data/lib/aspose-email-cloud/models/requests/http_request.rb +51 -0
  86. data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +88 -0
  87. data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +105 -0
  88. data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +92 -0
  89. data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +89 -0
  90. data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +81 -0
  91. data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +75 -0
  92. data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +75 -0
  93. data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +75 -0
  94. data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +75 -0
  95. data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +89 -0
  96. data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +75 -0
  97. data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +75 -0
  98. data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +82 -0
  99. data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +94 -0
  100. data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +82 -0
  101. data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +87 -0
  102. data/lib/aspose-email-cloud/models/save_email_account_request.rb +377 -0
  103. data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +447 -0
  104. data/lib/aspose-email-cloud/models/send_email_base_request.rb +267 -0
  105. data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +286 -0
  106. data/lib/aspose-email-cloud/models/set_email_property_request.rb +224 -0
  107. data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +302 -0
  108. data/{src/asposeemailcloud/models/email_property.rb → lib/aspose-email-cloud/models/storage_exist.rb} +110 -96
  109. data/lib/aspose-email-cloud/models/storage_file.rb +262 -0
  110. data/lib/aspose-email-cloud/models/storage_file_location.rb +254 -0
  111. data/lib/aspose-email-cloud/models/storage_folder_location.rb +219 -0
  112. data/{src/asposeemailcloud/models/list_response.rb → lib/aspose-email-cloud/models/value_response.rb} +105 -111
  113. data/{src/asposeemailcloud → lib/aspose-email-cloud}/version.rb +4 -4
  114. metadata +128 -38
  115. data/src/asposeemailcloud.rb +0 -55
  116. data/src/asposeemailcloud/api/email_api.rb +0 -418
  117. data/src/asposeemailcloud/api/email_client_api.rb +0 -960
  118. data/src/asposeemailcloud/api_error.rb +0 -38
  119. data/src/asposeemailcloud/models/http_status_code.rb +0 -76
  120. data/src/asposeemailcloud/models/protocol_type.rb +0 -34
  121. data/src/asposeemailcloud/models/saa_spose_response.rb +0 -202
  122. data/src/asposeemailcloud/models/security_options.rb +0 -33
@@ -0,0 +1,81 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="delete_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 delete_file operation.
33
+ class DeleteFileRequestData < EmailRequest
34
+
35
+ # Delete file
36
+ # @param [String] path File path e.g. &#39;/folder/file.ext&#39;
37
+ # @param [String] storage_name Storage name
38
+ # @param [String] version_id File version ID to delete
39
+ def initialize(path, storage_name = nil, version_id = nil)
40
+ @path = path
41
+ @storage_name = storage_name
42
+ @version_id = version_id
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.delete_file"
49
+ end
50
+
51
+ # resource path
52
+ local_var_path = '/email/storage/file/{path}'.sub('{' + 'path' + '}', @path.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+ query_params[:storageName] = @storage_name unless @storage_name.nil?
57
+ query_params[:versionId] = @version_id unless @version_id.nil?
58
+
59
+ # form parameters
60
+ form_params = {}
61
+
62
+ # http body (model)
63
+ post_body = nil
64
+ auth_names = ['JWT']
65
+
66
+ # header parameters
67
+ header_params = {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = select_header_accept(['application/json'])
70
+ # HTTP header 'Content-Type'
71
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
72
+
73
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
74
+ header_params,
75
+ query_params,
76
+ form_params,
77
+ post_body,
78
+ auth_names)
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,81 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="delete_folder_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 delete_folder operation.
33
+ class DeleteFolderRequestData < EmailRequest
34
+
35
+ # Delete folder
36
+ # @param [String] path Folder path e.g. &#39;/folder&#39;
37
+ # @param [String] storage_name Storage name
38
+ # @param [BOOLEAN] recursive Enable to delete folders, subfolders and files
39
+ def initialize(path, storage_name = nil, recursive = nil)
40
+ @path = path
41
+ @storage_name = storage_name
42
+ @recursive = recursive
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.delete_folder"
49
+ end
50
+
51
+ # resource path
52
+ local_var_path = '/email/storage/folder/{path}'.sub('{' + 'path' + '}', @path.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+ query_params[:storageName] = @storage_name unless @storage_name.nil?
57
+ query_params[:recursive] = @recursive unless @recursive.nil?
58
+
59
+ # form parameters
60
+ form_params = {}
61
+
62
+ # http body (model)
63
+ post_body = nil
64
+ auth_names = ['JWT']
65
+
66
+ # header parameters
67
+ header_params = {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = select_header_accept(['application/json'])
70
+ # HTTP header 'Content-Type'
71
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
72
+
73
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
74
+ header_params,
75
+ query_params,
76
+ form_params,
77
+ post_body,
78
+ auth_names)
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,89 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="delete_mapi_attachment_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 delete_mapi_attachment operation.
33
+ class DeleteMapiAttachmentRequestData < EmailRequest
34
+
35
+ # Remove attachment from document
36
+ # @param [String] name Document file name
37
+ # @param [String] attachment Attachment name or index
38
+ # @param [StorageFolderLocation] storage Document file storage location info
39
+ def initialize(name, attachment, storage)
40
+ @name = name
41
+ @attachment = attachment
42
+ @storage = storage
43
+ end
44
+
45
+ def to_http_info(api_client)
46
+ # verify the required parameter 'name' is set
47
+ if api_client.config.client_side_validation && @name.nil?
48
+ raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.delete_mapi_attachment"
49
+ end
50
+
51
+ # verify the required parameter 'attachment' is set
52
+ if api_client.config.client_side_validation && @attachment.nil?
53
+ raise ArgumentError, "Missing the required parameter 'attachment' when calling EmailApi.delete_mapi_attachment"
54
+ end
55
+
56
+ # verify the required parameter 'storage' is set
57
+ if api_client.config.client_side_validation && @storage.nil?
58
+ raise ArgumentError, "Missing the required parameter 'storage' when calling EmailApi.delete_mapi_attachment"
59
+ end
60
+
61
+ # resource path
62
+ local_var_path = '/email/Mapi/{name}/attachments/{attachment}'.sub('{' + 'name' + '}', @name.to_s).sub('{' + 'attachment' + '}', @attachment.to_s)
63
+
64
+ # query parameters
65
+ query_params = {}
66
+
67
+ # form parameters
68
+ form_params = {}
69
+
70
+ # http body (model)
71
+ post_body = api_client.object_to_http_body(@storage)
72
+ auth_names = ['JWT']
73
+
74
+ # header parameters
75
+ header_params = {}
76
+ # HTTP header 'Accept' (if needed)
77
+ header_params['Accept'] = select_header_accept(['application/json'])
78
+ # HTTP header 'Content-Type'
79
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
80
+
81
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
82
+ header_params,
83
+ query_params,
84
+ form_params,
85
+ post_body,
86
+ auth_names)
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,82 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="delete_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 delete_mapi_properties operation.
33
+ class DeleteMapiPropertiesRequestData < EmailRequest
34
+
35
+ # Delete document properties
36
+ # @param [String] name Document file name
37
+ # @param [HierarchicalObjectRequest] request Properties that should be deleted
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.delete_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.delete_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,81 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="download_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 download_file operation.
33
+ class DownloadFileRequestData < EmailRequest
34
+
35
+ # Download file
36
+ # @param [String] path File path e.g. &#39;/folder/file.ext&#39;
37
+ # @param [String] storage_name Storage name
38
+ # @param [String] version_id File version ID to download
39
+ def initialize(path, storage_name = nil, version_id = nil)
40
+ @path = path
41
+ @storage_name = storage_name
42
+ @version_id = version_id
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.download_file"
49
+ end
50
+
51
+ # resource path
52
+ local_var_path = '/email/storage/file/{path}'.sub('{' + 'path' + '}', @path.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+ query_params[:storageName] = @storage_name unless @storage_name.nil?
57
+ query_params[:versionId] = @version_id unless @version_id.nil?
58
+
59
+ # form parameters
60
+ form_params = {}
61
+
62
+ # http body (model)
63
+ post_body = nil
64
+ auth_names = ['JWT']
65
+
66
+ # header parameters
67
+ header_params = {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = select_header_accept(['multipart/form-data'])
70
+ # HTTP header 'Content-Type'
71
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
72
+
73
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
74
+ header_params,
75
+ query_params,
76
+ form_params,
77
+ post_body,
78
+ auth_names)
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,75 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="email_request.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
+ module AsposeEmailCloud
29
+
30
+ # Base class for requests with basic operations
31
+ class EmailRequest
32
+ def to_http_info(config); end
33
+
34
+ protected
35
+
36
+ # Return Accept header based on an array of accepts provided.
37
+ # @param [Array] accepts array for Accept
38
+ # @return [String] the Accept header (e.g. application/json)
39
+ def select_header_accept(accepts)
40
+ return nil if accepts.nil? || accepts.empty?
41
+
42
+ # use JSON when present, otherwise use all of the provided
43
+ json_accept = accepts.find { |s| json_mime?(s) }
44
+ json_accept || accepts.join(',')
45
+ end
46
+
47
+ # Return Content-Type header based on an array of content types provided.
48
+ # @param [Array] content_types array for Content-Type
49
+ # @return [String] the Content-Type header (e.g. application/json)
50
+ def select_header_content_type(content_types)
51
+ # use application/json by default
52
+ return 'application/json' if content_types.nil? || content_types.empty?
53
+
54
+ # use JSON when present, otherwise use the first one
55
+ json_content_type = content_types.find { |s| json_mime?(s) }
56
+ json_content_type || content_types.first
57
+ end
58
+
59
+ private
60
+
61
+ # Check if the given MIME is a JSON MIME.
62
+ # JSON MIME examples:
63
+ # application/json
64
+ # application/json; charset=UTF8
65
+ # APPLICATION/JSON
66
+ # */*
67
+ # @param [String] mime MIME
68
+ # @return [Boolean] True if the MIME is application/json
69
+ def json_mime?(mime)
70
+ (mime == '*/*') || !(mime =~ %r{Application/.*json(?!p)(;.*)?}i).nil?
71
+ end
72
+ end
73
+ end
74
+
75
+