Class: AsposeEmailCloud::EmailApi
- Inherits:
-
Object
- Object
- AsposeEmailCloud::EmailApi
- Defined in:
- lib/aspose-email-cloud/api/email_api.rb
Overview
EmailApi operations.
Instance Attribute Summary collapse
-
#api_invoker ⇒ Object
readonly
Returns the value of attribute api_invoker.
Instance Method Summary collapse
-
#as_file(request) ⇒ File
Converts Email model to a specified format and returns as a file.
-
#as_mapi(email_dto) ⇒ MapiMessageDto
Converts EmailDto to MapiMessageDto.
-
#convert(request) ⇒ File
Converts email document to specified format and returns as file.
-
#from_file(request) ⇒ EmailDto
Converts email document to a model representation.
-
#get(request) ⇒ EmailDto
Get email document from storage.
-
#get_as_file(request) ⇒ File
Converts email document from storage to specified format and returns as file.
-
#get_list(request) ⇒ EmailStorageList
Get email list from storage folder.
-
#initialize(api_invoker) ⇒ EmailApi
constructor
Initializes a new instance of the EmailApi class.
-
#save(request) ⇒ nil
Save email document to storage.
Constructor Details
#initialize(api_invoker) ⇒ EmailApi
Initializes a new instance of the EmailApi class.
45 46 47 |
# File 'lib/aspose-email-cloud/api/email_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/email_api.rb', line 31 def api_invoker @api_invoker end |
Instance Method Details
#as_file(request) ⇒ File
Converts Email model to a specified format and returns as a file.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 52 def as_file(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 EmailApi.as_file" end local_var_path = '/email/as-file' 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(['multipart/form-data']) # 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, 'File') end |
#as_mapi(email_dto) ⇒ MapiMessageDto
Converts EmailDto to MapiMessageDto.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 79 def as_mapi(email_dto) # verify the required parameter 'email_dto' is set if @api_invoker.api_client.config.client_side_validation && email_dto.nil? raise ArgumentError, "Missing the required parameter 'email_dto' when calling EmailApi.as_mapi" end local_var_path = '/email/as-mapi' post_body = @api_invoker.api_client.object_to_http_body(email_dto) 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, 'MapiMessageDto') end |
#convert(request) ⇒ File
Converts email document to specified format and returns as file
106 107 108 109 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 106 def convert(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :PUT, 'File') end |
#from_file(request) ⇒ EmailDto
Converts email document to a model representation
114 115 116 117 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 114 def from_file(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :PUT, 'EmailDto') end |
#get(request) ⇒ EmailDto
Get email document from storage.
122 123 124 125 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 122 def get(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'EmailDto') end |
#get_as_file(request) ⇒ File
Converts email document from storage to specified format and returns as file
130 131 132 133 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 130 def get_as_file(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'File') end |
#get_list(request) ⇒ EmailStorageList
Get email list from storage folder.
138 139 140 141 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 138 def get_list(request) http_request = request.to_http_info(@api_invoker.api_client) @api_invoker.make_request(http_request, :GET, 'EmailStorageList') end |
#save(request) ⇒ nil
Save email document to storage.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/aspose-email-cloud/api/email_api.rb', line 146 def save(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 EmailApi.save" end local_var_path = '/email' 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 |