Class: MailSlurpClient::AttachmentControllerApi
- Inherits:
-
Object
- Object
- MailSlurpClient::AttachmentControllerApi
- Defined in:
- lib/mailslurp_client/api/attachment_controller_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_all_attachments(opts = {}) ⇒ nil
Delete all attachments.
-
#delete_all_attachments_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete all attachments.
-
#delete_attachment(attachment_id, opts = {}) ⇒ nil
Delete an attachment.
-
#delete_attachment_with_http_info(attachment_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an attachment.
-
#download_attachment_as_base64_encoded(attachment_id, opts = {}) ⇒ DownloadAttachmentDto
Get email attachment as base64 encoded string as alternative to binary responses.
-
#download_attachment_as_base64_encoded_with_http_info(attachment_id, opts = {}) ⇒ Array<(DownloadAttachmentDto, Integer, Hash)>
Get email attachment as base64 encoded string as alternative to binary responses.
-
#download_attachment_as_bytes(attachment_id, opts = {}) ⇒ String
Download attachments.
-
#download_attachment_as_bytes_with_http_info(attachment_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download attachments.
-
#get_attachment(attachment_id, opts = {}) ⇒ AttachmentEntity
Get an attachment entity.
-
#get_attachment_info(attachment_id, opts = {}) ⇒ AttachmentMetaData
Get email attachment metadata information Returns the metadata for an attachment.
-
#get_attachment_info_with_http_info(attachment_id, opts = {}) ⇒ Array<(AttachmentMetaData, Integer, Hash)>
Get email attachment metadata information Returns the metadata for an attachment.
-
#get_attachment_with_http_info(attachment_id, opts = {}) ⇒ Array<(AttachmentEntity, Integer, Hash)>
Get an attachment entity.
-
#get_attachments(opts = {}) ⇒ PageAttachmentEntity
Get email attachments Get all attachments in paginated response.
-
#get_attachments_with_http_info(opts = {}) ⇒ Array<(PageAttachmentEntity, Integer, Hash)>
Get email attachments Get all attachments in paginated response.
-
#initialize(api_client = ApiClient.default) ⇒ AttachmentControllerApi
constructor
A new instance of AttachmentControllerApi.
-
#upload_attachment(upload_attachment_options, opts = {}) ⇒ Array<String>
Upload an attachment for sending using base64 file encoding.
-
#upload_attachment_bytes(opts = {}) ⇒ Array<String>
Upload an attachment for sending using file byte stream input octet stream.
-
#upload_attachment_bytes_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using file byte stream input octet stream.
-
#upload_attachment_with_http_info(upload_attachment_options, opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using base64 file encoding.
-
#upload_multipart_form(opts = {}) ⇒ Array<String>
Upload an attachment for sending using a Multipart Form request.
-
#upload_multipart_form_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using a Multipart Form request.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AttachmentControllerApi
Returns a new instance of AttachmentControllerApi.
19 20 21 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_all_attachments(opts = {}) ⇒ nil
Delete all attachments
25 26 27 28 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 25 def (opts = {}) (opts) nil end |
#delete_all_attachments_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete all attachments
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 33 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.delete_all_attachments ...' end # resource path local_var_path = '/attachments' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#delete_all_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_attachment(attachment_id, opts = {}) ⇒ nil
Delete an attachment
78 79 80 81 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 78 def (, opts = {}) (, opts) nil end |
#delete_attachment_with_http_info(attachment_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete an attachment
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 87 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.delete_attachment ...' end # verify the required parameter 'attachment_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.delete_attachment" end # resource path local_var_path = '/attachments/{attachmentId}'.sub('{' + 'attachmentId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#delete_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_attachment_as_base64_encoded(attachment_id, opts = {}) ⇒ DownloadAttachmentDto
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
137 138 139 140 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 137 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#download_attachment_as_base64_encoded_with_http_info(attachment_id, opts = {}) ⇒ Array<(DownloadAttachmentDto, Integer, Hash)>
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 147 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.download_attachment_as_base64_encoded ...' end # verify the required parameter 'attachment_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.download_attachment_as_base64_encoded" end # resource path local_var_path = '/attachments/{attachmentId}/base64'.sub('{' + 'attachmentId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'DownloadAttachmentDto' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#download_attachment_as_base64_encoded\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_attachment_as_bytes(attachment_id, opts = {}) ⇒ String
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
199 200 201 202 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 199 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#download_attachment_as_bytes_with_http_info(attachment_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 209 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.download_attachment_as_bytes ...' end # verify the required parameter 'attachment_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.download_attachment_as_bytes" end # resource path local_var_path = '/attachments/{attachmentId}/bytes'.sub('{' + 'attachmentId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#download_attachment_as_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_attachment(attachment_id, opts = {}) ⇒ AttachmentEntity
Get an attachment entity
260 261 262 263 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 260 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#get_attachment_info(attachment_id, opts = {}) ⇒ AttachmentMetaData
Get email attachment metadata information Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
321 322 323 324 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 321 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#get_attachment_info_with_http_info(attachment_id, opts = {}) ⇒ Array<(AttachmentMetaData, Integer, Hash)>
Get email attachment metadata information Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 331 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.get_attachment_info ...' end # verify the required parameter 'attachment_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.get_attachment_info" end # resource path local_var_path = '/attachments/{attachmentId}/metadata'.sub('{' + 'attachmentId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AttachmentMetaData' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#get_attachment_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_attachment_with_http_info(attachment_id, opts = {}) ⇒ Array<(AttachmentEntity, Integer, Hash)>
Get an attachment entity
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 269 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.get_attachment ...' end # verify the required parameter 'attachment_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentControllerApi.get_attachment" end # resource path local_var_path = '/attachments/{attachmentId}'.sub('{' + 'attachmentId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AttachmentEntity' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#get_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_attachments(opts = {}) ⇒ PageAttachmentEntity
Get email attachments Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
389 390 391 392 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 389 def (opts = {}) data, _status_code, _headers = (opts) data end |
#get_attachments_with_http_info(opts = {}) ⇒ Array<(PageAttachmentEntity, Integer, Hash)>
Get email attachments Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 405 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.get_attachments ...' end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/attachments' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'fileNameFilter'] = opts[:'file_name_filter'] if !opts[:'file_name_filter'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageAttachmentEntity' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#get_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_attachment(upload_attachment_options, opts = {}) ⇒ Array<String>
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
463 464 465 466 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 463 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#upload_attachment_bytes(opts = {}) ⇒ Array<String>
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
529 530 531 532 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 529 def (opts = {}) data, _status_code, _headers = (opts) data end |
#upload_attachment_bytes_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 542 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.upload_attachment_bytes ...' end # resource path local_var_path = '/attachments/bytes' # query parameters query_params = opts[:query_params] || {} query_params[:'contentType'] = opts[:'content_type2'] if !opts[:'content_type2'].nil? query_params[:'contentId'] = opts[:'content_id'] if !opts[:'content_id'].nil? query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'contentType'] = opts[:'content_type'] if !opts[:'content_type'].nil? header_params[:'filename'] = opts[:'filename2'] if !opts[:'filename2'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<String>' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#upload_attachment_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_attachment_with_http_info(upload_attachment_options, opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 472 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.upload_attachment ...' end # verify the required parameter 'upload_attachment_options' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'upload_attachment_options' when calling AttachmentControllerApi.upload_attachment" end # resource path local_var_path = '/attachments' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body() # return_type return_type = opts[:return_type] || 'Array<String>' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_multipart_form(opts = {}) ⇒ Array<String>
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
598 599 600 601 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 598 def upload_multipart_form(opts = {}) data, _status_code, _headers = upload_multipart_form_with_http_info(opts) data end |
#upload_multipart_form_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'lib/mailslurp_client/api/attachment_controller_api.rb', line 611 def upload_multipart_form_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttachmentControllerApi.upload_multipart_form ...' end # resource path local_var_path = '/attachments/multipart' # query parameters query_params = opts[:query_params] || {} query_params[:'contentId'] = opts[:'content_id'] if !opts[:'content_id'].nil? query_params[:'contentType'] = opts[:'content_type'] if !opts[:'content_type'].nil? query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil? query_params[:'x-filename'] = opts[:'x_filename'] if !opts[:'x_filename'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'inline_object']) # return_type return_type = opts[:return_type] || 'Array<String>' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttachmentControllerApi#upload_multipart_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |