ElasticEmail 4.0.22 → 4.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ElasticEmail.gemspec +3 -2
- data/README.md +10 -4
- data/VERSION +1 -1
- data/docs/CampaignOptions.md +4 -0
- data/docs/CampaignTemplate.md +2 -2
- data/docs/EmailContent.md +2 -2
- data/docs/EmailJobFailedStatus.md +24 -0
- data/docs/EmailJobStatus.md +56 -0
- data/docs/EmailMessageData.md +1 -1
- data/docs/EmailTransactionalMessageData.md +1 -1
- data/docs/EmailValidationResult.md +2 -2
- data/docs/EmailsApi.md +97 -3
- data/docs/EmailsPayload.md +1 -1
- data/docs/ListPayload.md +1 -1
- data/docs/ListsApi.md +78 -0
- data/docs/MergeEmailPayload.md +1 -1
- data/lib/ElasticEmail/api/campaigns_api.rb +1 -1
- data/lib/ElasticEmail/api/contacts_api.rb +1 -1
- data/lib/ElasticEmail/api/emails_api.rb +94 -1
- data/lib/ElasticEmail/api/events_api.rb +1 -1
- data/lib/ElasticEmail/api/files_api.rb +1 -1
- data/lib/ElasticEmail/api/inbound_route_api.rb +1 -1
- data/lib/ElasticEmail/api/lists_api.rb +70 -1
- data/lib/ElasticEmail/api/security_api.rb +1 -1
- data/lib/ElasticEmail/api/segments_api.rb +1 -1
- data/lib/ElasticEmail/api/statistics_api.rb +1 -1
- data/lib/ElasticEmail/api/sub_accounts_api.rb +1 -1
- data/lib/ElasticEmail/api/suppressions_api.rb +1 -1
- data/lib/ElasticEmail/api/templates_api.rb +1 -1
- data/lib/ElasticEmail/api/verifications_api.rb +1 -1
- data/lib/ElasticEmail/api_client.rb +25 -23
- data/lib/ElasticEmail/api_error.rb +1 -1
- data/lib/ElasticEmail/configuration.rb +28 -10
- data/lib/ElasticEmail/models/access_level.rb +3 -3
- data/lib/ElasticEmail/models/account_status_enum.rb +1 -1
- data/lib/ElasticEmail/models/api_key.rb +14 -19
- data/lib/ElasticEmail/models/api_key_payload.rb +18 -19
- data/lib/ElasticEmail/models/body_content_type.rb +1 -1
- data/lib/ElasticEmail/models/body_part.rb +14 -19
- data/lib/ElasticEmail/models/campaign.rb +18 -19
- data/lib/ElasticEmail/models/campaign_options.rb +35 -20
- data/lib/ElasticEmail/models/campaign_recipient.rb +14 -19
- data/lib/ElasticEmail/models/campaign_status.rb +1 -1
- data/lib/ElasticEmail/models/campaign_template.rb +21 -19
- data/lib/ElasticEmail/models/channel_log_status_summary.rb +14 -19
- data/lib/ElasticEmail/models/compression_format.rb +1 -1
- data/lib/ElasticEmail/models/consent_data.rb +14 -19
- data/lib/ElasticEmail/models/consent_tracking.rb +1 -1
- data/lib/ElasticEmail/models/contact.rb +14 -19
- data/lib/ElasticEmail/models/contact_activity.rb +14 -19
- data/lib/ElasticEmail/models/contact_payload.rb +16 -19
- data/lib/ElasticEmail/models/contact_source.rb +1 -1
- data/lib/ElasticEmail/models/contact_status.rb +1 -1
- data/lib/ElasticEmail/models/contact_update_payload.rb +14 -19
- data/lib/ElasticEmail/models/contacts_list.rb +14 -19
- data/lib/ElasticEmail/models/delivery_optimization_type.rb +1 -1
- data/lib/ElasticEmail/models/email_content.rb +21 -19
- data/lib/ElasticEmail/models/email_data.rb +14 -19
- data/lib/ElasticEmail/models/{contact_history.rb → email_job_failed_status.rb} +44 -83
- data/lib/ElasticEmail/models/email_job_status.rb +415 -0
- data/lib/ElasticEmail/models/email_message_data.rb +23 -19
- data/lib/ElasticEmail/models/email_predicted_validation_status.rb +1 -1
- data/lib/ElasticEmail/models/email_recipient.rb +16 -19
- data/lib/ElasticEmail/models/email_send.rb +14 -19
- data/lib/ElasticEmail/models/email_status.rb +14 -19
- data/lib/ElasticEmail/models/email_transactional_message_data.rb +23 -19
- data/lib/ElasticEmail/models/email_validation_result.rb +16 -20
- data/lib/ElasticEmail/models/email_validation_status.rb +1 -1
- data/lib/ElasticEmail/models/email_view.rb +14 -19
- data/lib/ElasticEmail/models/emails_payload.rb +14 -19
- data/lib/ElasticEmail/models/encoding_type.rb +1 -1
- data/lib/ElasticEmail/models/event_type.rb +1 -1
- data/lib/ElasticEmail/models/events_order_by.rb +1 -1
- data/lib/ElasticEmail/models/export_file_formats.rb +1 -1
- data/lib/ElasticEmail/models/export_link.rb +14 -19
- data/lib/ElasticEmail/models/export_status.rb +1 -1
- data/lib/ElasticEmail/models/file_info.rb +14 -19
- data/lib/ElasticEmail/models/file_payload.rb +16 -19
- data/lib/ElasticEmail/models/file_upload_result.rb +14 -19
- data/lib/ElasticEmail/models/inbound_payload.rb +18 -19
- data/lib/ElasticEmail/models/inbound_route.rb +14 -19
- data/lib/ElasticEmail/models/inbound_route_action_type.rb +1 -1
- data/lib/ElasticEmail/models/inbound_route_filter_type.rb +1 -1
- data/lib/ElasticEmail/models/list_payload.rb +16 -19
- data/lib/ElasticEmail/models/list_update_payload.rb +14 -19
- data/lib/ElasticEmail/models/log_job_status.rb +1 -1
- data/lib/ElasticEmail/models/log_status_summary.rb +14 -19
- data/lib/ElasticEmail/models/merge_email_payload.rb +23 -19
- data/lib/ElasticEmail/models/message_attachment.rb +18 -19
- data/lib/ElasticEmail/models/message_category.rb +1 -1
- data/lib/ElasticEmail/models/new_api_key.rb +14 -19
- data/lib/ElasticEmail/models/new_smtp_credentials.rb +14 -19
- data/lib/ElasticEmail/models/options.rb +16 -19
- data/lib/ElasticEmail/models/recipient_event.rb +14 -19
- data/lib/ElasticEmail/models/segment.rb +14 -19
- data/lib/ElasticEmail/models/segment_payload.rb +18 -19
- data/lib/ElasticEmail/models/smtp_credentials.rb +14 -19
- data/lib/ElasticEmail/models/smtp_credentials_payload.rb +16 -19
- data/lib/ElasticEmail/models/sort_order_item.rb +18 -19
- data/lib/ElasticEmail/models/split_optimization_type.rb +1 -1
- data/lib/ElasticEmail/models/split_options.rb +14 -19
- data/lib/ElasticEmail/models/sub_account_info.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +16 -19
- data/lib/ElasticEmail/models/subaccount_email_settings.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_payload.rb +18 -19
- data/lib/ElasticEmail/models/subaccount_settings_info.rb +14 -19
- data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +14 -19
- data/lib/ElasticEmail/models/suppression.rb +14 -19
- data/lib/ElasticEmail/models/template.rb +14 -19
- data/lib/ElasticEmail/models/template_payload.rb +16 -19
- data/lib/ElasticEmail/models/template_scope.rb +1 -1
- data/lib/ElasticEmail/models/template_type.rb +3 -2
- data/lib/ElasticEmail/models/transactional_recipient.rb +16 -19
- data/lib/ElasticEmail/models/utm.rb +14 -19
- data/lib/ElasticEmail/models/verification_file_result.rb +14 -19
- data/lib/ElasticEmail/models/verification_file_result_details.rb +14 -19
- data/lib/ElasticEmail/models/verification_status.rb +1 -1
- data/lib/ElasticEmail/version.rb +2 -2
- data/lib/ElasticEmail.rb +3 -1
- data/spec/api/campaigns_api_spec.rb +7 -7
- data/spec/api/contacts_api_spec.rb +12 -25
- data/spec/api/emails_api_spec.rb +28 -6
- data/spec/api/events_api_spec.rb +9 -9
- data/spec/api/files_api_spec.rb +7 -7
- data/spec/api/inbound_route_api_spec.rb +8 -8
- data/spec/api/lists_api_spec.rb +23 -9
- data/spec/api/security_api_spec.rb +12 -12
- data/spec/api/segments_api_spec.rb +7 -7
- data/spec/api/statistics_api_spec.rb +7 -7
- data/spec/api/sub_accounts_api_spec.rb +8 -8
- data/spec/api/suppressions_api_spec.rb +26 -26
- data/spec/api/templates_api_spec.rb +7 -7
- data/spec/api/verifications_api_spec.rb +30 -18
- data/spec/models/access_level_spec.rb +5 -3
- data/spec/models/account_status_enum_spec.rb +5 -3
- data/spec/models/api_key_payload_spec.rb +10 -8
- data/spec/models/api_key_spec.rb +11 -9
- data/spec/models/body_content_type_spec.rb +5 -3
- data/spec/models/body_part_spec.rb +8 -6
- data/spec/models/campaign_options_spec.rb +22 -8
- data/spec/models/campaign_recipient_spec.rb +7 -5
- data/spec/models/campaign_spec.rb +10 -8
- data/spec/models/campaign_status_spec.rb +5 -3
- data/spec/models/campaign_template_spec.rb +12 -10
- data/spec/models/channel_log_status_summary_spec.rb +19 -17
- data/spec/models/compression_format_spec.rb +5 -3
- data/spec/models/consent_data_spec.rb +8 -6
- data/spec/models/consent_tracking_spec.rb +5 -3
- data/spec/models/contact_activity_spec.rb +16 -14
- data/spec/models/contact_payload_spec.rb +11 -9
- data/spec/models/contact_source_spec.rb +5 -3
- data/spec/models/contact_spec.rb +16 -14
- data/spec/models/contact_status_spec.rb +5 -3
- data/spec/models/contact_update_payload_spec.rb +8 -6
- data/spec/models/contacts_list_spec.rb +9 -7
- data/spec/models/delivery_optimization_type_spec.rb +5 -3
- data/spec/models/email_content_spec.rb +22 -14
- data/spec/models/email_data_spec.rb +8 -6
- data/spec/models/email_job_failed_status_spec.rb +54 -0
- data/spec/models/email_job_status_spec.rb +150 -0
- data/spec/models/email_message_data_spec.rb +8 -6
- data/spec/models/email_predicted_validation_status_spec.rb +4 -2
- data/spec/models/email_recipient_spec.rb +7 -5
- data/spec/models/email_send_spec.rb +7 -5
- data/spec/models/email_status_spec.rb +17 -15
- data/spec/models/email_transactional_message_data_spec.rb +8 -6
- data/spec/models/email_validation_result_spec.rb +26 -12
- data/spec/models/email_validation_status_spec.rb +5 -3
- data/spec/models/email_view_spec.rb +8 -6
- data/spec/models/emails_payload_spec.rb +7 -5
- data/spec/models/encoding_type_spec.rb +5 -3
- data/spec/models/event_type_spec.rb +5 -3
- data/spec/models/events_order_by_spec.rb +5 -3
- data/spec/models/export_file_formats_spec.rb +5 -3
- data/spec/models/export_link_spec.rb +7 -5
- data/spec/models/export_status_spec.rb +5 -3
- data/spec/models/file_info_spec.rb +10 -8
- data/spec/models/file_payload_spec.rb +8 -6
- data/spec/models/file_upload_result_spec.rb +7 -5
- data/spec/models/inbound_payload_spec.rb +11 -9
- data/spec/models/inbound_route_action_type_spec.rb +5 -3
- data/spec/models/inbound_route_filter_type_spec.rb +5 -3
- data/spec/models/inbound_route_spec.rb +12 -10
- data/spec/models/list_payload_spec.rb +8 -6
- data/spec/models/list_update_payload_spec.rb +7 -5
- data/spec/models/log_job_status_spec.rb +5 -3
- data/spec/models/log_status_summary_spec.rb +18 -16
- data/spec/models/merge_email_payload_spec.rb +8 -6
- data/spec/models/message_attachment_spec.rb +14 -6
- data/spec/models/message_category_spec.rb +5 -3
- data/spec/models/new_api_key_spec.rb +12 -10
- data/spec/models/new_smtp_credentials_spec.rb +12 -10
- data/spec/models/options_spec.rb +11 -9
- data/spec/models/recipient_event_spec.rb +18 -16
- data/spec/models/segment_payload_spec.rb +7 -5
- data/spec/models/segment_spec.rb +7 -5
- data/spec/models/smtp_credentials_payload_spec.rb +9 -7
- data/spec/models/smtp_credentials_spec.rb +11 -9
- data/spec/models/sort_order_item_spec.rb +7 -5
- data/spec/models/split_optimization_type_spec.rb +5 -3
- data/spec/models/split_options_spec.rb +7 -5
- data/spec/models/sub_account_info_spec.rb +14 -12
- data/spec/models/subaccount_email_credits_payload_spec.rb +7 -5
- data/spec/models/subaccount_email_settings_payload_spec.rb +17 -9
- data/spec/models/subaccount_email_settings_spec.rb +18 -10
- data/spec/models/subaccount_payload_spec.rb +9 -7
- data/spec/models/subaccount_settings_info_payload_spec.rb +6 -4
- data/spec/models/subaccount_settings_info_spec.rb +6 -4
- data/spec/models/suppression_spec.rb +9 -7
- data/spec/models/template_payload_spec.rb +9 -7
- data/spec/models/template_scope_spec.rb +5 -3
- data/spec/models/template_spec.rb +11 -9
- data/spec/models/template_type_spec.rb +5 -3
- data/spec/models/transactional_recipient_spec.rb +8 -6
- data/spec/models/utm_spec.rb +9 -7
- data/spec/models/verification_file_result_details_spec.rb +12 -10
- data/spec/models/verification_file_result_spec.rb +11 -9
- data/spec/models/verification_status_spec.rb +5 -3
- data/spec/spec_helper.rb +1 -1
- metadata +91 -99
- data/docs/ContactHistEventType.md +0 -15
- data/docs/ContactHistory.md +0 -30
- data/docs/TemplateScopeType.md +0 -15
- data/lib/ElasticEmail/models/contact_hist_event_type.rb +0 -49
- data/lib/ElasticEmail/models/template_scope_type.rb +0 -38
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/contact_hist_event_type_spec.rb +0 -28
- data/spec/models/contact_history_spec.rb +0 -70
- data/spec/models/template_scope_type_spec.rb +0 -28
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ElasticEmail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ElasticEmail
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -50,10 +50,10 @@ dependencies:
|
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 3.6.0
|
53
|
-
description: The
|
54
|
-
REST API architecture, allowing the user to easily manage their data with this
|
55
|
-
approach. To start using this API, you will need your Access Token.
|
56
|
-
keep it safe.
|
53
|
+
description: The Ruby library for the Elastic Email REST API. This API is based on
|
54
|
+
the REST API architecture, allowing the user to easily manage their data with this
|
55
|
+
resource-based approach. To start using this API, you will need your Access Token.
|
56
|
+
Remember to keep it safe.
|
57
57
|
email:
|
58
58
|
- contact@elasticemail.com
|
59
59
|
executables: []
|
@@ -83,8 +83,6 @@ files:
|
|
83
83
|
- docs/ConsentTracking.md
|
84
84
|
- docs/Contact.md
|
85
85
|
- docs/ContactActivity.md
|
86
|
-
- docs/ContactHistEventType.md
|
87
|
-
- docs/ContactHistory.md
|
88
86
|
- docs/ContactPayload.md
|
89
87
|
- docs/ContactSource.md
|
90
88
|
- docs/ContactStatus.md
|
@@ -94,6 +92,8 @@ files:
|
|
94
92
|
- docs/DeliveryOptimizationType.md
|
95
93
|
- docs/EmailContent.md
|
96
94
|
- docs/EmailData.md
|
95
|
+
- docs/EmailJobFailedStatus.md
|
96
|
+
- docs/EmailJobStatus.md
|
97
97
|
- docs/EmailMessageData.md
|
98
98
|
- docs/EmailPredictedValidationStatus.md
|
99
99
|
- docs/EmailRecipient.md
|
@@ -156,7 +156,6 @@ files:
|
|
156
156
|
- docs/Template.md
|
157
157
|
- docs/TemplatePayload.md
|
158
158
|
- docs/TemplateScope.md
|
159
|
-
- docs/TemplateScopeType.md
|
160
159
|
- docs/TemplateType.md
|
161
160
|
- docs/TemplatesApi.md
|
162
161
|
- docs/TransactionalRecipient.md
|
@@ -200,8 +199,6 @@ files:
|
|
200
199
|
- lib/ElasticEmail/models/consent_tracking.rb
|
201
200
|
- lib/ElasticEmail/models/contact.rb
|
202
201
|
- lib/ElasticEmail/models/contact_activity.rb
|
203
|
-
- lib/ElasticEmail/models/contact_hist_event_type.rb
|
204
|
-
- lib/ElasticEmail/models/contact_history.rb
|
205
202
|
- lib/ElasticEmail/models/contact_payload.rb
|
206
203
|
- lib/ElasticEmail/models/contact_source.rb
|
207
204
|
- lib/ElasticEmail/models/contact_status.rb
|
@@ -210,6 +207,8 @@ files:
|
|
210
207
|
- lib/ElasticEmail/models/delivery_optimization_type.rb
|
211
208
|
- lib/ElasticEmail/models/email_content.rb
|
212
209
|
- lib/ElasticEmail/models/email_data.rb
|
210
|
+
- lib/ElasticEmail/models/email_job_failed_status.rb
|
211
|
+
- lib/ElasticEmail/models/email_job_status.rb
|
213
212
|
- lib/ElasticEmail/models/email_message_data.rb
|
214
213
|
- lib/ElasticEmail/models/email_predicted_validation_status.rb
|
215
214
|
- lib/ElasticEmail/models/email_recipient.rb
|
@@ -262,7 +261,6 @@ files:
|
|
262
261
|
- lib/ElasticEmail/models/template.rb
|
263
262
|
- lib/ElasticEmail/models/template_payload.rb
|
264
263
|
- lib/ElasticEmail/models/template_scope.rb
|
265
|
-
- lib/ElasticEmail/models/template_scope_type.rb
|
266
264
|
- lib/ElasticEmail/models/template_type.rb
|
267
265
|
- lib/ElasticEmail/models/transactional_recipient.rb
|
268
266
|
- lib/ElasticEmail/models/utm.rb
|
@@ -284,8 +282,6 @@ files:
|
|
284
282
|
- spec/api/suppressions_api_spec.rb
|
285
283
|
- spec/api/templates_api_spec.rb
|
286
284
|
- spec/api/verifications_api_spec.rb
|
287
|
-
- spec/api_client_spec.rb
|
288
|
-
- spec/configuration_spec.rb
|
289
285
|
- spec/models/access_level_spec.rb
|
290
286
|
- spec/models/account_status_enum_spec.rb
|
291
287
|
- spec/models/api_key_payload_spec.rb
|
@@ -302,8 +298,6 @@ files:
|
|
302
298
|
- spec/models/consent_data_spec.rb
|
303
299
|
- spec/models/consent_tracking_spec.rb
|
304
300
|
- spec/models/contact_activity_spec.rb
|
305
|
-
- spec/models/contact_hist_event_type_spec.rb
|
306
|
-
- spec/models/contact_history_spec.rb
|
307
301
|
- spec/models/contact_payload_spec.rb
|
308
302
|
- spec/models/contact_source_spec.rb
|
309
303
|
- spec/models/contact_spec.rb
|
@@ -313,6 +307,8 @@ files:
|
|
313
307
|
- spec/models/delivery_optimization_type_spec.rb
|
314
308
|
- spec/models/email_content_spec.rb
|
315
309
|
- spec/models/email_data_spec.rb
|
310
|
+
- spec/models/email_job_failed_status_spec.rb
|
311
|
+
- spec/models/email_job_status_spec.rb
|
316
312
|
- spec/models/email_message_data_spec.rb
|
317
313
|
- spec/models/email_predicted_validation_status_spec.rb
|
318
314
|
- spec/models/email_recipient_spec.rb
|
@@ -364,7 +360,6 @@ files:
|
|
364
360
|
- spec/models/suppression_spec.rb
|
365
361
|
- spec/models/template_payload_spec.rb
|
366
362
|
- spec/models/template_scope_spec.rb
|
367
|
-
- spec/models/template_scope_type_spec.rb
|
368
363
|
- spec/models/template_spec.rb
|
369
364
|
- spec/models/template_type_spec.rb
|
370
365
|
- spec/models/transactional_recipient_spec.rb
|
@@ -397,106 +392,103 @@ signing_key:
|
|
397
392
|
specification_version: 4
|
398
393
|
summary: Elastic Email REST API Ruby Gem
|
399
394
|
test_files:
|
400
|
-
- spec/api/campaigns_api_spec.rb
|
401
|
-
- spec/api/files_api_spec.rb
|
402
|
-
- spec/api/events_api_spec.rb
|
403
|
-
- spec/api/security_api_spec.rb
|
404
|
-
- spec/api/verifications_api_spec.rb
|
405
395
|
- spec/api/lists_api_spec.rb
|
396
|
+
- spec/api/segments_api_spec.rb
|
406
397
|
- spec/api/suppressions_api_spec.rb
|
407
|
-
- spec/api/templates_api_spec.rb
|
408
|
-
- spec/api/statistics_api_spec.rb
|
409
|
-
- spec/api/emails_api_spec.rb
|
410
398
|
- spec/api/sub_accounts_api_spec.rb
|
411
|
-
- spec/api/
|
399
|
+
- spec/api/security_api_spec.rb
|
412
400
|
- spec/api/inbound_route_api_spec.rb
|
401
|
+
- spec/api/statistics_api_spec.rb
|
402
|
+
- spec/api/templates_api_spec.rb
|
403
|
+
- spec/api/files_api_spec.rb
|
404
|
+
- spec/api/events_api_spec.rb
|
405
|
+
- spec/api/campaigns_api_spec.rb
|
406
|
+
- spec/api/emails_api_spec.rb
|
407
|
+
- spec/api/verifications_api_spec.rb
|
413
408
|
- spec/api/contacts_api_spec.rb
|
414
|
-
- spec/
|
415
|
-
- spec/
|
416
|
-
- spec/models/
|
417
|
-
- spec/models/
|
409
|
+
- spec/models/inbound_payload_spec.rb
|
410
|
+
- spec/models/compression_format_spec.rb
|
411
|
+
- spec/models/email_data_spec.rb
|
412
|
+
- spec/models/file_info_spec.rb
|
413
|
+
- spec/models/email_message_data_spec.rb
|
414
|
+
- spec/models/sub_account_info_spec.rb
|
415
|
+
- spec/models/contact_source_spec.rb
|
416
|
+
- spec/models/export_link_spec.rb
|
417
|
+
- spec/models/channel_log_status_summary_spec.rb
|
418
|
+
- spec/models/email_recipient_spec.rb
|
419
|
+
- spec/models/subaccount_email_credits_payload_spec.rb
|
420
|
+
- spec/models/account_status_enum_spec.rb
|
421
|
+
- spec/models/inbound_route_action_type_spec.rb
|
422
|
+
- spec/models/smtp_credentials_payload_spec.rb
|
423
|
+
- spec/models/log_job_status_spec.rb
|
424
|
+
- spec/models/email_validation_result_spec.rb
|
425
|
+
- spec/models/email_content_spec.rb
|
426
|
+
- spec/models/template_type_spec.rb
|
427
|
+
- spec/models/campaign_spec.rb
|
428
|
+
- spec/models/api_key_payload_spec.rb
|
429
|
+
- spec/models/email_predicted_validation_status_spec.rb
|
430
|
+
- spec/models/split_optimization_type_spec.rb
|
418
431
|
- spec/models/subaccount_payload_spec.rb
|
419
|
-
- spec/models/
|
420
|
-
- spec/models/
|
421
|
-
- spec/models/
|
422
|
-
- spec/models/
|
432
|
+
- spec/models/campaign_template_spec.rb
|
433
|
+
- spec/models/template_spec.rb
|
434
|
+
- spec/models/segment_payload_spec.rb
|
435
|
+
- spec/models/email_validation_status_spec.rb
|
436
|
+
- spec/models/encoding_type_spec.rb
|
437
|
+
- spec/models/contact_payload_spec.rb
|
438
|
+
- spec/models/email_transactional_message_data_spec.rb
|
439
|
+
- spec/models/subaccount_email_settings_spec.rb
|
440
|
+
- spec/models/merge_email_payload_spec.rb
|
441
|
+
- spec/models/consent_data_spec.rb
|
423
442
|
- spec/models/events_order_by_spec.rb
|
443
|
+
- spec/models/inbound_route_filter_type_spec.rb
|
444
|
+
- spec/models/sort_order_item_spec.rb
|
445
|
+
- spec/models/segment_spec.rb
|
446
|
+
- spec/models/delivery_optimization_type_spec.rb
|
447
|
+
- spec/models/email_send_spec.rb
|
448
|
+
- spec/models/access_level_spec.rb
|
424
449
|
- spec/models/smtp_credentials_spec.rb
|
425
|
-
- spec/models/
|
426
|
-
- spec/models/
|
427
|
-
- spec/models/
|
428
|
-
- spec/models/
|
450
|
+
- spec/models/subaccount_settings_info_spec.rb
|
451
|
+
- spec/models/log_status_summary_spec.rb
|
452
|
+
- spec/models/campaign_recipient_spec.rb
|
453
|
+
- spec/models/email_view_spec.rb
|
454
|
+
- spec/models/transactional_recipient_spec.rb
|
455
|
+
- spec/models/contacts_list_spec.rb
|
456
|
+
- spec/models/email_status_spec.rb
|
429
457
|
- spec/models/template_payload_spec.rb
|
458
|
+
- spec/models/subaccount_email_settings_payload_spec.rb
|
459
|
+
- spec/models/emails_payload_spec.rb
|
430
460
|
- spec/models/utm_spec.rb
|
431
|
-
- spec/models/
|
461
|
+
- spec/models/file_payload_spec.rb
|
462
|
+
- spec/models/export_file_formats_spec.rb
|
432
463
|
- spec/models/verification_file_result_details_spec.rb
|
433
|
-
- spec/models/campaign_template_spec.rb
|
434
|
-
- spec/models/encoding_type_spec.rb
|
435
|
-
- spec/models/contacts_list_spec.rb
|
436
|
-
- spec/models/inbound_route_action_type_spec.rb
|
437
|
-
- spec/models/email_predicted_validation_status_spec.rb
|
438
|
-
- spec/models/inbound_payload_spec.rb
|
439
|
-
- spec/models/campaign_recipient_spec.rb
|
440
|
-
- spec/models/email_status_spec.rb
|
441
|
-
- spec/models/email_validation_status_spec.rb
|
442
464
|
- spec/models/new_api_key_spec.rb
|
443
|
-
- spec/models/
|
465
|
+
- spec/models/consent_tracking_spec.rb
|
466
|
+
- spec/models/list_payload_spec.rb
|
467
|
+
- spec/models/contact_spec.rb
|
468
|
+
- spec/models/verification_status_spec.rb
|
469
|
+
- spec/models/subaccount_settings_info_payload_spec.rb
|
444
470
|
- spec/models/recipient_event_spec.rb
|
445
|
-
- spec/models/email_data_spec.rb
|
446
|
-
- spec/models/template_scope_type_spec.rb
|
447
|
-
- spec/models/contact_status_spec.rb
|
448
|
-
- spec/models/new_smtp_credentials_spec.rb
|
449
|
-
- spec/models/contact_update_payload_spec.rb
|
450
|
-
- spec/models/template_type_spec.rb
|
451
471
|
- spec/models/api_key_spec.rb
|
452
|
-
- spec/models/
|
472
|
+
- spec/models/contact_update_payload_spec.rb
|
453
473
|
- spec/models/message_category_spec.rb
|
454
|
-
- spec/models/
|
455
|
-
- spec/models/
|
474
|
+
- spec/models/options_spec.rb
|
475
|
+
- spec/models/body_content_type_spec.rb
|
456
476
|
- spec/models/file_upload_result_spec.rb
|
457
|
-
- spec/models/
|
458
|
-
- spec/models/campaign_spec.rb
|
459
|
-
- spec/models/list_payload_spec.rb
|
460
|
-
- spec/models/sort_order_item_spec.rb
|
461
|
-
- spec/models/email_content_spec.rb
|
462
|
-
- spec/models/email_send_spec.rb
|
463
|
-
- spec/models/merge_email_payload_spec.rb
|
464
|
-
- spec/models/export_link_spec.rb
|
465
|
-
- spec/models/contact_source_spec.rb
|
466
|
-
- spec/models/export_file_formats_spec.rb
|
467
|
-
- spec/models/email_message_data_spec.rb
|
468
|
-
- spec/models/verification_status_spec.rb
|
469
|
-
- spec/models/contact_payload_spec.rb
|
470
|
-
- spec/models/split_options_spec.rb
|
471
|
-
- spec/models/email_recipient_spec.rb
|
472
|
-
- spec/models/body_part_spec.rb
|
473
|
-
- spec/models/channel_log_status_summary_spec.rb
|
474
|
-
- spec/models/suppression_spec.rb
|
475
|
-
- spec/models/split_optimization_type_spec.rb
|
476
|
-
- spec/models/email_view_spec.rb
|
477
|
-
- spec/models/sub_account_info_spec.rb
|
478
|
-
- spec/models/message_attachment_spec.rb
|
479
|
-
- spec/models/template_spec.rb
|
477
|
+
- spec/models/email_job_failed_status_spec.rb
|
480
478
|
- spec/models/export_status_spec.rb
|
481
|
-
- spec/models/
|
482
|
-
- spec/models/
|
479
|
+
- spec/models/inbound_route_spec.rb
|
480
|
+
- spec/models/contact_status_spec.rb
|
481
|
+
- spec/models/verification_file_result_spec.rb
|
482
|
+
- spec/models/campaign_options_spec.rb
|
483
483
|
- spec/models/contact_activity_spec.rb
|
484
|
-
- spec/models/
|
485
|
-
- spec/models/
|
486
|
-
- spec/models/
|
487
|
-
- spec/models/consent_data_spec.rb
|
488
|
-
- spec/models/file_info_spec.rb
|
489
|
-
- spec/models/file_payload_spec.rb
|
490
|
-
- spec/models/access_level_spec.rb
|
491
|
-
- spec/models/contact_hist_event_type_spec.rb
|
492
|
-
- spec/models/consent_tracking_spec.rb
|
484
|
+
- spec/models/message_attachment_spec.rb
|
485
|
+
- spec/models/list_update_payload_spec.rb
|
486
|
+
- spec/models/suppression_spec.rb
|
493
487
|
- spec/models/template_scope_spec.rb
|
494
|
-
- spec/models/delivery_optimization_type_spec.rb
|
495
|
-
- spec/models/api_key_payload_spec.rb
|
496
|
-
- spec/models/transactional_recipient_spec.rb
|
497
|
-
- spec/models/subaccount_email_credits_payload_spec.rb
|
498
|
-
- spec/models/emails_payload_spec.rb
|
499
|
-
- spec/models/account_status_enum_spec.rb
|
500
488
|
- spec/models/campaign_status_spec.rb
|
501
|
-
- spec/models/
|
489
|
+
- spec/models/event_type_spec.rb
|
490
|
+
- spec/models/new_smtp_credentials_spec.rb
|
491
|
+
- spec/models/body_part_spec.rb
|
492
|
+
- spec/models/email_job_status_spec.rb
|
493
|
+
- spec/models/split_options_spec.rb
|
502
494
|
- spec/spec_helper.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# ElasticEmail::ContactHistEventType
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
|
8
|
-
## Example
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
require 'ElasticEmail'
|
12
|
-
|
13
|
-
instance = ElasticEmail::ContactHistEventType.new()
|
14
|
-
```
|
15
|
-
|
data/docs/ContactHistory.md
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# ElasticEmail::ContactHistory
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **event_type** | [**ContactHistEventType**](ContactHistEventType.md) | | [optional][default to 'Opened'] |
|
8
|
-
| **event_date** | **Time** | Formatted date of event. | [optional] |
|
9
|
-
| **channel_name** | **String** | Name of channel this event occured on | [optional] |
|
10
|
-
| **template_name** | **String** | Name of template this event occured on | [optional] |
|
11
|
-
| **ip_address** | **String** | IP Address of the event. | [optional] |
|
12
|
-
| **country** | **String** | Country of the event. | [optional] |
|
13
|
-
| **data** | **String** | Additional information about the event | [optional] |
|
14
|
-
|
15
|
-
## Example
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
require 'ElasticEmail'
|
19
|
-
|
20
|
-
instance = ElasticEmail::ContactHistory.new(
|
21
|
-
event_type: null,
|
22
|
-
event_date: null,
|
23
|
-
channel_name: null,
|
24
|
-
template_name: null,
|
25
|
-
ip_address: null,
|
26
|
-
country: null,
|
27
|
-
data: null
|
28
|
-
)
|
29
|
-
```
|
30
|
-
|
data/docs/TemplateScopeType.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# ElasticEmail::TemplateScopeType
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
|
8
|
-
## Example
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
require 'ElasticEmail'
|
12
|
-
|
13
|
-
instance = ElasticEmail::TemplateScopeType.new()
|
14
|
-
```
|
15
|
-
|
@@ -1,49 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Elastic Email REST API
|
3
|
-
|
4
|
-
#This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target=\"_blank\" href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 4.0.0
|
7
|
-
Contact: support@elasticemail.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 6.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module ElasticEmail
|
17
|
-
class ContactHistEventType
|
18
|
-
OPENED = "Opened".freeze
|
19
|
-
CLICKED = "Clicked".freeze
|
20
|
-
BOUNCED = "Bounced".freeze
|
21
|
-
UNSUBSCRIBED = "Unsubscribed".freeze
|
22
|
-
COMPLAINED = "Complained".freeze
|
23
|
-
ACTIVATED = "Activated".freeze
|
24
|
-
TRANSACTIONAL_UNSUBSCRIBED = "TransactionalUnsubscribed".freeze
|
25
|
-
MANUAL_STATUS_CHANGE = "ManualStatusChange".freeze
|
26
|
-
MANUAL_CONSENT_TRACKING_CHANGE = "ManualConsentTrackingChange".freeze
|
27
|
-
ACTIVATION_SENT = "ActivationSent".freeze
|
28
|
-
JOURNEY_STARTED = "JourneyStarted".freeze
|
29
|
-
JOURNEY_STEP_PROCESSED = "JourneyStepProcessed".freeze
|
30
|
-
JOURNEY_FINISHED = "JourneyFinished".freeze
|
31
|
-
DELETED = "Deleted".freeze
|
32
|
-
|
33
|
-
# Builds the enum from string
|
34
|
-
# @param [String] The enum value in the form of the string
|
35
|
-
# @return [String] The enum value
|
36
|
-
def self.build_from_hash(value)
|
37
|
-
new.build_from_hash(value)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Builds the enum from string
|
41
|
-
# @param [String] The enum value in the form of the string
|
42
|
-
# @return [String] The enum value
|
43
|
-
def build_from_hash(value)
|
44
|
-
constantValues = ContactHistEventType.constants.select { |c| ContactHistEventType::const_get(c) == value }
|
45
|
-
raise "Invalid ENUM value #{value} for class #ContactHistEventType" if constantValues.empty?
|
46
|
-
value
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Elastic Email REST API
|
3
|
-
|
4
|
-
#This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. To start using this API, you will need your Access Token (available <a href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. This is the documentation for REST API. If you’d like to read our legacy documentation regarding Web API v2 click <a href=\"https://api.elasticemail.com/public/help\">here</a>.
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 4.0.0
|
7
|
-
Contact: support@elasticemail.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.0.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module ElasticEmail
|
17
|
-
class TemplateScopeType
|
18
|
-
PERSONAL = "Personal".freeze
|
19
|
-
GLOBAL = "Global".freeze
|
20
|
-
DRAFT = "Draft".freeze
|
21
|
-
|
22
|
-
# Builds the enum from string
|
23
|
-
# @param [String] The enum value in the form of the string
|
24
|
-
# @return [String] The enum value
|
25
|
-
def self.build_from_hash(value)
|
26
|
-
new.build_from_hash(value)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Builds the enum from string
|
30
|
-
# @param [String] The enum value in the form of the string
|
31
|
-
# @return [String] The enum value
|
32
|
-
def build_from_hash(value)
|
33
|
-
constantValues = TemplateScopeType.constants.select { |c| TemplateScopeType::const_get(c) == value }
|
34
|
-
raise "Invalid ENUM value #{value} for class #TemplateScopeType" if constantValues.empty?
|
35
|
-
value
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
data/spec/api_client_spec.rb
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Elastic Email REST API
|
3
|
-
|
4
|
-
#This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available <a target=\"_blank\" href=\"https://app.elasticemail.com/marketing/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 4.0.0
|
7
|
-
Contact: support@elasticemail.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 6.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe ElasticEmail::ApiClient do
|
16
|
-
context 'initialization' do
|
17
|
-
context 'URL stuff' do
|
18
|
-
context 'host' do
|
19
|
-
it 'removes http from host' do
|
20
|
-
ElasticEmail.configure { |c| c.host = 'http://example.com' }
|
21
|
-
expect(ElasticEmail::Configuration.default.host).to eq('example.com')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'removes https from host' do
|
25
|
-
ElasticEmail.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
-
expect(ElasticEmail::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'removes trailing path from host' do
|
30
|
-
ElasticEmail.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
-
expect(ElasticEmail::Configuration.default.host).to eq('hobo.com')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'base_path' do
|
36
|
-
it "prepends a slash to base_path" do
|
37
|
-
ElasticEmail.configure { |c| c.base_path = 'v4/dog' }
|
38
|
-
expect(ElasticEmail::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "doesn't prepend a slash if one is already there" do
|
42
|
-
ElasticEmail.configure { |c| c.base_path = '/v4/dog' }
|
43
|
-
expect(ElasticEmail::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
-
end
|
45
|
-
|
46
|
-
it "ends up as a blank string if nil" do
|
47
|
-
ElasticEmail.configure { |c| c.base_path = nil }
|
48
|
-
expect(ElasticEmail::Configuration.default.base_path).to eq('')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe 'params_encoding in #build_request' do
|
55
|
-
let(:config) { ElasticEmail::Configuration.new }
|
56
|
-
let(:api_client) { ElasticEmail::ApiClient.new(config) }
|
57
|
-
|
58
|
-
it 'defaults to nil' do
|
59
|
-
expect(ElasticEmail::Configuration.default.params_encoding).to eq(nil)
|
60
|
-
expect(config.params_encoding).to eq(nil)
|
61
|
-
|
62
|
-
request = api_client.build_request(:get, '/test')
|
63
|
-
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'can be customized' do
|
67
|
-
config.params_encoding = :multi
|
68
|
-
request = api_client.build_request(:get, '/test')
|
69
|
-
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe 'timeout in #build_request' do
|
74
|
-
let(:config) { ElasticEmail::Configuration.new }
|
75
|
-
let(:api_client) { ElasticEmail::ApiClient.new(config) }
|
76
|
-
|
77
|
-
it 'defaults to 0' do
|
78
|
-
expect(ElasticEmail::Configuration.default.timeout).to eq(0)
|
79
|
-
expect(config.timeout).to eq(0)
|
80
|
-
|
81
|
-
request = api_client.build_request(:get, '/test')
|
82
|
-
expect(request.options[:timeout]).to eq(0)
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'can be customized' do
|
86
|
-
config.timeout = 100
|
87
|
-
request = api_client.build_request(:get, '/test')
|
88
|
-
expect(request.options[:timeout]).to eq(100)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe '#deserialize' do
|
93
|
-
it "handles Array<Integer>" do
|
94
|
-
api_client = ElasticEmail::ApiClient.new
|
95
|
-
headers = { 'Content-Type' => 'application/json' }
|
96
|
-
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
-
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
-
expect(data).to be_instance_of(Array)
|
99
|
-
expect(data).to eq([12, 34])
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'handles Array<Array<Integer>>' do
|
103
|
-
api_client = ElasticEmail::ApiClient.new
|
104
|
-
headers = { 'Content-Type' => 'application/json' }
|
105
|
-
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
-
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
-
expect(data).to be_instance_of(Array)
|
108
|
-
expect(data).to eq([[12, 34], [56]])
|
109
|
-
end
|
110
|
-
|
111
|
-
it 'handles Hash<String, String>' do
|
112
|
-
api_client = ElasticEmail::ApiClient.new
|
113
|
-
headers = { 'Content-Type' => 'application/json' }
|
114
|
-
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
-
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
-
expect(data).to be_instance_of(Hash)
|
117
|
-
expect(data).to eq(:message => 'Hello')
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe "#object_to_hash" do
|
122
|
-
it 'ignores nils and includes empty arrays' do
|
123
|
-
# uncomment below to test object_to_hash for model
|
124
|
-
# api_client = ElasticEmail::ApiClient.new
|
125
|
-
# _model = ElasticEmail::ModelName.new
|
126
|
-
# update the model attribute below
|
127
|
-
# _model.id = 1
|
128
|
-
# update the expected value (hash) below
|
129
|
-
# expected = {id: 1, name: '', tags: []}
|
130
|
-
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
describe '#build_collection_param' do
|
135
|
-
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
-
let(:api_client) { ElasticEmail::ApiClient.new }
|
137
|
-
|
138
|
-
it 'works for csv' do
|
139
|
-
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
-
end
|
141
|
-
|
142
|
-
it 'works for ssv' do
|
143
|
-
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
-
end
|
145
|
-
|
146
|
-
it 'works for tsv' do
|
147
|
-
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
-
end
|
149
|
-
|
150
|
-
it 'works for pipes' do
|
151
|
-
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
-
end
|
153
|
-
|
154
|
-
it 'works for multi' do
|
155
|
-
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
-
end
|
157
|
-
|
158
|
-
it 'fails for invalid collection format' do
|
159
|
-
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
describe '#json_mime?' do
|
164
|
-
let(:api_client) { ElasticEmail::ApiClient.new }
|
165
|
-
|
166
|
-
it 'works' do
|
167
|
-
expect(api_client.json_mime?(nil)).to eq false
|
168
|
-
expect(api_client.json_mime?('')).to eq false
|
169
|
-
|
170
|
-
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
-
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
-
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
-
|
174
|
-
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
-
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
-
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
describe '#select_header_accept' do
|
181
|
-
let(:api_client) { ElasticEmail::ApiClient.new }
|
182
|
-
|
183
|
-
it 'works' do
|
184
|
-
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
-
expect(api_client.select_header_accept([])).to be_nil
|
186
|
-
|
187
|
-
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
-
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
-
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
-
|
191
|
-
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
-
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe '#select_header_content_type' do
|
197
|
-
let(:api_client) { ElasticEmail::ApiClient.new }
|
198
|
-
|
199
|
-
it 'works' do
|
200
|
-
expect(api_client.select_header_content_type(nil)).to be_nil
|
201
|
-
expect(api_client.select_header_content_type([])).to be_nil
|
202
|
-
|
203
|
-
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
-
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
-
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
-
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
-
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
describe '#sanitize_filename' do
|
212
|
-
let(:api_client) { ElasticEmail::ApiClient.new }
|
213
|
-
|
214
|
-
it 'works' do
|
215
|
-
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
-
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
-
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
-
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
-
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
-
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
-
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
-
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
-
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|