sendmux-sending 1.4.0 → 2.0.0

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. metadata +11 -120
  3. data/CHANGELOG.md +0 -41
  4. data/LICENSE +0 -21
  5. data/README.md +0 -112
  6. data/lib/sendmux/sending/client.rb +0 -49
  7. data/lib/sendmux/sending/version.rb +0 -7
  8. data/lib/sendmux/sending.rb +0 -12
  9. data/lib/sendmux_sending_generated/api/attachments_api.rb +0 -370
  10. data/lib/sendmux_sending_generated/api/emails_api.rb +0 -172
  11. data/lib/sendmux_sending_generated/api/meta_api.rb +0 -142
  12. data/lib/sendmux_sending_generated/api_client.rb +0 -447
  13. data/lib/sendmux_sending_generated/api_error.rb +0 -58
  14. data/lib/sendmux_sending_generated/api_model_base.rb +0 -88
  15. data/lib/sendmux_sending_generated/configuration.rb +0 -399
  16. data/lib/sendmux_sending_generated/models/address.rb +0 -215
  17. data/lib/sendmux_sending_generated/models/attachment.rb +0 -103
  18. data/lib/sendmux_sending_generated/models/attachment_upload_data.rb +0 -284
  19. data/lib/sendmux_sending_generated/models/attachment_upload_intent_data.rb +0 -337
  20. data/lib/sendmux_sending_generated/models/attachment_upload_intent_request.rb +0 -279
  21. data/lib/sendmux_sending_generated/models/attachment_upload_intent_response.rb +0 -223
  22. data/lib/sendmux_sending_generated/models/attachment_upload_response.rb +0 -223
  23. data/lib/sendmux_sending_generated/models/batch_result_item.rb +0 -256
  24. data/lib/sendmux_sending_generated/models/batch_send_request.rb +0 -185
  25. data/lib/sendmux_sending_generated/models/batch_send_success_data.rb +0 -192
  26. data/lib/sendmux_sending_generated/models/batch_send_success_response.rb +0 -223
  27. data/lib/sendmux_sending_generated/models/batch_summary.rb +0 -219
  28. data/lib/sendmux_sending_generated/models/connection.rb +0 -273
  29. data/lib/sendmux_sending_generated/models/connection_credential.rb +0 -226
  30. data/lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb +0 -190
  31. data/lib/sendmux_sending_generated/models/connection_response.rb +0 -223
  32. data/lib/sendmux_sending_generated/models/connection_team.rb +0 -190
  33. data/lib/sendmux_sending_generated/models/email_send_request.rb +0 -465
  34. data/lib/sendmux_sending_generated/models/error_detail.rb +0 -251
  35. data/lib/sendmux_sending_generated/models/error_issue.rb +0 -219
  36. data/lib/sendmux_sending_generated/models/error_response.rb +0 -216
  37. data/lib/sendmux_sending_generated/models/inline_attachment.rb +0 -274
  38. data/lib/sendmux_sending_generated/models/meta.rb +0 -165
  39. data/lib/sendmux_sending_generated/models/recipient.rb +0 -214
  40. data/lib/sendmux_sending_generated/models/send_success_data.rb +0 -227
  41. data/lib/sendmux_sending_generated/models/send_success_response.rb +0 -223
  42. data/lib/sendmux_sending_generated/models/success_envelope.rb +0 -190
  43. data/lib/sendmux_sending_generated/models/uploaded_attachment_ref.rb +0 -176
  44. data/lib/sendmux_sending_generated/version.rb +0 -15
  45. data/lib/sendmux_sending_generated.rb +0 -71
