Class: AsposeEmailCloud::ClientThreadApi
- Inherits:
-
Object
- Object
- AsposeEmailCloud::ClientThreadApi
- Defined in:
- lib/aspose-email-cloud/api/client_thread_api.rb
Overview
ClientThreadApi operations.
Instance Attribute Summary collapse
-
#api_invoker ⇒ Object
readonly
Returns the value of attribute api_invoker.
Instance Method Summary collapse
-
#delete(request) ⇒ nil
Delete thread by id.
-
#get_list(request) ⇒ EmailThreadList
Get message threads from folder.
-
#get_messages(request) ⇒ EmailList
Get messages from thread by id.
-
#initialize(api_invoker) ⇒ ClientThreadApi
constructor
Initializes a new instance of the ClientThreadApi class.
-
#move(request) ⇒ nil
Move thread to another folder.
-
#set_is_read(request) ⇒ nil
Mark all messages in thread as read or unread.
Constructor Details
#initialize(api_invoker) ⇒ ClientThreadApi
Initializes a new instance of the ClientThreadApi class.
45 46 47 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 45 def initialize(api_invoker) @api_invoker = api_invoker end |
Instance Attribute Details
#api_invoker ⇒ Object (readonly)
Returns the value of attribute api_invoker.
31 32 33 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 31 def api_invoker @api_invoker end |
Instance Method Details
#delete(request) ⇒ nil
Delete thread by id. All messages from thread will also be deleted.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 52 def delete(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientThreadApi.delete" end local_var_path = '/email/client/thread' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :DELETE, nil) nil end |
#get_list(request) ⇒ EmailThreadList
Get message threads from folder. All messages are partly fetched (without email body and some other fields).
80 81 82 83 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 80 def get_list(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'EmailThreadList') end |
#get_messages(request) ⇒ EmailList
Get messages from thread by id. All messages are fully fetched. For accounts with CacheFile only cached messages will be returned.
88 89 90 91 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 88 def (request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'EmailList') end |
#move(request) ⇒ nil
Move thread to another folder.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 96 def move(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientThreadApi.move" end local_var_path = '/email/client/thread/move' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :PUT, nil) nil end |
#set_is_read(request) ⇒ nil
Mark all messages in thread as read or unread.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/aspose-email-cloud/api/client_thread_api.rb', line 124 def set_is_read(request) # verify the required parameter 'request' is set if @api_invoker.api_client.config.client_side_validation && request.nil? raise ArgumentError, "Missing the required parameter 'request' when calling ClientThreadApi.set_is_read" end local_var_path = '/email/client/thread/set-is-read' post_body = @api_invoker.api_client.object_to_http_body(request) auth_names = ['JWT'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = EmailRequest.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json']) http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path, header_params: header_params, body: post_body, auth_names: auth_names) @api_invoker.make_request(http_request, :PUT, nil) nil end |