mailslurp_client 8.2.4 → 8.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d43cd1bb1d8721e84b8b669cd5de147a6dfff0214b63ac5d7c6a65e54bc3138f
|
4
|
+
data.tar.gz: 48406a14cca23deea240502513a688b5d4e8986a369bfe8f829684ad663e28b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 385962cfa9c007605b9a86960a4fd4b5156fe49f779187e0a28d9098b8b02967ded75affa329a04cc536c0f07b439a9581e61ca2ef54b24e667fa0319ba7b3b6
|
7
|
+
data.tar.gz: 96e637f3f737c2b516d55026c66cdd10341ca902cc79f18e756f607d691682973972062f266b76dc5bf0d6aa8b68c2c4d234ed6d1e5a241563db678ecc94ad43
|
data/README.md
CHANGED
@@ -13,11 +13,13 @@ MailSlurp is an email API service that lets you create real email addresses in c
|
|
13
13
|
## Get started
|
14
14
|
|
15
15
|
::: tip
|
16
|
+
|
16
17
|
This section describes how to get up and running with the Ruby client.
|
17
18
|
|
18
19
|
See the [examples page](https://www.mailslurp.com/examples/) for more examples and use with common frameworks such as Rails and RSpec.
|
19
20
|
|
20
21
|
See the method documentation for a [list of all functions](./docs)
|
22
|
+
|
21
23
|
:::
|
22
24
|
|
23
25
|
### Create API Key
|
@@ -169,7 +171,9 @@ expect(email.body).to include("Your email body")
|
|
169
171
|
You can send attachments by first uploading files with the `AttachmentControllerApi` then using the returned attachment IDs in the send email method.
|
170
172
|
|
171
173
|
::: tip
|
174
|
+
|
172
175
|
MailSlurp endpoints use base64 string encoding for upload and download files. To encode or decode strings in Ruby make sure you use the **strict** variables that avoid added newlines.
|
176
|
+
|
173
177
|
:::
|
174
178
|
|
175
179
|
#### Upload and send
|
@@ -19,8 +19,8 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Upload an attachment for sending
|
23
|
-
# When sending emails with attachments first upload each attachment with
|
22
|
+
# Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
|
23
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
24
24
|
# @param upload_options [UploadAttachmentOptions] uploadOptions
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @return [Array<String>]
|
@@ -29,8 +29,8 @@ module MailSlurpClient
|
|
29
29
|
data
|
30
30
|
end
|
31
31
|
|
32
|
-
# Upload an attachment for sending
|
33
|
-
# When sending emails with attachments first upload each attachment with
|
32
|
+
# Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
|
33
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
34
34
|
# @param upload_options [UploadAttachmentOptions] uploadOptions
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
@@ -83,26 +83,92 @@ module MailSlurpClient
|
|
83
83
|
return data, status_code, headers
|
84
84
|
end
|
85
85
|
|
86
|
-
# Upload an attachment for sending using
|
87
|
-
# When sending emails with attachments first upload each attachment with
|
86
|
+
# 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.
|
87
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
88
|
+
# @param [Hash] opts the optional parameters
|
89
|
+
# @option opts [String] :string Optional contentType for file. For instance `application/pdf`
|
90
|
+
# @option opts [String] :filename Optional filename to save upload with
|
91
|
+
# @option opts [String] :byte_array Byte array request body
|
92
|
+
# @return [Array<String>]
|
93
|
+
def upload_attachment_bytes(opts = {})
|
94
|
+
data, _status_code, _headers = upload_attachment_bytes_with_http_info(opts)
|
95
|
+
data
|
96
|
+
end
|
97
|
+
|
98
|
+
# 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.
|
99
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @option opts [String] :string Optional contentType for file. For instance `application/pdf`
|
102
|
+
# @option opts [String] :filename Optional filename to save upload with
|
103
|
+
# @option opts [String] :byte_array Byte array request body
|
104
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
105
|
+
def upload_attachment_bytes_with_http_info(opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: AttachmentControllerApi.upload_attachment_bytes ...'
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/attachments/bytes'
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
query_params[:'String'] = opts[:'string'] if !opts[:'string'].nil?
|
115
|
+
query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil?
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
# HTTP header 'Content-Type'
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
|
123
|
+
|
124
|
+
# form parameters
|
125
|
+
form_params = opts[:form_params] || {}
|
126
|
+
|
127
|
+
# http body (model)
|
128
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'byte_array'])
|
129
|
+
|
130
|
+
# return_type
|
131
|
+
return_type = opts[:return_type] || 'Array<String>'
|
132
|
+
|
133
|
+
# auth_names
|
134
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
135
|
+
|
136
|
+
new_options = opts.merge(
|
137
|
+
:header_params => header_params,
|
138
|
+
:query_params => query_params,
|
139
|
+
:form_params => form_params,
|
140
|
+
:body => post_body,
|
141
|
+
:auth_names => auth_names,
|
142
|
+
:return_type => return_type
|
143
|
+
)
|
144
|
+
|
145
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
146
|
+
if @api_client.config.debugging
|
147
|
+
@api_client.config.logger.debug "API called: AttachmentControllerApi#upload_attachment_bytes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
148
|
+
end
|
149
|
+
return data, status_code, headers
|
150
|
+
end
|
151
|
+
|
152
|
+
# Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
|
153
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
88
154
|
# @param file [File] file
|
89
155
|
# @param [Hash] opts the optional parameters
|
90
|
-
# @option opts [String] :content_type
|
91
|
-
# @option opts [String] :filename
|
92
|
-
# @option opts [String] :x_filename
|
156
|
+
# @option opts [String] :content_type Optional content type of attachment
|
157
|
+
# @option opts [String] :filename Optional name of file
|
158
|
+
# @option opts [String] :x_filename Optional content type header of attachment
|
93
159
|
# @return [Array<String>]
|
94
160
|
def upload_multipart_form(file, opts = {})
|
95
161
|
data, _status_code, _headers = upload_multipart_form_with_http_info(file, opts)
|
96
162
|
data
|
97
163
|
end
|
98
164
|
|
99
|
-
# Upload an attachment for sending using Multipart Form
|
100
|
-
# When sending emails with attachments first upload each attachment with
|
165
|
+
# Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
|
166
|
+
# When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
|
101
167
|
# @param file [File] file
|
102
168
|
# @param [Hash] opts the optional parameters
|
103
|
-
# @option opts [String] :content_type
|
104
|
-
# @option opts [String] :filename
|
105
|
-
# @option opts [String] :x_filename
|
169
|
+
# @option opts [String] :content_type Optional content type of attachment
|
170
|
+
# @option opts [String] :filename Optional name of file
|
171
|
+
# @option opts [String] :x_filename Optional content type header of attachment
|
106
172
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
107
173
|
def upload_multipart_form_with_http_info(file, opts = {})
|
108
174
|
if @api_client.config.debugging
|
@@ -75,7 +75,7 @@ module MailSlurpClient
|
|
75
75
|
|
76
76
|
# Delete an email
|
77
77
|
# Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
|
78
|
-
# @param email_id [String]
|
78
|
+
# @param email_id [String] ID of email to delete
|
79
79
|
# @param [Hash] opts the optional parameters
|
80
80
|
# @return [nil]
|
81
81
|
def delete_email(email_id, opts = {})
|
@@ -85,7 +85,7 @@ module MailSlurpClient
|
|
85
85
|
|
86
86
|
# Delete an email
|
87
87
|
# Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
|
88
|
-
# @param email_id [String]
|
88
|
+
# @param email_id [String] ID of email to delete
|
89
89
|
# @param [Hash] opts the optional parameters
|
90
90
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
91
91
|
def delete_email_with_http_info(email_id, opts = {})
|
@@ -135,8 +135,8 @@ module MailSlurpClient
|
|
135
135
|
|
136
136
|
# Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
|
137
137
|
# 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.
|
138
|
-
# @param attachment_id [String]
|
139
|
-
# @param email_id [String]
|
138
|
+
# @param attachment_id [String] ID of attachment
|
139
|
+
# @param email_id [String] ID of email
|
140
140
|
# @param [Hash] opts the optional parameters
|
141
141
|
# @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly.
|
142
142
|
# @return [String]
|
@@ -147,8 +147,8 @@ module MailSlurpClient
|
|
147
147
|
|
148
148
|
# Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
|
149
149
|
# 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.
|
150
|
-
# @param attachment_id [String]
|
151
|
-
# @param email_id [String]
|
150
|
+
# @param attachment_id [String] ID of attachment
|
151
|
+
# @param email_id [String] ID of email
|
152
152
|
# @param [Hash] opts the optional parameters
|
153
153
|
# @option opts [String] :api_key Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly.
|
154
154
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
@@ -206,8 +206,8 @@ module MailSlurpClient
|
|
206
206
|
|
207
207
|
# Get email attachment as base64 encoded string (alternative to binary responses)
|
208
208
|
# 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.
|
209
|
-
# @param attachment_id [String]
|
210
|
-
# @param email_id [String]
|
209
|
+
# @param attachment_id [String] ID of attachment
|
210
|
+
# @param email_id [String] ID of email
|
211
211
|
# @param [Hash] opts the optional parameters
|
212
212
|
# @return [DownloadAttachmentDto]
|
213
213
|
def download_attachment_base64(attachment_id, email_id, opts = {})
|
@@ -217,8 +217,8 @@ module MailSlurpClient
|
|
217
217
|
|
218
218
|
# Get email attachment as base64 encoded string (alternative to binary responses)
|
219
219
|
# 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.
|
220
|
-
# @param attachment_id [String]
|
221
|
-
# @param email_id [String]
|
220
|
+
# @param attachment_id [String] ID of attachment
|
221
|
+
# @param email_id [String] ID of email
|
222
222
|
# @param [Hash] opts the optional parameters
|
223
223
|
# @return [Array<(DownloadAttachmentDto, Integer, Hash)>] DownloadAttachmentDto data, response status code and response headers
|
224
224
|
def download_attachment_base64_with_http_info(attachment_id, email_id, opts = {})
|
@@ -274,7 +274,7 @@ module MailSlurpClient
|
|
274
274
|
|
275
275
|
# Forward email
|
276
276
|
# Forward an existing email to new recipients.
|
277
|
-
# @param email_id [String]
|
277
|
+
# @param email_id [String] ID of email
|
278
278
|
# @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
|
279
279
|
# @param [Hash] opts the optional parameters
|
280
280
|
# @return [nil]
|
@@ -285,7 +285,7 @@ module MailSlurpClient
|
|
285
285
|
|
286
286
|
# Forward email
|
287
287
|
# Forward an existing email to new recipients.
|
288
|
-
# @param email_id [String]
|
288
|
+
# @param email_id [String] ID of email
|
289
289
|
# @param forward_email_options [ForwardEmailOptions] forwardEmailOptions
|
290
290
|
# @param [Hash] opts the optional parameters
|
291
291
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
@@ -342,8 +342,8 @@ module MailSlurpClient
|
|
342
342
|
|
343
343
|
# Get email attachment metadata
|
344
344
|
# Returns the metadata such as name and content-type for a given attachment and email.
|
345
|
-
# @param attachment_id [String]
|
346
|
-
# @param email_id [String]
|
345
|
+
# @param attachment_id [String] ID of attachment
|
346
|
+
# @param email_id [String] ID of email
|
347
347
|
# @param [Hash] opts the optional parameters
|
348
348
|
# @return [AttachmentMetaData]
|
349
349
|
def get_attachment_meta_data(attachment_id, email_id, opts = {})
|
@@ -353,8 +353,8 @@ module MailSlurpClient
|
|
353
353
|
|
354
354
|
# Get email attachment metadata
|
355
355
|
# Returns the metadata such as name and content-type for a given attachment and email.
|
356
|
-
# @param attachment_id [String]
|
357
|
-
# @param email_id [String]
|
356
|
+
# @param attachment_id [String] ID of attachment
|
357
|
+
# @param email_id [String] ID of email
|
358
358
|
# @param [Hash] opts the optional parameters
|
359
359
|
# @return [Array<(AttachmentMetaData, Integer, Hash)>] AttachmentMetaData data, response status code and response headers
|
360
360
|
def get_attachment_meta_data_with_http_info(attachment_id, email_id, opts = {})
|
@@ -410,7 +410,7 @@ module MailSlurpClient
|
|
410
410
|
|
411
411
|
# Get all email attachment metadata
|
412
412
|
# Returns an array of attachment metadata such as name and content-type for a given email if present.
|
413
|
-
# @param email_id [String]
|
413
|
+
# @param email_id [String] ID of email
|
414
414
|
# @param [Hash] opts the optional parameters
|
415
415
|
# @return [Array<AttachmentMetaData>]
|
416
416
|
def get_attachments(email_id, opts = {})
|
@@ -420,7 +420,7 @@ module MailSlurpClient
|
|
420
420
|
|
421
421
|
# Get all email attachment metadata
|
422
422
|
# Returns an array of attachment metadata such as name and content-type for a given email if present.
|
423
|
-
# @param email_id [String]
|
423
|
+
# @param email_id [String] ID of email
|
424
424
|
# @param [Hash] opts the optional parameters
|
425
425
|
# @return [Array<(Array<AttachmentMetaData>, Integer, Hash)>] Array<AttachmentMetaData> data, response status code and response headers
|
426
426
|
def get_attachments_with_http_info(email_id, opts = {})
|
@@ -677,7 +677,7 @@ module MailSlurpClient
|
|
677
677
|
|
678
678
|
# Get raw email string
|
679
679
|
# Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
|
680
|
-
# @param email_id [String]
|
680
|
+
# @param email_id [String] ID of email
|
681
681
|
# @param [Hash] opts the optional parameters
|
682
682
|
# @return [String]
|
683
683
|
def get_raw_email_contents(email_id, opts = {})
|
@@ -687,7 +687,7 @@ module MailSlurpClient
|
|
687
687
|
|
688
688
|
# Get raw email string
|
689
689
|
# Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
|
690
|
-
# @param email_id [String]
|
690
|
+
# @param email_id [String] ID of email
|
691
691
|
# @param [Hash] opts the optional parameters
|
692
692
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
693
693
|
def get_raw_email_contents_with_http_info(email_id, opts = {})
|
@@ -739,7 +739,7 @@ module MailSlurpClient
|
|
739
739
|
|
740
740
|
# Get raw email in JSON
|
741
741
|
# Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
|
742
|
-
# @param email_id [String]
|
742
|
+
# @param email_id [String] ID of email
|
743
743
|
# @param [Hash] opts the optional parameters
|
744
744
|
# @return [RawEmailJson]
|
745
745
|
def get_raw_email_json(email_id, opts = {})
|
@@ -749,7 +749,7 @@ module MailSlurpClient
|
|
749
749
|
|
750
750
|
# Get raw email in JSON
|
751
751
|
# Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
|
752
|
-
# @param email_id [String]
|
752
|
+
# @param email_id [String] ID of email
|
753
753
|
# @param [Hash] opts the optional parameters
|
754
754
|
# @return [Array<(RawEmailJson, Integer, Hash)>] RawEmailJson data, response status code and response headers
|
755
755
|
def get_raw_email_json_with_http_info(email_id, opts = {})
|
@@ -857,7 +857,7 @@ module MailSlurpClient
|
|
857
857
|
|
858
858
|
# Validate email
|
859
859
|
# Validate the HTML content of email if HTML is found. Considered valid if no HTML.
|
860
|
-
# @param email_id [String]
|
860
|
+
# @param email_id [String] ID of email
|
861
861
|
# @param [Hash] opts the optional parameters
|
862
862
|
# @return [ValidationDto]
|
863
863
|
def validate_email(email_id, opts = {})
|
@@ -867,7 +867,7 @@ module MailSlurpClient
|
|
867
867
|
|
868
868
|
# Validate email
|
869
869
|
# Validate the HTML content of email if HTML is found. Considered valid if no HTML.
|
870
|
-
# @param email_id [String]
|
870
|
+
# @param email_id [String] ID of email
|
871
871
|
# @param [Hash] opts the optional parameters
|
872
872
|
# @return [Array<(ValidationDto, Integer, Hash)>] ValidationDto data, response status code and response headers
|
873
873
|
def validate_email_with_http_info(email_id, opts = {})
|