@@ -1,370 +0,0 @@
1
- =begin
2
- #Sendmux Sending API
3
-
4
- #Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Sendmux::Sending::Generated
16
- class AttachmentsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Upload bytes to an attachment upload URL
23
- # Upload the exact binary bytes for a previously-created attachment upload URL. This operation uses the short-lived upload token header returned by POST /emails/attachment-uploads, not a Sendmux API key.
24
- # @param x_sendmux_upload_token [String] Short-lived upload token returned by POST /emails/attachment-uploads.
25
- # @param content_length [Integer] Exact number of bytes in the binary request body.
26
- # @param upload_id [String] Upload intent ID returned by POST /emails/attachment-uploads.
27
- # @param body [File]
28
- # @param [Hash] opts the optional parameters
29
- # @return [AttachmentUploadResponse]
30
- def sending_complete_attachment_upload(x_sendmux_upload_token, content_length, upload_id, body, opts = {})
31
- data, _status_code, _headers = sending_complete_attachment_upload_with_http_info(x_sendmux_upload_token, content_length, upload_id, body, opts)
32
- data
33
- end
34
-
35
- # Upload bytes to an attachment upload URL
36
- # Upload the exact binary bytes for a previously-created attachment upload URL. This operation uses the short-lived upload token header returned by POST /emails/attachment-uploads, not a Sendmux API key.
37
- # @param x_sendmux_upload_token [String] Short-lived upload token returned by POST /emails/attachment-uploads.
38
- # @param content_length [Integer] Exact number of bytes in the binary request body.
39
- # @param upload_id [String] Upload intent ID returned by POST /emails/attachment-uploads.
40
- # @param body [File]
41
- # @param [Hash] opts the optional parameters
42
- # @return [Array<(AttachmentUploadResponse, Integer, Hash)>] AttachmentUploadResponse data, response status code and response headers
43
- def sending_complete_attachment_upload_with_http_info(x_sendmux_upload_token, content_length, upload_id, body, opts = {})
44
- if @api_client.config.debugging
45
- @api_client.config.logger.debug 'Calling API: AttachmentsApi.sending_complete_attachment_upload ...'
46
- end
47
- # verify the required parameter 'x_sendmux_upload_token' is set
48
- if @api_client.config.client_side_validation && x_sendmux_upload_token.nil?
49
- fail ArgumentError, "Missing the required parameter 'x_sendmux_upload_token' when calling AttachmentsApi.sending_complete_attachment_upload"
50
- end
51
- # verify the required parameter 'content_length' is set
52
- if @api_client.config.client_side_validation && content_length.nil?
53
- fail ArgumentError, "Missing the required parameter 'content_length' when calling AttachmentsApi.sending_complete_attachment_upload"
54
- end
55
- if @api_client.config.client_side_validation && content_length < 1
56
- fail ArgumentError, 'invalid value for "content_length" when calling AttachmentsApi.sending_complete_attachment_upload, must be greater than or equal to 1.'
57
- end
58
-
59
- # verify the required parameter 'upload_id' is set
60
- if @api_client.config.client_side_validation && upload_id.nil?
61
- fail ArgumentError, "Missing the required parameter 'upload_id' when calling AttachmentsApi.sending_complete_attachment_upload"
62
- end
63
- pattern = Regexp.new(/^upl_[a-z0-9]{24}$/)
64
- if @api_client.config.client_side_validation && upload_id !~ pattern
65
- fail ArgumentError, "invalid value for 'upload_id' when calling AttachmentsApi.sending_complete_attachment_upload, must conform to the pattern #{pattern}."
66
- end
67
-
68
- # verify the required parameter 'body' is set
69
- if @api_client.config.client_side_validation && body.nil?
70
- fail ArgumentError, "Missing the required parameter 'body' when calling AttachmentsApi.sending_complete_attachment_upload"
71
- end
72
- # resource path
73
- local_var_path = '/emails/attachment-uploads/{upload_id}'.sub('{upload_id}', CGI.escape(upload_id.to_s))
74
-
75
- # query parameters
76
- query_params = opts[:query_params] || {}
77
-
78
- # header parameters
79
- header_params = opts[:header_params] || {}
80
- # HTTP header 'Accept' (if needed)
81
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
82
- # HTTP header 'Content-Type'
83
- content_type = @api_client.select_header_content_type(['application/octet-stream'])
84
- if !content_type.nil?
85
- header_params['Content-Type'] = content_type
86
- end
87
- header_params[:'X-Sendmux-Upload-Token'] = x_sendmux_upload_token
88
- header_params[:'Content-Length'] = content_length
89
-
90
- # form parameters
91
- form_params = opts[:form_params] || {}
92
-
93
- # http body (model)
94
- post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
95
-
96
- # return_type
97
- return_type = opts[:debug_return_type] || 'AttachmentUploadResponse'
98
-
99
- # auth_names
100
- auth_names = opts[:debug_auth_names] || []
101
-
102
- new_options = opts.merge(
103
- :operation => :"AttachmentsApi.sending_complete_attachment_upload",
104
- :header_params => header_params,
105
- :query_params => query_params,
106
- :form_params => form_params,
107
- :body => post_body,
108
- :auth_names => auth_names,
109
- :return_type => return_type
110
- )
111
-
112
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
113
- if @api_client.config.debugging
114
- @api_client.config.logger.debug "API called: AttachmentsApi#sending_complete_attachment_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
115
- end
116
- return data, status_code, headers
117
- end
118
-
119
- # Create an attachment upload URL
120
- # Create a short-lived upload URL and token that lets a remote client PUT one binary attachment without exposing the API key on the upload request. Requires `email.send` permission.
121
- # @param attachment_upload_intent_request [AttachmentUploadIntentRequest]
122
- # @param [Hash] opts the optional parameters
123
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
124
- # @return [AttachmentUploadIntentResponse]
125
- def sending_create_attachment_upload(attachment_upload_intent_request, opts = {})
126
- data, _status_code, _headers = sending_create_attachment_upload_with_http_info(attachment_upload_intent_request, opts)
127
- data
128
- end
129
-
130
- # Create an attachment upload URL
131
- # Create a short-lived upload URL and token that lets a remote client PUT one binary attachment without exposing the API key on the upload request. Requires &#x60;email.send&#x60; permission.
132
- # @param attachment_upload_intent_request [AttachmentUploadIntentRequest]
133
- # @param [Hash] opts the optional parameters
134
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
135
- # @return [Array<(AttachmentUploadIntentResponse, Integer, Hash)>] AttachmentUploadIntentResponse data, response status code and response headers
136
- def sending_create_attachment_upload_with_http_info(attachment_upload_intent_request, opts = {})
137
- if @api_client.config.debugging
138
- @api_client.config.logger.debug 'Calling API: AttachmentsApi.sending_create_attachment_upload ...'
139
- end
140
- # verify the required parameter 'attachment_upload_intent_request' is set
141
- if @api_client.config.client_side_validation && attachment_upload_intent_request.nil?
142
- fail ArgumentError, "Missing the required parameter 'attachment_upload_intent_request' when calling AttachmentsApi.sending_create_attachment_upload"
143
- end
144
- if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
145
- fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AttachmentsApi.sending_create_attachment_upload, the character length must be smaller than or equal to 255.'
146
- end
147
-
148
- # resource path
149
- local_var_path = '/emails/attachment-uploads'
150
-
151
- # query parameters
152
- query_params = opts[:query_params] || {}
153
-
154
- # header parameters
155
- header_params = opts[:header_params] || {}
156
- # HTTP header 'Accept' (if needed)
157
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
158
- # HTTP header 'Content-Type'
159
- content_type = @api_client.select_header_content_type(['application/json'])
160
- if !content_type.nil?
161
- header_params['Content-Type'] = content_type
162
- end
163
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
164
-
165
- # form parameters
166
- form_params = opts[:form_params] || {}
167
-
168
- # http body (model)
169
- post_body = opts[:debug_body] || @api_client.object_to_http_body(attachment_upload_intent_request)
170
-
171
- # return_type
172
- return_type = opts[:debug_return_type] || 'AttachmentUploadIntentResponse'
173
-
174
- # auth_names
175
- auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
176
-
177
- new_options = opts.merge(
178
- :operation => :"AttachmentsApi.sending_create_attachment_upload",
179
- :header_params => header_params,
180
- :query_params => query_params,
181
- :form_params => form_params,
182
- :body => post_body,
183
- :auth_names => auth_names,
184
- :return_type => return_type
185
- )
186
-
187
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
188
- if @api_client.config.debugging
189
- @api_client.config.logger.debug "API called: AttachmentsApi#sending_create_attachment_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
- end
191
- return data, status_code, headers
192
- end
193
-
194
- # Get attachment metadata
195
- # Return metadata for a temporary uploaded attachment owned by the authenticated team. File bytes are not returned.
196
- # @param attachment_id [String] Temporary attachment ID returned by an upload endpoint.
197
- # @param [Hash] opts the optional parameters
198
- # @return [AttachmentUploadResponse]
199
- def sending_get_attachment(attachment_id, opts = {})
200
- data, _status_code, _headers = sending_get_attachment_with_http_info(attachment_id, opts)
201
- data
202
- end
203
-
204
- # Get attachment metadata
205
- # Return metadata for a temporary uploaded attachment owned by the authenticated team. File bytes are not returned.
206
- # @param attachment_id [String] Temporary attachment ID returned by an upload endpoint.
207
- # @param [Hash] opts the optional parameters
208
- # @return [Array<(AttachmentUploadResponse, Integer, Hash)>] AttachmentUploadResponse data, response status code and response headers
209
- def sending_get_attachment_with_http_info(attachment_id, opts = {})
210
- if @api_client.config.debugging
211
- @api_client.config.logger.debug 'Calling API: AttachmentsApi.sending_get_attachment ...'
212
- end
213
- # verify the required parameter 'attachment_id' is set
214
- if @api_client.config.client_side_validation && attachment_id.nil?
215
- fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AttachmentsApi.sending_get_attachment"
216
- end
217
- pattern = Regexp.new(/^att_[a-z0-9]{24}$/)
218
- if @api_client.config.client_side_validation && attachment_id !~ pattern
219
- fail ArgumentError, "invalid value for 'attachment_id' when calling AttachmentsApi.sending_get_attachment, must conform to the pattern #{pattern}."
220
- end
221
-
222
- # resource path
223
- local_var_path = '/emails/attachments/{attachment_id}'.sub('{attachment_id}', CGI.escape(attachment_id.to_s))
224
-
225
- # query parameters
226
- query_params = opts[:query_params] || {}
227
-
228
- # header parameters
229
- header_params = opts[:header_params] || {}
230
- # HTTP header 'Accept' (if needed)
231
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
232
-
233
- # form parameters
234
- form_params = opts[:form_params] || {}
235
-
236
- # http body (model)
237
- post_body = opts[:debug_body]
238
-
239
- # return_type
240
- return_type = opts[:debug_return_type] || 'AttachmentUploadResponse'
241
-
242
- # auth_names
243
- auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
244
-
245
- new_options = opts.merge(
246
- :operation => :"AttachmentsApi.sending_get_attachment",
247
- :header_params => header_params,
248
- :query_params => query_params,
249
- :form_params => form_params,
250
- :body => post_body,
251
- :auth_names => auth_names,
252
- :return_type => return_type
253
- )
254
-
255
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
256
- if @api_client.config.debugging
257
- @api_client.config.logger.debug "API called: AttachmentsApi#sending_get_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
258
- end
259
- return data, status_code, headers
260
- end
261
-
262
- # Upload an attachment
263
- # Upload binary attachment bytes and receive a temporary attachment_id for use in attachments[]. Requires `email.send` permission.
264
- # @param content_length [Integer] Exact number of bytes in the binary request body.
265
- # @param filename [String] Filename to associate with the uploaded attachment.
266
- # @param body [File]
267
- # @param [Hash] opts the optional parameters
268
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
269
- # @option opts [String] :content_type MIME type override for the uploaded attachment.
270
- # @return [AttachmentUploadResponse]
271
- def sending_upload_attachment(content_length, filename, body, opts = {})
272
- data, _status_code, _headers = sending_upload_attachment_with_http_info(content_length, filename, body, opts)
273
- data
274
- end
275
-
276
- # Upload an attachment
277
- # Upload binary attachment bytes and receive a temporary attachment_id for use in attachments[]. Requires &#x60;email.send&#x60; permission.
278
- # @param content_length [Integer] Exact number of bytes in the binary request body.
279
- # @param filename [String] Filename to associate with the uploaded attachment.
280
- # @param body [File]
281
- # @param [Hash] opts the optional parameters
282
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
283
- # @option opts [String] :content_type MIME type override for the uploaded attachment.
284
- # @return [Array<(AttachmentUploadResponse, Integer, Hash)>] AttachmentUploadResponse data, response status code and response headers
285
- def sending_upload_attachment_with_http_info(content_length, filename, body, opts = {})
286
- if @api_client.config.debugging
287
- @api_client.config.logger.debug 'Calling API: AttachmentsApi.sending_upload_attachment ...'
288
- end
289
- # verify the required parameter 'content_length' is set
290
- if @api_client.config.client_side_validation && content_length.nil?
291
- fail ArgumentError, "Missing the required parameter 'content_length' when calling AttachmentsApi.sending_upload_attachment"
292
- end
293
- if @api_client.config.client_side_validation && content_length < 1
294
- fail ArgumentError, 'invalid value for "content_length" when calling AttachmentsApi.sending_upload_attachment, must be greater than or equal to 1.'
295
- end
296
-
297
- # verify the required parameter 'filename' is set
298
- if @api_client.config.client_side_validation && filename.nil?
299
- fail ArgumentError, "Missing the required parameter 'filename' when calling AttachmentsApi.sending_upload_attachment"
300
- end
301
- if @api_client.config.client_side_validation && filename.to_s.length > 255
302
- fail ArgumentError, 'invalid value for "filename" when calling AttachmentsApi.sending_upload_attachment, the character length must be smaller than or equal to 255.'
303
- end
304
-
305
- if @api_client.config.client_side_validation && filename.to_s.length < 1
306
- fail ArgumentError, 'invalid value for "filename" when calling AttachmentsApi.sending_upload_attachment, the character length must be greater than or equal to 1.'
307
- end
308
-
309
- # verify the required parameter 'body' is set
310
- if @api_client.config.client_side_validation && body.nil?
311
- fail ArgumentError, "Missing the required parameter 'body' when calling AttachmentsApi.sending_upload_attachment"
312
- end
313
- if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
314
- fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AttachmentsApi.sending_upload_attachment, the character length must be smaller than or equal to 255.'
315
- end
316
-
317
- if @api_client.config.client_side_validation && !opts[:'content_type'].nil? && opts[:'content_type'].to_s.length > 255
318
- fail ArgumentError, 'invalid value for "opts[:"content_type"]" when calling AttachmentsApi.sending_upload_attachment, the character length must be smaller than or equal to 255.'
319
- end
320
-
321
- # resource path
322
- local_var_path = '/emails/attachments'
323
-
324
- # query parameters
325
- query_params = opts[:query_params] || {}
326
- query_params[:'filename'] = filename
327
- query_params[:'content_type'] = opts[:'content_type'] if !opts[:'content_type'].nil?
328
-
329
- # header parameters
330
- header_params = opts[:header_params] || {}
331
- # HTTP header 'Accept' (if needed)
332
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
333
- # HTTP header 'Content-Type'
334
- content_type = @api_client.select_header_content_type(['application/octet-stream'])
335
- if !content_type.nil?
336
- header_params['Content-Type'] = content_type
337
- end
338
- header_params[:'Content-Length'] = content_length
339
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
340
-
341
- # form parameters
342
- form_params = opts[:form_params] || {}
343
-
344
- # http body (model)
345
- post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
346
-
347
- # return_type
348
- return_type = opts[:debug_return_type] || 'AttachmentUploadResponse'
349
-
350
- # auth_names
351
- auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
352
-
353
- new_options = opts.merge(
354
- :operation => :"AttachmentsApi.sending_upload_attachment",
355
- :header_params => header_params,
356
- :query_params => query_params,
357
- :form_params => form_params,
358
- :body => post_body,
359
- :auth_names => auth_names,
360
- :return_type => return_type
361
- )
362
-
363
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
364
- if @api_client.config.debugging
365
- @api_client.config.logger.debug "API called: AttachmentsApi#sending_upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
366
- end
367
- return data, status_code, headers
368
- end
369
- end
370
- end
@@ -1,172 +0,0 @@
1
- =begin
2
- #Sendmux Sending API
3
-
4
- #Send emails programmatically via the Sendmux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Sendmux::Sending::Generated
16
- class EmailsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Send a single email
23
- # Queue a single email for delivery. Requires `email.send` permission.
24
- # @param email_send_request [EmailSendRequest]
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
27
- # @return [SendSuccessResponse]
28
- def sending_send_email(email_send_request, opts = {})
29
- data, _status_code, _headers = sending_send_email_with_http_info(email_send_request, opts)
30
- data
31
- end
32
-
33
- # Send a single email
34
- # Queue a single email for delivery. Requires &#x60;email.send&#x60; permission.
35
- # @param email_send_request [EmailSendRequest]
36
- # @param [Hash] opts the optional parameters
37
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
38
- # @return [Array<(SendSuccessResponse, Integer, Hash)>] SendSuccessResponse data, response status code and response headers
39
- def sending_send_email_with_http_info(email_send_request, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: EmailsApi.sending_send_email ...'
42
- end
43
- # verify the required parameter 'email_send_request' is set
44
- if @api_client.config.client_side_validation && email_send_request.nil?
45
- fail ArgumentError, "Missing the required parameter 'email_send_request' when calling EmailsApi.sending_send_email"
46
- end
47
- if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
48
- fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling EmailsApi.sending_send_email, the character length must be smaller than or equal to 255.'
49
- end
50
-
51
- # resource path
52
- local_var_path = '/emails/send'
53
-
54
- # query parameters
55
- query_params = opts[:query_params] || {}
56
-
57
- # header parameters
58
- header_params = opts[:header_params] || {}
59
- # HTTP header 'Accept' (if needed)
60
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
- # HTTP header 'Content-Type'
62
- content_type = @api_client.select_header_content_type(['application/json'])
63
- if !content_type.nil?
64
- header_params['Content-Type'] = content_type
65
- end
66
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
67
-
68
- # form parameters
69
- form_params = opts[:form_params] || {}
70
-
71
- # http body (model)
72
- post_body = opts[:debug_body] || @api_client.object_to_http_body(email_send_request)
73
-
74
- # return_type
75
- return_type = opts[:debug_return_type] || 'SendSuccessResponse'
76
-
77
- # auth_names
78
- auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
79
-
80
- new_options = opts.merge(
81
- :operation => :"EmailsApi.sending_send_email",
82
- :header_params => header_params,
83
- :query_params => query_params,
84
- :form_params => form_params,
85
- :body => post_body,
86
- :auth_names => auth_names,
87
- :return_type => return_type
88
- )
89
-
90
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
- if @api_client.config.debugging
92
- @api_client.config.logger.debug "API called: EmailsApi#sending_send_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
- end
94
- return data, status_code, headers
95
- end
96
-
97
- # Send a batch of emails
98
- # Queue up to 100 emails for delivery in a single request. Uses partial success model — individual message failures do not fail the entire batch. Requires `email.send` permission.
99
- # @param batch_send_request [BatchSendRequest]
100
- # @param [Hash] opts the optional parameters
101
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
102
- # @return [BatchSendSuccessResponse]
103
- def sending_send_email_batch(batch_send_request, opts = {})
104
- data, _status_code, _headers = sending_send_email_batch_with_http_info(batch_send_request, opts)
105
- data
106
- end
107
-
108
- # Send a batch of emails
109
- # Queue up to 100 emails for delivery in a single request. Uses partial success model — individual message failures do not fail the entire batch. Requires &#x60;email.send&#x60; permission.
110
- # @param batch_send_request [BatchSendRequest]
111
- # @param [Hash] opts the optional parameters
112
- # @option opts [String] :idempotency_key Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
113
- # @return [Array<(BatchSendSuccessResponse, Integer, Hash)>] BatchSendSuccessResponse data, response status code and response headers
114
- def sending_send_email_batch_with_http_info(batch_send_request, opts = {})
115
- if @api_client.config.debugging
116
- @api_client.config.logger.debug 'Calling API: EmailsApi.sending_send_email_batch ...'
117
- end
118
- # verify the required parameter 'batch_send_request' is set
119
- if @api_client.config.client_side_validation && batch_send_request.nil?
120
- fail ArgumentError, "Missing the required parameter 'batch_send_request' when calling EmailsApi.sending_send_email_batch"
121
- end
122
- if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
123
- fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling EmailsApi.sending_send_email_batch, the character length must be smaller than or equal to 255.'
124
- end
125
-
126
- # resource path
127
- local_var_path = '/emails/send/batch'
128
-
129
- # query parameters
130
- query_params = opts[:query_params] || {}
131
-
132
- # header parameters
133
- header_params = opts[:header_params] || {}
134
- # HTTP header 'Accept' (if needed)
135
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
136
- # HTTP header 'Content-Type'
137
- content_type = @api_client.select_header_content_type(['application/json'])
138
- if !content_type.nil?
139
- header_params['Content-Type'] = content_type
140
- end
141
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
142
-
143
- # form parameters
144
- form_params = opts[:form_params] || {}
145
-
146
- # http body (model)
147
- post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_send_request)
148
-
149
- # return_type
150
- return_type = opts[:debug_return_type] || 'BatchSendSuccessResponse'
151
-
152
- # auth_names
153
- auth_names = opts[:debug_auth_names] || ['OAuth2', 'BearerAuth']
154
-
155
- new_options = opts.merge(
156
- :operation => :"EmailsApi.sending_send_email_batch",
157
- :header_params => header_params,
158
- :query_params => query_params,
159
- :form_params => form_params,
160
- :body => post_body,
161
- :auth_names => auth_names,
162
- :return_type => return_type
163
- )
164
-
165
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
166
- if @api_client.config.debugging
167
- @api_client.config.logger.debug "API called: EmailsApi#sending_send_email_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
- end
169
- return data, status_code, headers
170
- end
171
- end
172
- end