From d3ed821ee7bf09732e73b9d0bb0af2f43d1ca3b5 Mon Sep 17 00:00:00 2001 From: aakanksha-sib Date: Fri, 11 Sep 2020 13:07:58 +0530 Subject: [PATCH] Swagger resync --- README.md | 47 +- docs/AbTestCampaignResult.md | 2 + docs/AbTestCampaignResultClickedLinks.md | 9 + docs/AbTestCampaignResultStatistics.md | 13 + docs/AbTestVersionClicks.md | 7 + docs/AbTestVersionClicksInner.md | 10 + docs/AbTestVersionStats.md | 9 + docs/AddContactToList.md | 3 +- docs/ContactsApi.md | 48 +- docs/CreateDoiContact.md | 2 +- docs/CreateSmsCampaign.md | 2 +- docs/CreateWebhook.md | 2 +- docs/GetAggregatedReport.md | 26 +- docs/GetCampaignStats.md | 1 + docs/ListsApi.md | 8 +- docs/RemoveContactFromList.md | 3 +- docs/SendSmtpEmailSender.md | 1 + docs/SendTransacSms.md | 2 +- .../{SMTPApi.md => TransactionalEmailsApi.md} | 104 +- docs/UpdateSmsCampaign.md | 2 +- docs/UpdateWebhook.md | 2 +- lib/sib-api-v3-sdk.rb | 7 +- lib/sib-api-v3-sdk/api/contacts_api.rb | 80 +- lib/sib-api-v3-sdk/api/lists_api.rb | 8 +- lib/sib-api-v3-sdk/api/smtp_api.rb | 1003 ----------------- .../models/ab_test_campaign_result.rb | 26 +- .../ab_test_campaign_result_clicked_links.rb | 202 ++++ .../ab_test_campaign_result_statistics.rb | 258 +++++ .../models/ab_test_version_clicks.rb | 175 +++ .../models/ab_test_version_clicks_inner.rb | 219 ++++ .../models/ab_test_version_stats.rb | 205 ++++ .../models/add_contact_to_list.rb | 22 +- .../models/create_doi_contact.rb | 5 + .../models/create_sms_campaign.rb | 12 +- lib/sib-api-v3-sdk/models/create_webhook.rb | 2 +- .../models/get_aggregated_report.rb | 65 -- .../models/get_campaign_stats.rb | 18 +- .../models/remove_contact_from_list.rb | 16 +- .../models/send_smtp_email_sender.rb | 20 +- lib/sib-api-v3-sdk/models/send_transac_sms.rb | 12 +- .../models/update_sms_campaign.rb | 12 +- lib/sib-api-v3-sdk/models/update_webhook.rb | 2 +- lib/sib-api-v3-sdk/version.rb | 2 +- spec/api/contacts_api_spec.rb | 12 +- spec/api/lists_api_spec.rb | 4 +- ...ec.rb => transactional_emails_api_spec.rb} | 12 +- ...test_campaign_result_clicked_links_spec.rb | 47 + spec/models/ab_test_campaign_result_spec.rb | 12 + ...ab_test_campaign_result_statistics_spec.rb | 71 ++ .../ab_test_version_clicks_inner_spec.rb | 53 + spec/models/ab_test_version_clicks_spec.rb | 35 + spec/models/ab_test_version_stats_spec.rb | 47 + spec/models/add_contact_to_list_spec.rb | 6 + spec/models/get_campaign_stats_spec.rb | 6 + spec/models/remove_contact_from_list_spec.rb | 6 + spec/models/send_smtp_email_sender_spec.rb | 6 + 56 files changed, 1701 insertions(+), 1290 deletions(-) create mode 100644 docs/AbTestCampaignResultClickedLinks.md create mode 100644 docs/AbTestCampaignResultStatistics.md create mode 100644 docs/AbTestVersionClicks.md create mode 100644 docs/AbTestVersionClicksInner.md create mode 100644 docs/AbTestVersionStats.md rename docs/{SMTPApi.md => TransactionalEmailsApi.md} (86%) delete mode 100644 lib/sib-api-v3-sdk/api/smtp_api.rb create mode 100644 lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb create mode 100644 lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb create mode 100644 lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb create mode 100644 lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb create mode 100644 lib/sib-api-v3-sdk/models/ab_test_version_stats.rb rename spec/api/{smtp_api_spec.rb => transactional_emails_api_spec.rb} (97%) create mode 100644 spec/models/ab_test_campaign_result_clicked_links_spec.rb create mode 100644 spec/models/ab_test_campaign_result_statistics_spec.rb create mode 100644 spec/models/ab_test_version_clicks_inner_spec.rb create mode 100644 spec/models/ab_test_version_clicks_spec.rb create mode 100644 spec/models/ab_test_version_stats_spec.rb diff --git a/README.md b/README.md index 5b3b9ec..de557da 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,12 @@ Class | Method | HTTP request | Description *SibApiV3Sdk::ContactsApi* | [**create_folder**](docs/ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder *SibApiV3Sdk::ContactsApi* | [**create_list**](docs/ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list *SibApiV3Sdk::ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute -*SibApiV3Sdk::ContactsApi* | [**delete_contact**](docs/ContactsApi.md#delete_contact) | **DELETE** /contacts/{email} | Delete a contact +*SibApiV3Sdk::ContactsApi* | [**delete_contact**](docs/ContactsApi.md#delete_contact) | **DELETE** /contacts/{identifier} | Delete a contact *SibApiV3Sdk::ContactsApi* | [**delete_folder**](docs/ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) *SibApiV3Sdk::ContactsApi* | [**delete_list**](docs/ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list *SibApiV3Sdk::ContactsApi* | [**get_attributes**](docs/ContactsApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes -*SibApiV3Sdk::ContactsApi* | [**get_contact_info**](docs/ContactsApi.md#get_contact_info) | **GET** /contacts/{email} | Get a contact's details -*SibApiV3Sdk::ContactsApi* | [**get_contact_stats**](docs/ContactsApi.md#get_contact_stats) | **GET** /contacts/{email}/campaignStats | Get email campaigns' statistics for a contact +*SibApiV3Sdk::ContactsApi* | [**get_contact_info**](docs/ContactsApi.md#get_contact_info) | **GET** /contacts/{identifier} | Get a contact's details +*SibApiV3Sdk::ContactsApi* | [**get_contact_stats**](docs/ContactsApi.md#get_contact_stats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact *SibApiV3Sdk::ContactsApi* | [**get_contacts**](docs/ContactsApi.md#get_contacts) | **GET** /contacts | Get all the contacts *SibApiV3Sdk::ContactsApi* | [**get_contacts_from_list**](docs/ContactsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list *SibApiV3Sdk::ContactsApi* | [**get_folder**](docs/ContactsApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details @@ -113,7 +113,7 @@ Class | Method | HTTP request | Description *SibApiV3Sdk::ContactsApi* | [**remove_contact_from_list**](docs/ContactsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list *SibApiV3Sdk::ContactsApi* | [**request_contact_export**](docs/ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts *SibApiV3Sdk::ContactsApi* | [**update_attribute**](docs/ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute -*SibApiV3Sdk::ContactsApi* | [**update_contact**](docs/ContactsApi.md#update_contact) | **PUT** /contacts/{email} | Update a contact +*SibApiV3Sdk::ContactsApi* | [**update_contact**](docs/ContactsApi.md#update_contact) | **PUT** /contacts/{identifier} | Update a contact *SibApiV3Sdk::ContactsApi* | [**update_folder**](docs/ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder *SibApiV3Sdk::ContactsApi* | [**update_list**](docs/ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list *SibApiV3Sdk::EmailCampaignsApi* | [**create_email_campaign**](docs/EmailCampaignsApi.md#create_email_campaign) | **POST** /emailCampaigns | Create an email campaign @@ -172,29 +172,29 @@ Class | Method | HTTP request | Description *SibApiV3Sdk::SMSCampaignsApi* | [**send_test_sms**](docs/SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send a test SMS campaign *SibApiV3Sdk::SMSCampaignsApi* | [**update_sms_campaign**](docs/SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Update an SMS campaign *SibApiV3Sdk::SMSCampaignsApi* | [**update_sms_campaign_status**](docs/SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update a campaign's status -*SibApiV3Sdk::SMTPApi* | [**create_smtp_template**](docs/SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template -*SibApiV3Sdk::SMTPApi* | [**delete_hardbounces**](docs/SMTPApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces -*SibApiV3Sdk::SMTPApi* | [**delete_smtp_template**](docs/SMTPApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template -*SibApiV3Sdk::SMTPApi* | [**get_aggregated_smtp_report**](docs/SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time -*SibApiV3Sdk::SMTPApi* | [**get_email_event_report**](docs/SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) -*SibApiV3Sdk::SMTPApi* | [**get_smtp_report**](docs/SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day -*SibApiV3Sdk::SMTPApi* | [**get_smtp_template**](docs/SMTPApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information -*SibApiV3Sdk::SMTPApi* | [**get_smtp_templates**](docs/SMTPApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates -*SibApiV3Sdk::SMTPApi* | [**get_transac_blocked_contacts**](docs/SMTPApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts -*SibApiV3Sdk::SMTPApi* | [**get_transac_email_content**](docs/SMTPApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email -*SibApiV3Sdk::SMTPApi* | [**get_transac_emails_list**](docs/SMTPApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters -*SibApiV3Sdk::SMTPApi* | [**send_template**](docs/SMTPApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template -*SibApiV3Sdk::SMTPApi* | [**send_test_template**](docs/SMTPApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list -*SibApiV3Sdk::SMTPApi* | [**send_transac_email**](docs/SMTPApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email -*SibApiV3Sdk::SMTPApi* | [**smtp_blocked_contacts_email_delete**](docs/SMTPApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact -*SibApiV3Sdk::SMTPApi* | [**smtp_log_message_id_delete**](docs/SMTPApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log -*SibApiV3Sdk::SMTPApi* | [**update_smtp_template**](docs/SMTPApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template *SibApiV3Sdk::SendersApi* | [**create_sender**](docs/SendersApi.md#create_sender) | **POST** /senders | Create a new sender *SibApiV3Sdk::SendersApi* | [**delete_sender**](docs/SendersApi.md#delete_sender) | **DELETE** /senders/{senderId} | Delete a sender *SibApiV3Sdk::SendersApi* | [**get_ips**](docs/SendersApi.md#get_ips) | **GET** /senders/ips | Get all the dedicated IPs for your account *SibApiV3Sdk::SendersApi* | [**get_ips_from_sender**](docs/SendersApi.md#get_ips_from_sender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender *SibApiV3Sdk::SendersApi* | [**get_senders**](docs/SendersApi.md#get_senders) | **GET** /senders | Get the list of all your senders *SibApiV3Sdk::SendersApi* | [**update_sender**](docs/SendersApi.md#update_sender) | **PUT** /senders/{senderId} | Update a sender +*SibApiV3Sdk::TransactionalEmailsApi* | [**create_smtp_template**](docs/TransactionalEmailsApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template +*SibApiV3Sdk::TransactionalEmailsApi* | [**delete_hardbounces**](docs/TransactionalEmailsApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces +*SibApiV3Sdk::TransactionalEmailsApi* | [**delete_smtp_template**](docs/TransactionalEmailsApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_aggregated_smtp_report**](docs/TransactionalEmailsApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_email_event_report**](docs/TransactionalEmailsApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_smtp_report**](docs/TransactionalEmailsApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_smtp_template**](docs/TransactionalEmailsApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_smtp_templates**](docs/TransactionalEmailsApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_transac_blocked_contacts**](docs/TransactionalEmailsApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_transac_email_content**](docs/TransactionalEmailsApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email +*SibApiV3Sdk::TransactionalEmailsApi* | [**get_transac_emails_list**](docs/TransactionalEmailsApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters +*SibApiV3Sdk::TransactionalEmailsApi* | [**send_template**](docs/TransactionalEmailsApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template +*SibApiV3Sdk::TransactionalEmailsApi* | [**send_test_template**](docs/TransactionalEmailsApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list +*SibApiV3Sdk::TransactionalEmailsApi* | [**send_transac_email**](docs/TransactionalEmailsApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email +*SibApiV3Sdk::TransactionalEmailsApi* | [**smtp_blocked_contacts_email_delete**](docs/TransactionalEmailsApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact +*SibApiV3Sdk::TransactionalEmailsApi* | [**smtp_log_message_id_delete**](docs/TransactionalEmailsApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log +*SibApiV3Sdk::TransactionalEmailsApi* | [**update_smtp_template**](docs/TransactionalEmailsApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template *SibApiV3Sdk::TransactionalSMSApi* | [**get_sms_events**](docs/TransactionalSMSApi.md#get_sms_events) | **GET** /transactionalSMS/statistics/events | Get all your SMS activity (unaggregated events) *SibApiV3Sdk::TransactionalSMSApi* | [**get_transac_aggregated_sms_report**](docs/TransactionalSMSApi.md#get_transac_aggregated_sms_report) | **GET** /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time *SibApiV3Sdk::TransactionalSMSApi* | [**get_transac_sms_report**](docs/TransactionalSMSApi.md#get_transac_sms_report) | **GET** /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day @@ -209,6 +209,11 @@ Class | Method | HTTP request | Description ## Documentation for Models - [SibApiV3Sdk::AbTestCampaignResult](docs/AbTestCampaignResult.md) + - [SibApiV3Sdk::AbTestCampaignResultClickedLinks](docs/AbTestCampaignResultClickedLinks.md) + - [SibApiV3Sdk::AbTestCampaignResultStatistics](docs/AbTestCampaignResultStatistics.md) + - [SibApiV3Sdk::AbTestVersionClicks](docs/AbTestVersionClicks.md) + - [SibApiV3Sdk::AbTestVersionClicksInner](docs/AbTestVersionClicksInner.md) + - [SibApiV3Sdk::AbTestVersionStats](docs/AbTestVersionStats.md) - [SibApiV3Sdk::AddChildDomain](docs/AddChildDomain.md) - [SibApiV3Sdk::AddContactToList](docs/AddContactToList.md) - [SibApiV3Sdk::AddCredits](docs/AddCredits.md) diff --git a/docs/AbTestCampaignResult.md b/docs/AbTestCampaignResult.md index d34280d..0d0bb7d 100644 --- a/docs/AbTestCampaignResult.md +++ b/docs/AbTestCampaignResult.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **open_rate** | **String** | Open rate for current winning version | [optional] **click_rate** | **String** | Click rate for current winning version | [optional] **winning_version_rate** | **String** | Open/Click rate for the winner version | [optional] +**statistics** | [**AbTestCampaignResultStatistics**](AbTestCampaignResultStatistics.md) | | [optional] +**clicked_links** | [**AbTestCampaignResultClickedLinks**](AbTestCampaignResultClickedLinks.md) | | [optional] diff --git a/docs/AbTestCampaignResultClickedLinks.md b/docs/AbTestCampaignResultClickedLinks.md new file mode 100644 index 0000000..c48b163 --- /dev/null +++ b/docs/AbTestCampaignResultClickedLinks.md @@ -0,0 +1,9 @@ +# SibApiV3Sdk::AbTestCampaignResultClickedLinks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version_a** | [**AbTestVersionClicks**](AbTestVersionClicks.md) | | +**version_b** | [**AbTestVersionClicks**](AbTestVersionClicks.md) | | + + diff --git a/docs/AbTestCampaignResultStatistics.md b/docs/AbTestCampaignResultStatistics.md new file mode 100644 index 0000000..f3648b0 --- /dev/null +++ b/docs/AbTestCampaignResultStatistics.md @@ -0,0 +1,13 @@ +# SibApiV3Sdk::AbTestCampaignResultStatistics + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**openers** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +**clicks** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +**unsubscribed** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +**hard_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +**soft_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +**complaints** | [**AbTestVersionStats**](AbTestVersionStats.md) | | + + diff --git a/docs/AbTestVersionClicks.md b/docs/AbTestVersionClicks.md new file mode 100644 index 0000000..1e8e4a6 --- /dev/null +++ b/docs/AbTestVersionClicks.md @@ -0,0 +1,7 @@ +# SibApiV3Sdk::AbTestVersionClicks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/AbTestVersionClicksInner.md b/docs/AbTestVersionClicksInner.md new file mode 100644 index 0000000..0fb222b --- /dev/null +++ b/docs/AbTestVersionClicksInner.md @@ -0,0 +1,10 @@ +# SibApiV3Sdk::AbTestVersionClicksInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link** | **String** | URL of the link | +**clicks_count** | **Float** | Number of times a link is clicked | +**click_rate** | **String** | Percentage of clicks of link with respect to total clicks | + + diff --git a/docs/AbTestVersionStats.md b/docs/AbTestVersionStats.md new file mode 100644 index 0000000..f9aed6f --- /dev/null +++ b/docs/AbTestVersionStats.md @@ -0,0 +1,9 @@ +# SibApiV3Sdk::AbTestVersionStats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version_a** | **String** | percentage of an event for version A | +**version_b** | **String** | percentage of an event for version B | + + diff --git a/docs/AddContactToList.md b/docs/AddContactToList.md index b0355c9..234151e 100644 --- a/docs/AddContactToList.md +++ b/docs/AddContactToList.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**emails** | **Array<String>** | Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional] +**emails** | **Array<String>** | Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional] +**ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional] diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md index 0d758bd..408c33a 100644 --- a/docs/ContactsApi.md +++ b/docs/ContactsApi.md @@ -11,12 +11,12 @@ Method | HTTP request | Description [**create_folder**](ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder [**create_list**](ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list [**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute -[**delete_contact**](ContactsApi.md#delete_contact) | **DELETE** /contacts/{email} | Delete a contact +[**delete_contact**](ContactsApi.md#delete_contact) | **DELETE** /contacts/{identifier} | Delete a contact [**delete_folder**](ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) [**delete_list**](ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list [**get_attributes**](ContactsApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes -[**get_contact_info**](ContactsApi.md#get_contact_info) | **GET** /contacts/{email} | Get a contact's details -[**get_contact_stats**](ContactsApi.md#get_contact_stats) | **GET** /contacts/{email}/campaignStats | Get email campaigns' statistics for a contact +[**get_contact_info**](ContactsApi.md#get_contact_info) | **GET** /contacts/{identifier} | Get a contact's details +[**get_contact_stats**](ContactsApi.md#get_contact_stats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact [**get_contacts**](ContactsApi.md#get_contacts) | **GET** /contacts | Get all the contacts [**get_contacts_from_list**](ContactsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list [**get_folder**](ContactsApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details @@ -28,7 +28,7 @@ Method | HTTP request | Description [**remove_contact_from_list**](ContactsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list [**request_contact_export**](ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts [**update_attribute**](ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute -[**update_contact**](ContactsApi.md#update_contact) | **PUT** /contacts/{email} | Update a contact +[**update_contact**](ContactsApi.md#update_contact) | **PUT** /contacts/{identifier} | Update a contact [**update_folder**](ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder [**update_list**](ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list @@ -59,7 +59,7 @@ api_instance = SibApiV3Sdk::ContactsApi.new list_id = 789 # Integer | Id of the list -contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses of the contacts +contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses OR IDs of the contacts begin @@ -76,7 +76,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **list_id** | **Integer**| Id of the list | - **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses of the contacts | + **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses OR IDs of the contacts | ### Return type @@ -442,7 +442,7 @@ nil (empty response body) # **delete_contact** -> delete_contact(email) +> delete_contact(identifier) Delete a contact @@ -465,12 +465,12 @@ end api_instance = SibApiV3Sdk::ContactsApi.new -email = 'email_example' # String | Email (urlencoded) of the contact +identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact begin #Delete a contact - api_instance.delete_contact(email) + api_instance.delete_contact(identifier) rescue SibApiV3Sdk::ApiError => e puts "Exception when calling ContactsApi->delete_contact: #{e}" end @@ -480,7 +480,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **email** | **String**| Email (urlencoded) of the contact | + **identifier** | **String**| Email (urlencoded) OR ID of the contact | ### Return type @@ -661,7 +661,7 @@ This endpoint does not need any parameter. # **get_contact_info** -> GetExtendedContactDetails get_contact_info(email) +> GetExtendedContactDetails get_contact_info(identifier) Get a contact's details @@ -684,12 +684,12 @@ end api_instance = SibApiV3Sdk::ContactsApi.new -email = 'email_example' # String | Email (urlencoded) of the contact OR its SMS attribute value +identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact OR its SMS attribute value begin #Get a contact's details - result = api_instance.get_contact_info(email) + result = api_instance.get_contact_info(identifier) p result rescue SibApiV3Sdk::ApiError => e puts "Exception when calling ContactsApi->get_contact_info: #{e}" @@ -700,7 +700,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **email** | **String**| Email (urlencoded) of the contact OR its SMS attribute value | + **identifier** | **String**| Email (urlencoded) OR ID of the contact OR its SMS attribute value | ### Return type @@ -718,7 +718,7 @@ Name | Type | Description | Notes # **get_contact_stats** -> GetContactCampaignStats get_contact_stats(email, opts) +> GetContactCampaignStats get_contact_stats(identifier, opts) Get email campaigns' statistics for a contact @@ -741,7 +741,7 @@ end api_instance = SibApiV3Sdk::ContactsApi.new -email = 'email_example' # String | Email address (urlencoded) of the contact +identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact opts = { start_date: Date.parse('2013-10-20'), # Date | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate @@ -750,7 +750,7 @@ opts = { begin #Get email campaigns' statistics for a contact - result = api_instance.get_contact_stats(email, opts) + result = api_instance.get_contact_stats(identifier, opts) p result rescue SibApiV3Sdk::ApiError => e puts "Exception when calling ContactsApi->get_contact_stats: #{e}" @@ -761,7 +761,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **email** | **String**| Email address (urlencoded) of the contact | + **identifier** | **String**| Email (urlencoded) OR ID of the contact | **start_date** | **Date**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional] **end_date** | **Date**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate | [optional] @@ -1289,7 +1289,7 @@ api_instance = SibApiV3Sdk::ContactsApi.new list_id = 789 # Integer | Id of the list -contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails adresses of the contact +contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails addresses OR IDs of the contacts begin @@ -1306,7 +1306,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **list_id** | **Integer**| Id of the list | - **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails adresses of the contact | + **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails addresses OR IDs of the contacts | ### Return type @@ -1445,7 +1445,7 @@ nil (empty response body) # **update_contact** -> update_contact(email, update_contact) +> update_contact(identifier, update_contact) Update a contact @@ -1468,14 +1468,14 @@ end api_instance = SibApiV3Sdk::ContactsApi.new -email = 'email_example' # String | Email (urlencoded) of the contact +identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact update_contact = SibApiV3Sdk::UpdateContact.new # UpdateContact | Values to update a contact begin #Update a contact - api_instance.update_contact(email, update_contact) + api_instance.update_contact(identifier, update_contact) rescue SibApiV3Sdk::ApiError => e puts "Exception when calling ContactsApi->update_contact: #{e}" end @@ -1485,7 +1485,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **email** | **String**| Email (urlencoded) of the contact | + **identifier** | **String**| Email (urlencoded) OR ID of the contact | **update_contact** | [**UpdateContact**](UpdateContact.md)| Values to update a contact | ### Return type diff --git a/docs/CreateDoiContact.md b/docs/CreateDoiContact.md index c15614b..14cdc7d 100644 --- a/docs/CreateDoiContact.md +++ b/docs/CreateDoiContact.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **include_list_ids** | **Array<Integer>** | Lists under user account where contact should be added | **exclude_list_ids** | **Array<Integer>** | Lists under user account where contact should not be added | [optional] **template_id** | **Integer** | Id of the Double opt-in (DOI) template | -**redirection_url** | **String** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. | [optional] +**redirection_url** | **String** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. | diff --git a/docs/CreateSmsCampaign.md b/docs/CreateSmsCampaign.md index 61f71b9..738064f 100644 --- a/docs/CreateSmsCampaign.md +++ b/docs/CreateSmsCampaign.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Name of the campaign | -**sender** | **String** | Name of the sender. The number of characters is limited to 11 | +**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | **content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | **recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] **scheduled_at** | **DateTime** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] diff --git a/docs/CreateWebhook.md b/docs/CreateWebhook.md index e45401b..3398f1c 100644 --- a/docs/CreateWebhook.md +++ b/docs/CreateWebhook.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **String** | URL of the webhook | **description** | **String** | Description of the webhook | [optional] -**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – sent, request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition & delivered | +**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` | **type** | **String** | Type of the webhook | [optional] [default to 'transactional'] diff --git a/docs/GetAggregatedReport.md b/docs/GetAggregatedReport.md index 1b58786..c05ee4d 100644 --- a/docs/GetAggregatedReport.md +++ b/docs/GetAggregatedReport.md @@ -3,18 +3,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**range** | **String** | Time frame of the report | -**requests** | **Integer** | Number of requests for the timeframe | -**delivered** | **Integer** | Number of delivered emails for the timeframe | -**hard_bounces** | **Integer** | Number of hardbounces for the timeframe | -**soft_bounces** | **Integer** | Number of softbounces for the timeframe | -**clicks** | **Integer** | Number of clicks for the timeframe | -**unique_clicks** | **Integer** | Number of unique clicks for the timeframe | -**opens** | **Integer** | Number of openings for the timeframe | -**unique_opens** | **Integer** | Number of unique openings for the timeframe | -**spam_reports** | **Integer** | Number of complaint (spam report) for the timeframe | -**blocked** | **Integer** | Number of blocked contact emails for the timeframe | -**invalid** | **Integer** | Number of invalid emails for the timeframe | -**unsubscribed** | **Integer** | Number of unsubscribed emails for the timeframe | +**range** | **String** | Time frame of the report | [optional] +**requests** | **Integer** | Number of requests for the timeframe | [optional] +**delivered** | **Integer** | Number of delivered emails for the timeframe | [optional] +**hard_bounces** | **Integer** | Number of hardbounces for the timeframe | [optional] +**soft_bounces** | **Integer** | Number of softbounces for the timeframe | [optional] +**clicks** | **Integer** | Number of clicks for the timeframe | [optional] +**unique_clicks** | **Integer** | Number of unique clicks for the timeframe | [optional] +**opens** | **Integer** | Number of openings for the timeframe | [optional] +**unique_opens** | **Integer** | Number of unique openings for the timeframe | [optional] +**spam_reports** | **Integer** | Number of complaint (spam report) for the timeframe | [optional] +**blocked** | **Integer** | Number of blocked contact emails for the timeframe | [optional] +**invalid** | **Integer** | Number of invalid emails for the timeframe | [optional] +**unsubscribed** | **Integer** | Number of unsubscribed emails for the timeframe | [optional] diff --git a/docs/GetCampaignStats.md b/docs/GetCampaignStats.md index e94fd6d..9a504f3 100644 --- a/docs/GetCampaignStats.md +++ b/docs/GetCampaignStats.md @@ -15,5 +15,6 @@ Name | Type | Description | Notes **unsubscriptions** | **Integer** | Number of unsubscription for the campaign | **viewed** | **Integer** | Number of openings for the campaign | **deferred** | **Integer** | Number of deferred emails for the campaign | [optional] +**return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] diff --git a/docs/ListsApi.md b/docs/ListsApi.md index e36ae46..4f9328b 100644 --- a/docs/ListsApi.md +++ b/docs/ListsApi.md @@ -41,7 +41,7 @@ api_instance = SibApiV3Sdk::ListsApi.new list_id = 789 # Integer | Id of the list -contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses of the contacts +contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses OR IDs of the contacts begin @@ -58,7 +58,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **list_id** | **Integer**| Id of the list | - **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses of the contacts | + **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses OR IDs of the contacts | ### Return type @@ -459,7 +459,7 @@ api_instance = SibApiV3Sdk::ListsApi.new list_id = 789 # Integer | Id of the list -contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails adresses of the contact +contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails addresses OR IDs of the contacts begin @@ -476,7 +476,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **list_id** | **Integer**| Id of the list | - **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails adresses of the contact | + **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails addresses OR IDs of the contacts | ### Return type diff --git a/docs/RemoveContactFromList.md b/docs/RemoveContactFromList.md index eebcf09..9e88176 100644 --- a/docs/RemoveContactFromList.md +++ b/docs/RemoveContactFromList.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **emails** | **Array<String>** | Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. | [optional] -**all** | **BOOLEAN** | Required if 'emails' is empty. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional] +**ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. | [optional] +**all** | **BOOLEAN** | Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional] diff --git a/docs/SendSmtpEmailSender.md b/docs/SendSmtpEmailSender.md index 983f527..37bdc42 100644 --- a/docs/SendSmtpEmailSender.md +++ b/docs/SendSmtpEmailSender.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Name of the sender from which the emails will be sent. Maximum allowed characters are 70. | [optional] **email** | **String** | Email of the sender from which the emails will be sent | +**id** | **Integer** | Id of the sender from which the emails will be sent | [optional] diff --git a/docs/SendTransacSms.md b/docs/SendTransacSms.md index de534d0..69b8a51 100644 --- a/docs/SendTransacSms.md +++ b/docs/SendTransacSms.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sender** | **String** | Name of the sender. Only alphanumeric characters. No more than 11 characters | +**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | **recipient** | **String** | Mobile number to send SMS with the country code | **content** | **String** | Content of the message. If more than 160 characters long, will be sent as multiple text messages | **type** | **String** | Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. | [optional] [default to 'transactional'] diff --git a/docs/SMTPApi.md b/docs/TransactionalEmailsApi.md similarity index 86% rename from docs/SMTPApi.md rename to docs/TransactionalEmailsApi.md index f7d4de6..b41b87d 100644 --- a/docs/SMTPApi.md +++ b/docs/TransactionalEmailsApi.md @@ -1,26 +1,26 @@ -# SibApiV3Sdk::SMTPApi +# SibApiV3Sdk::TransactionalEmailsApi All URIs are relative to *https://api.sendinblue.com/v3* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_smtp_template**](SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template -[**delete_hardbounces**](SMTPApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces -[**delete_smtp_template**](SMTPApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template -[**get_aggregated_smtp_report**](SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time -[**get_email_event_report**](SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) -[**get_smtp_report**](SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day -[**get_smtp_template**](SMTPApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information -[**get_smtp_templates**](SMTPApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates -[**get_transac_blocked_contacts**](SMTPApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts -[**get_transac_email_content**](SMTPApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email -[**get_transac_emails_list**](SMTPApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters -[**send_template**](SMTPApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template -[**send_test_template**](SMTPApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list -[**send_transac_email**](SMTPApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email -[**smtp_blocked_contacts_email_delete**](SMTPApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact -[**smtp_log_message_id_delete**](SMTPApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log -[**update_smtp_template**](SMTPApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template +[**create_smtp_template**](TransactionalEmailsApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template +[**delete_hardbounces**](TransactionalEmailsApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces +[**delete_smtp_template**](TransactionalEmailsApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template +[**get_aggregated_smtp_report**](TransactionalEmailsApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time +[**get_email_event_report**](TransactionalEmailsApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) +[**get_smtp_report**](TransactionalEmailsApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day +[**get_smtp_template**](TransactionalEmailsApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information +[**get_smtp_templates**](TransactionalEmailsApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates +[**get_transac_blocked_contacts**](TransactionalEmailsApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts +[**get_transac_email_content**](TransactionalEmailsApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email +[**get_transac_emails_list**](TransactionalEmailsApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters +[**send_template**](TransactionalEmailsApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template +[**send_test_template**](TransactionalEmailsApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list +[**send_transac_email**](TransactionalEmailsApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email +[**smtp_blocked_contacts_email_delete**](TransactionalEmailsApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact +[**smtp_log_message_id_delete**](TransactionalEmailsApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log +[**update_smtp_template**](TransactionalEmailsApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template # **create_smtp_template** @@ -45,7 +45,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new smtp_template = SibApiV3Sdk::CreateSmtpTemplate.new # CreateSmtpTemplate | values to update in transactional email template @@ -55,7 +55,7 @@ begin result = api_instance.create_smtp_template(smtp_template) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->create_smtp_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->create_smtp_template: #{e}" end ``` @@ -104,7 +104,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { delete_hardbounces: SibApiV3Sdk::DeleteHardbounces.new # DeleteHardbounces | values to delete hardbounces @@ -114,7 +114,7 @@ begin #Delete hardbounces api_instance.delete_hardbounces(opts) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->delete_hardbounces: #{e}" + puts "Exception when calling TransactionalEmailsApi->delete_hardbounces: #{e}" end ``` @@ -161,7 +161,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new template_id = 789 # Integer | id of the template @@ -170,7 +170,7 @@ begin #Delete an inactive email template api_instance.delete_smtp_template(template_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->delete_smtp_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->delete_smtp_template: #{e}" end ``` @@ -217,7 +217,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @@ -231,7 +231,7 @@ begin result = api_instance.get_aggregated_smtp_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_aggregated_smtp_report: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_aggregated_smtp_report: #{e}" end ``` @@ -281,7 +281,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { limit: 50, # Integer | Number limitation for the result returned @@ -301,7 +301,7 @@ begin result = api_instance.get_email_event_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_email_event_report: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_email_event_report: #{e}" end ``` @@ -357,7 +357,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { limit: 10, # Integer | Number of documents returned per page @@ -373,7 +373,7 @@ begin result = api_instance.get_smtp_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_smtp_report: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_smtp_report: #{e}" end ``` @@ -425,7 +425,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new template_id = 789 # Integer | id of the template @@ -435,7 +435,7 @@ begin result = api_instance.get_smtp_template(template_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_smtp_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_smtp_template: #{e}" end ``` @@ -482,7 +482,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { template_status: true, # BOOLEAN | Filter on the status of the template. Active = true, inactive = false @@ -495,7 +495,7 @@ begin result = api_instance.get_smtp_templates(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_smtp_templates: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_smtp_templates: #{e}" end ``` @@ -544,7 +544,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts @@ -559,7 +559,7 @@ begin result = api_instance.get_transac_blocked_contacts(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_transac_blocked_contacts: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_transac_blocked_contacts: #{e}" end ``` @@ -610,7 +610,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new uuid = 'uuid_example' # String | Unique id of the transactional email that has been sent to a particular contact @@ -620,7 +620,7 @@ begin result = api_instance.get_transac_email_content(uuid) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_transac_email_content: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_transac_email_content: #{e}" end ``` @@ -669,7 +669,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new opts = { email: 'email_example', # String | Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. @@ -684,7 +684,7 @@ begin result = api_instance.get_transac_emails_list(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->get_transac_emails_list: #{e}" + puts "Exception when calling TransactionalEmailsApi->get_transac_emails_list: #{e}" end ``` @@ -737,7 +737,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new template_id = 789 # Integer | Id of the template @@ -749,7 +749,7 @@ begin result = api_instance.send_template(template_id, send_email) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->send_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->send_template: #{e}" end ``` @@ -797,7 +797,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new template_id = 789 # Integer | Id of the template @@ -808,7 +808,7 @@ begin #Send a template to your test list api_instance.send_test_template(template_id, send_test_email) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->send_test_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->send_test_template: #{e}" end ``` @@ -856,7 +856,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new send_smtp_email = SibApiV3Sdk::SendSmtpEmail.new # SendSmtpEmail | Values to send a transactional email @@ -866,7 +866,7 @@ begin result = api_instance.send_transac_email(send_smtp_email) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->send_transac_email: #{e}" + puts "Exception when calling TransactionalEmailsApi->send_transac_email: #{e}" end ``` @@ -913,7 +913,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new email = 'email_example' # String | contact email (urlencoded) to unblock. @@ -922,7 +922,7 @@ begin #Unblock or resubscribe a transactional contact api_instance.smtp_blocked_contacts_email_delete(email) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->smtp_blocked_contacts_email_delete: #{e}" + puts "Exception when calling TransactionalEmailsApi->smtp_blocked_contacts_email_delete: #{e}" end ``` @@ -969,7 +969,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new message_id = 'message_id_example' # String | MessageId of the transactional log to delete @@ -978,7 +978,7 @@ begin #Delete an SMTP transactional log api_instance.smtp_log_message_id_delete(message_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->smtp_log_message_id_delete: #{e}" + puts "Exception when calling TransactionalEmailsApi->smtp_log_message_id_delete: #{e}" end ``` @@ -1025,7 +1025,7 @@ SibApiV3Sdk.configure do |config| #config.api_key_prefix['partner-key'] = 'Bearer' end -api_instance = SibApiV3Sdk::SMTPApi.new +api_instance = SibApiV3Sdk::TransactionalEmailsApi.new template_id = 789 # Integer | id of the template @@ -1036,7 +1036,7 @@ begin #Update an email template api_instance.update_smtp_template(template_id, smtp_template) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMTPApi->update_smtp_template: #{e}" + puts "Exception when calling TransactionalEmailsApi->update_smtp_template: #{e}" end ``` diff --git a/docs/UpdateSmsCampaign.md b/docs/UpdateSmsCampaign.md index 4fbcb4c..2cf2829 100644 --- a/docs/UpdateSmsCampaign.md +++ b/docs/UpdateSmsCampaign.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Name of the campaign | [optional] -**sender** | **String** | Name of the sender. The number of characters is limited to 11 | [optional] +**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional] **content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | [optional] **recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] **scheduled_at** | **DateTime** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] diff --git a/docs/UpdateWebhook.md b/docs/UpdateWebhook.md index b7b836a..711582c 100644 --- a/docs/UpdateWebhook.md +++ b/docs/UpdateWebhook.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **String** | URL of the webhook | [optional] **description** | **String** | Description of the webhook | [optional] -**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition and delivered | [optional] +**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered` | [optional] diff --git a/lib/sib-api-v3-sdk.rb b/lib/sib-api-v3-sdk.rb index 2f1c059..d598207 100644 --- a/lib/sib-api-v3-sdk.rb +++ b/lib/sib-api-v3-sdk.rb @@ -18,6 +18,11 @@ # Models require 'sib-api-v3-sdk/models/ab_test_campaign_result' +require 'sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links' +require 'sib-api-v3-sdk/models/ab_test_campaign_result_statistics' +require 'sib-api-v3-sdk/models/ab_test_version_clicks' +require 'sib-api-v3-sdk/models/ab_test_version_clicks_inner' +require 'sib-api-v3-sdk/models/ab_test_version_stats' require 'sib-api-v3-sdk/models/add_child_domain' require 'sib-api-v3-sdk/models/add_contact_to_list' require 'sib-api-v3-sdk/models/add_credits' @@ -199,8 +204,8 @@ require 'sib-api-v3-sdk/api/process_api' require 'sib-api-v3-sdk/api/reseller_api' require 'sib-api-v3-sdk/api/sms_campaigns_api' -require 'sib-api-v3-sdk/api/smtp_api' require 'sib-api-v3-sdk/api/senders_api' +require 'sib-api-v3-sdk/api/transactional_emails_api' require 'sib-api-v3-sdk/api/transactional_sms_api' require 'sib-api-v3-sdk/api/webhooks_api' diff --git a/lib/sib-api-v3-sdk/api/contacts_api.rb b/lib/sib-api-v3-sdk/api/contacts_api.rb index 9033331..33352a5 100644 --- a/lib/sib-api-v3-sdk/api/contacts_api.rb +++ b/lib/sib-api-v3-sdk/api/contacts_api.rb @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def add_contact_to_list(list_id, contact_emails, opts = {}) @@ -31,7 +31,7 @@ def add_contact_to_list(list_id, contact_emails, opts = {}) # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) @@ -413,28 +413,28 @@ def delete_attribute_with_http_info(attribute_category, attribute_name, opts = { return data, status_code, headers end # Delete a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @return [nil] - def delete_contact(email, opts = {}) - delete_contact_with_http_info(email, opts) + def delete_contact(identifier, opts = {}) + delete_contact_with_http_info(identifier, opts) nil end # Delete a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def delete_contact_with_http_info(email, opts = {}) + def delete_contact_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact ...' end - # verify the required parameter 'email' is set - if @api_client.config.client_side_validation && email.nil? - fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.delete_contact" + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.delete_contact" end # resource path - local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', email.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} @@ -612,28 +612,28 @@ def get_attributes_with_http_info(opts = {}) return data, status_code, headers end # Get a contact's details - # @param email Email (urlencoded) of the contact OR its SMS attribute value + # @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value # @param [Hash] opts the optional parameters # @return [GetExtendedContactDetails] - def get_contact_info(email, opts = {}) - data, _status_code, _headers = get_contact_info_with_http_info(email, opts) + def get_contact_info(identifier, opts = {}) + data, _status_code, _headers = get_contact_info_with_http_info(identifier, opts) data end # Get a contact's details - # @param email Email (urlencoded) of the contact OR its SMS attribute value + # @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value # @param [Hash] opts the optional parameters # @return [Array<(GetExtendedContactDetails, Fixnum, Hash)>] GetExtendedContactDetails data, response status code and response headers - def get_contact_info_with_http_info(email, opts = {}) + def get_contact_info_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_info ...' end - # verify the required parameter 'email' is set - if @api_client.config.client_side_validation && email.nil? - fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.get_contact_info" + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_info" end # resource path - local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', email.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} @@ -664,32 +664,32 @@ def get_contact_info_with_http_info(email, opts = {}) return data, status_code, headers end # Get email campaigns' statistics for a contact - # @param email Email address (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate # @return [GetContactCampaignStats] - def get_contact_stats(email, opts = {}) - data, _status_code, _headers = get_contact_stats_with_http_info(email, opts) + def get_contact_stats(identifier, opts = {}) + data, _status_code, _headers = get_contact_stats_with_http_info(identifier, opts) data end # Get email campaigns' statistics for a contact - # @param email Email address (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate # @return [Array<(GetContactCampaignStats, Fixnum, Hash)>] GetContactCampaignStats data, response status code and response headers - def get_contact_stats_with_http_info(email, opts = {}) + def get_contact_stats_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_stats ...' end - # verify the required parameter 'email' is set - if @api_client.config.client_side_validation && email.nil? - fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.get_contact_stats" + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_stats" end # resource path - local_var_path = '/contacts/{email}/campaignStats'.sub('{' + 'email' + '}', email.to_s) + local_var_path = '/contacts/{identifier}/campaignStats'.sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} @@ -1187,7 +1187,7 @@ def import_contacts_with_http_info(request_contact_import, opts = {}) end # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def remove_contact_from_list(list_id, contact_emails, opts = {}) @@ -1197,7 +1197,7 @@ def remove_contact_from_list(list_id, contact_emails, opts = {}) # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) @@ -1365,34 +1365,34 @@ def update_attribute_with_http_info(attribute_category, attribute_name, update_a return data, status_code, headers end # Update a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param update_contact Values to update a contact # @param [Hash] opts the optional parameters # @return [nil] - def update_contact(email, update_contact, opts = {}) - update_contact_with_http_info(email, update_contact, opts) + def update_contact(identifier, update_contact, opts = {}) + update_contact_with_http_info(identifier, update_contact, opts) nil end # Update a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param update_contact Values to update a contact # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def update_contact_with_http_info(email, update_contact, opts = {}) + def update_contact_with_http_info(identifier, update_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.update_contact ...' end - # verify the required parameter 'email' is set - if @api_client.config.client_side_validation && email.nil? - fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.update_contact" + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.update_contact" end # verify the required parameter 'update_contact' is set if @api_client.config.client_side_validation && update_contact.nil? fail ArgumentError, "Missing the required parameter 'update_contact' when calling ContactsApi.update_contact" end # resource path - local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', email.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} diff --git a/lib/sib-api-v3-sdk/api/lists_api.rb b/lib/sib-api-v3-sdk/api/lists_api.rb index f5e3b62..351172d 100644 --- a/lib/sib-api-v3-sdk/api/lists_api.rb +++ b/lib/sib-api-v3-sdk/api/lists_api.rb @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def add_contact_to_list(list_id, contact_emails, opts = {}) @@ -31,7 +31,7 @@ def add_contact_to_list(list_id, contact_emails, opts = {}) # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) @@ -417,7 +417,7 @@ def get_lists_with_http_info(opts = {}) end # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def remove_contact_from_list(list_id, contact_emails, opts = {}) @@ -427,7 +427,7 @@ def remove_contact_from_list(list_id, contact_emails, opts = {}) # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) diff --git a/lib/sib-api-v3-sdk/api/smtp_api.rb b/lib/sib-api-v3-sdk/api/smtp_api.rb deleted file mode 100644 index 8d4a812..0000000 --- a/lib/sib-api-v3-sdk/api/smtp_api.rb +++ /dev/null @@ -1,1003 +0,0 @@ -=begin -#SendinBlue API - -#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.12 - -=end - -require 'uri' - -module SibApiV3Sdk - class SMTPApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create an email template - # @param smtp_template values to update in transactional email template - # @param [Hash] opts the optional parameters - # @return [CreateModel] - def create_smtp_template(smtp_template, opts = {}) - data, _status_code, _headers = create_smtp_template_with_http_info(smtp_template, opts) - data - end - - # Create an email template - # @param smtp_template values to update in transactional email template - # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers - def create_smtp_template_with_http_info(smtp_template, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.create_smtp_template ...' - end - # verify the required parameter 'smtp_template' is set - if @api_client.config.client_side_validation && smtp_template.nil? - fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.create_smtp_template" - end - # resource path - local_var_path = '/smtp/templates' - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(smtp_template) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'CreateModel') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#create_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Delete hardbounces - # Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - # @param [Hash] opts the optional parameters - # @option opts [DeleteHardbounces] :delete_hardbounces values to delete hardbounces - # @return [nil] - def delete_hardbounces(opts = {}) - delete_hardbounces_with_http_info(opts) - nil - end - - # Delete hardbounces - # Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - # @param [Hash] opts the optional parameters - # @option opts [DeleteHardbounces] :delete_hardbounces values to delete hardbounces - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def delete_hardbounces_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.delete_hardbounces ...' - end - # resource path - local_var_path = '/smtp/deleteHardbounces' - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(opts[:'delete_hardbounces']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#delete_hardbounces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Delete an inactive email template - # @param template_id id of the template - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_smtp_template(template_id, opts = {}) - delete_smtp_template_with_http_info(template_id, opts) - nil - end - - # Delete an inactive email template - # @param template_id id of the template - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def delete_smtp_template_with_http_info(template_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.delete_smtp_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.delete_smtp_template" - end - # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#delete_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get your transactional email activity aggregated over a period of time - # @param [Hash] opts the optional parameters - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :tag Tag of the emails - # @return [GetAggregatedReport] - def get_aggregated_smtp_report(opts = {}) - data, _status_code, _headers = get_aggregated_smtp_report_with_http_info(opts) - data - end - - # Get your transactional email activity aggregated over a period of time - # @param [Hash] opts the optional parameters - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :tag Tag of the emails - # @return [Array<(GetAggregatedReport, Fixnum, Hash)>] GetAggregatedReport data, response status code and response headers - def get_aggregated_smtp_report_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_aggregated_smtp_report ...' - end - # resource path - local_var_path = '/smtp/statistics/aggregatedReport' - - # query parameters - query_params = {} - query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? - query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? - query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? - query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetAggregatedReport') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_aggregated_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get all your transactional email activity (unaggregated events) - # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit Number limitation for the result returned (default to 50) - # @option opts [Integer] :offset Beginning point in the list to retrieve from. (default to 0) - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :email Filter the report for a specific email addresses - # @option opts [String] :event Filter the report for a specific event type - # @option opts [String] :tags Filter the report for tags (serialized and urlencoded array) - # @option opts [String] :message_id Filter on a specific message id - # @option opts [Integer] :template_id Filter on a specific template id - # @return [GetEmailEventReport] - def get_email_event_report(opts = {}) - data, _status_code, _headers = get_email_event_report_with_http_info(opts) - data - end - - # Get all your transactional email activity (unaggregated events) - # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit Number limitation for the result returned - # @option opts [Integer] :offset Beginning point in the list to retrieve from. - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :email Filter the report for a specific email addresses - # @option opts [String] :event Filter the report for a specific event type - # @option opts [String] :tags Filter the report for tags (serialized and urlencoded array) - # @option opts [String] :message_id Filter on a specific message id - # @option opts [Integer] :template_id Filter on a specific template id - # @return [Array<(GetEmailEventReport, Fixnum, Hash)>] GetEmailEventReport data, response status code and response headers - def get_email_event_report_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_email_event_report ...' - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_email_event_report, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed'].include?(opts[:'event']) - fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked, unsubscribed' - end - # resource path - local_var_path = '/smtp/statistics/events' - - # query parameters - query_params = {} - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? - query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? - query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? - query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? - query_params[:'event'] = opts[:'event'] if !opts[:'event'].nil? - query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? - query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil? - query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetEmailEventReport') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_email_event_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get your transactional email activity aggregated per day - # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit Number of documents returned per page (default to 10) - # @option opts [Integer] :offset Index of the first document on the page (default to 0) - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :tag Tag of the emails - # @return [GetReports] - def get_smtp_report(opts = {}) - data, _status_code, _headers = get_smtp_report_with_http_info(opts) - data - end - - # Get your transactional email activity aggregated per day - # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit Number of documents returned per page - # @option opts [Integer] :offset Index of the first document on the page - # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) - # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) - # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - # @option opts [String] :tag Tag of the emails - # @return [Array<(GetReports, Fixnum, Hash)>] GetReports data, response status code and response headers - def get_smtp_report_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_smtp_report ...' - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 30 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_report, must be smaller than or equal to 30.' - end - - # resource path - local_var_path = '/smtp/statistics/reports' - - # query parameters - query_params = {} - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? - query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? - query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? - query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetReports') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Returns the template information - # @param template_id id of the template - # @param [Hash] opts the optional parameters - # @return [GetSmtpTemplateOverview] - def get_smtp_template(template_id, opts = {}) - data, _status_code, _headers = get_smtp_template_with_http_info(template_id, opts) - data - end - - # Returns the template information - # @param template_id id of the template - # @param [Hash] opts the optional parameters - # @return [Array<(GetSmtpTemplateOverview, Fixnum, Hash)>] GetSmtpTemplateOverview data, response status code and response headers - def get_smtp_template_with_http_info(template_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_smtp_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.get_smtp_template" - end - # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetSmtpTemplateOverview') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get the list of email templates - # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false - # @option opts [Integer] :limit Number of documents returned per page (default to 50) - # @option opts [Integer] :offset Index of the first document in the page (default to 0) - # @return [GetSmtpTemplates] - def get_smtp_templates(opts = {}) - data, _status_code, _headers = get_smtp_templates_with_http_info(opts) - data - end - - # Get the list of email templates - # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false - # @option opts [Integer] :limit Number of documents returned per page - # @option opts [Integer] :offset Index of the first document in the page - # @return [Array<(GetSmtpTemplates, Fixnum, Hash)>] GetSmtpTemplates data, response status code and response headers - def get_smtp_templates_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_smtp_templates ...' - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_smtp_templates, must be smaller than or equal to 1000.' - end - - # resource path - local_var_path = '/smtp/templates' - - # query parameters - query_params = {} - query_params[:'templateStatus'] = opts[:'template_status'] if !opts[:'template_status'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetSmtpTemplates') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_smtp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get the list of blocked or unsubscribed transactional contacts - # @param [Hash] opts the optional parameters - # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts - # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts - # @option opts [Integer] :limit Number of documents returned per page (default to 50) - # @option opts [Integer] :offset Index of the first document on the page (default to 0) - # @option opts [Array] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - # @return [GetTransacBlockedContacts] - def get_transac_blocked_contacts(opts = {}) - data, _status_code, _headers = get_transac_blocked_contacts_with_http_info(opts) - data - end - - # Get the list of blocked or unsubscribed transactional contacts - # @param [Hash] opts the optional parameters - # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts - # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts - # @option opts [Integer] :limit Number of documents returned per page - # @option opts [Integer] :offset Index of the first document on the page - # @option opts [Array] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - # @return [Array<(GetTransacBlockedContacts, Fixnum, Hash)>] GetTransacBlockedContacts data, response status code and response headers - def get_transac_blocked_contacts_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_transac_blocked_contacts ...' - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_transac_blocked_contacts, must be smaller than or equal to 100.' - end - - # resource path - local_var_path = '/smtp/blockedContacts' - - # query parameters - query_params = {} - query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? - query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'senders'] = @api_client.build_collection_param(opts[:'senders'], :csv) if !opts[:'senders'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetTransacBlockedContacts') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_transac_blocked_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get the personalized content of a sent transactional email - # @param uuid Unique id of the transactional email that has been sent to a particular contact - # @param [Hash] opts the optional parameters - # @return [GetTransacEmailContent] - def get_transac_email_content(uuid, opts = {}) - data, _status_code, _headers = get_transac_email_content_with_http_info(uuid, opts) - data - end - - # Get the personalized content of a sent transactional email - # @param uuid Unique id of the transactional email that has been sent to a particular contact - # @param [Hash] opts the optional parameters - # @return [Array<(GetTransacEmailContent, Fixnum, Hash)>] GetTransacEmailContent data, response status code and response headers - def get_transac_email_content_with_http_info(uuid, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_transac_email_content ...' - end - # verify the required parameter 'uuid' is set - if @api_client.config.client_side_validation && uuid.nil? - fail ArgumentError, "Missing the required parameter 'uuid' when calling SMTPApi.get_transac_email_content" - end - # resource path - local_var_path = '/smtp/emails/{uuid}'.sub('{' + 'uuid' + '}', uuid.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetTransacEmailContent') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_transac_email_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Get the list of transactional emails on the basis of allowed filters - # This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - # @param [Hash] opts the optional parameters - # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. - # @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. - # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. - # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - # @return [GetTransacEmailsList] - def get_transac_emails_list(opts = {}) - data, _status_code, _headers = get_transac_emails_list_with_http_info(opts) - data - end - - # Get the list of transactional emails on the basis of allowed filters - # This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - # @param [Hash] opts the optional parameters - # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. - # @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. - # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. - # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - # @return [Array<(GetTransacEmailsList, Fixnum, Hash)>] GetTransacEmailsList data, response status code and response headers - def get_transac_emails_list_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.get_transac_emails_list ...' - end - # resource path - local_var_path = '/smtp/emails' - - # query parameters - query_params = {} - query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? - query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil? - query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil? - query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? - query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'GetTransacEmailsList') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#get_transac_emails_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Send a template - # This endpoint is deprecated. Prefer v3/smtp/email instead. - # @param template_id Id of the template - # @param send_email - # @param [Hash] opts the optional parameters - # @return [SendTemplateEmail] - def send_template(template_id, send_email, opts = {}) - data, _status_code, _headers = send_template_with_http_info(template_id, send_email, opts) - data - end - - # Send a template - # This endpoint is deprecated. Prefer v3/smtp/email instead. - # @param template_id Id of the template - # @param send_email - # @param [Hash] opts the optional parameters - # @return [Array<(SendTemplateEmail, Fixnum, Hash)>] SendTemplateEmail data, response status code and response headers - def send_template_with_http_info(template_id, send_email, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.send_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_template" - end - # verify the required parameter 'send_email' is set - if @api_client.config.client_side_validation && send_email.nil? - fail ArgumentError, "Missing the required parameter 'send_email' when calling SMTPApi.send_template" - end - # resource path - local_var_path = '/smtp/templates/{templateId}/send'.sub('{' + 'templateId' + '}', template_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(send_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'SendTemplateEmail') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#send_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Send a template to your test list - # @param template_id Id of the template - # @param send_test_email - # @param [Hash] opts the optional parameters - # @return [nil] - def send_test_template(template_id, send_test_email, opts = {}) - send_test_template_with_http_info(template_id, send_test_email, opts) - nil - end - - # Send a template to your test list - # @param template_id Id of the template - # @param send_test_email - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def send_test_template_with_http_info(template_id, send_test_email, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.send_test_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.send_test_template" - end - # verify the required parameter 'send_test_email' is set - if @api_client.config.client_side_validation && send_test_email.nil? - fail ArgumentError, "Missing the required parameter 'send_test_email' when calling SMTPApi.send_test_template" - end - # resource path - local_var_path = '/smtp/templates/{templateId}/sendTest'.sub('{' + 'templateId' + '}', template_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(send_test_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#send_test_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Send a transactional email - # @param send_smtp_email Values to send a transactional email - # @param [Hash] opts the optional parameters - # @return [CreateSmtpEmail] - def send_transac_email(send_smtp_email, opts = {}) - data, _status_code, _headers = send_transac_email_with_http_info(send_smtp_email, opts) - data - end - - # Send a transactional email - # @param send_smtp_email Values to send a transactional email - # @param [Hash] opts the optional parameters - # @return [Array<(CreateSmtpEmail, Fixnum, Hash)>] CreateSmtpEmail data, response status code and response headers - def send_transac_email_with_http_info(send_smtp_email, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.send_transac_email ...' - end - # verify the required parameter 'send_smtp_email' is set - if @api_client.config.client_side_validation && send_smtp_email.nil? - fail ArgumentError, "Missing the required parameter 'send_smtp_email' when calling SMTPApi.send_transac_email" - end - # resource path - local_var_path = '/smtp/email' - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(send_smtp_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'CreateSmtpEmail') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#send_transac_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Unblock or resubscribe a transactional contact - # @param email contact email (urlencoded) to unblock. - # @param [Hash] opts the optional parameters - # @return [nil] - def smtp_blocked_contacts_email_delete(email, opts = {}) - smtp_blocked_contacts_email_delete_with_http_info(email, opts) - nil - end - - # Unblock or resubscribe a transactional contact - # @param email contact email (urlencoded) to unblock. - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def smtp_blocked_contacts_email_delete_with_http_info(email, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.smtp_blocked_contacts_email_delete ...' - end - # verify the required parameter 'email' is set - if @api_client.config.client_side_validation && email.nil? - fail ArgumentError, "Missing the required parameter 'email' when calling SMTPApi.smtp_blocked_contacts_email_delete" - end - # resource path - local_var_path = '/smtp/blockedContacts/{email}'.sub('{' + 'email' + '}', email.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#smtp_blocked_contacts_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Delete an SMTP transactional log - # @param message_id MessageId of the transactional log to delete - # @param [Hash] opts the optional parameters - # @return [nil] - def smtp_log_message_id_delete(message_id, opts = {}) - smtp_log_message_id_delete_with_http_info(message_id, opts) - nil - end - - # Delete an SMTP transactional log - # @param message_id MessageId of the transactional log to delete - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def smtp_log_message_id_delete_with_http_info(message_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.smtp_log_message_id_delete ...' - end - # verify the required parameter 'message_id' is set - if @api_client.config.client_side_validation && message_id.nil? - fail ArgumentError, "Missing the required parameter 'message_id' when calling SMTPApi.smtp_log_message_id_delete" - end - # resource path - local_var_path = '/smtp/log/{messageId}'.sub('{' + 'messageId' + '}', message_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#smtp_log_message_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Update an email template - # @param template_id id of the template - # @param smtp_template values to update in transactional email template - # @param [Hash] opts the optional parameters - # @return [nil] - def update_smtp_template(template_id, smtp_template, opts = {}) - update_smtp_template_with_http_info(template_id, smtp_template, opts) - nil - end - - # Update an email template - # @param template_id id of the template - # @param smtp_template values to update in transactional email template - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SMTPApi.update_smtp_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.update_smtp_template" - end - # verify the required parameter 'smtp_template' is set - if @api_client.config.client_side_validation && smtp_template.nil? - fail ArgumentError, "Missing the required parameter 'smtp_template' when calling SMTPApi.update_smtp_template" - end - # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(smtp_template) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SMTPApi#update_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb index e3d4bd4..a1ff5c9 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb @@ -32,6 +32,10 @@ class AbTestCampaignResult # Open/Click rate for the winner version attr_accessor :winning_version_rate + attr_accessor :statistics + + attr_accessor :clicked_links + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -62,7 +66,9 @@ def self.attribute_map :'winning_subject_line' => :'winningSubjectLine', :'open_rate' => :'openRate', :'click_rate' => :'clickRate', - :'winning_version_rate' => :'winningVersionRate' + :'winning_version_rate' => :'winningVersionRate', + :'statistics' => :'statistics', + :'clicked_links' => :'clickedLinks' } end @@ -74,7 +80,9 @@ def self.swagger_types :'winning_subject_line' => :'String', :'open_rate' => :'String', :'click_rate' => :'String', - :'winning_version_rate' => :'String' + :'winning_version_rate' => :'String', + :'statistics' => :'AbTestCampaignResultStatistics', + :'clicked_links' => :'AbTestCampaignResultClickedLinks' } end @@ -109,6 +117,14 @@ def initialize(attributes = {}) if attributes.has_key?(:'winningVersionRate') self.winning_version_rate = attributes[:'winningVersionRate'] end + + if attributes.has_key?(:'statistics') + self.statistics = attributes[:'statistics'] + end + + if attributes.has_key?(:'clickedLinks') + self.clicked_links = attributes[:'clickedLinks'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -158,7 +174,9 @@ def ==(o) winning_subject_line == o.winning_subject_line && open_rate == o.open_rate && click_rate == o.click_rate && - winning_version_rate == o.winning_version_rate + winning_version_rate == o.winning_version_rate && + statistics == o.statistics && + clicked_links == o.clicked_links end # @see the `==` method @@ -170,7 +188,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [winning_version, winning_criteria, winning_subject_line, open_rate, click_rate, winning_version_rate].hash + [winning_version, winning_criteria, winning_subject_line, open_rate, click_rate, winning_version_rate, statistics, clicked_links].hash end # Builds the object from hash diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb new file mode 100644 index 0000000..0cfef8e --- /dev/null +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb @@ -0,0 +1,202 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'date' + +module SibApiV3Sdk + class AbTestCampaignResultClickedLinks + attr_accessor :version_a + + attr_accessor :version_b + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'version_a' => :'Version A', + :'version_b' => :'Version B' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'version_a' => :'AbTestVersionClicks', + :'version_b' => :'AbTestVersionClicks' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'Version A') + self.version_a = attributes[:'Version A'] + end + + if attributes.has_key?(:'Version B') + self.version_b = attributes[:'Version B'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @version_a.nil? + invalid_properties.push('invalid value for "version_a", version_a cannot be nil.') + end + + if @version_b.nil? + invalid_properties.push('invalid value for "version_b", version_b cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @version_a.nil? + return false if @version_b.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + version_a == o.version_a && + version_b == o.version_b + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [version_a, version_b].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SibApiV3Sdk.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb new file mode 100644 index 0000000..3c6a6a9 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb @@ -0,0 +1,258 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'date' + +module SibApiV3Sdk + class AbTestCampaignResultStatistics + attr_accessor :openers + + attr_accessor :clicks + + attr_accessor :unsubscribed + + attr_accessor :hard_bounces + + attr_accessor :soft_bounces + + attr_accessor :complaints + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'openers' => :'openers', + :'clicks' => :'clicks', + :'unsubscribed' => :'unsubscribed', + :'hard_bounces' => :'hardBounces', + :'soft_bounces' => :'softBounces', + :'complaints' => :'complaints' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'openers' => :'AbTestVersionStats', + :'clicks' => :'AbTestVersionStats', + :'unsubscribed' => :'AbTestVersionStats', + :'hard_bounces' => :'AbTestVersionStats', + :'soft_bounces' => :'AbTestVersionStats', + :'complaints' => :'AbTestVersionStats' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'openers') + self.openers = attributes[:'openers'] + end + + if attributes.has_key?(:'clicks') + self.clicks = attributes[:'clicks'] + end + + if attributes.has_key?(:'unsubscribed') + self.unsubscribed = attributes[:'unsubscribed'] + end + + if attributes.has_key?(:'hardBounces') + self.hard_bounces = attributes[:'hardBounces'] + end + + if attributes.has_key?(:'softBounces') + self.soft_bounces = attributes[:'softBounces'] + end + + if attributes.has_key?(:'complaints') + self.complaints = attributes[:'complaints'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @openers.nil? + invalid_properties.push('invalid value for "openers", openers cannot be nil.') + end + + if @clicks.nil? + invalid_properties.push('invalid value for "clicks", clicks cannot be nil.') + end + + if @unsubscribed.nil? + invalid_properties.push('invalid value for "unsubscribed", unsubscribed cannot be nil.') + end + + if @hard_bounces.nil? + invalid_properties.push('invalid value for "hard_bounces", hard_bounces cannot be nil.') + end + + if @soft_bounces.nil? + invalid_properties.push('invalid value for "soft_bounces", soft_bounces cannot be nil.') + end + + if @complaints.nil? + invalid_properties.push('invalid value for "complaints", complaints cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @openers.nil? + return false if @clicks.nil? + return false if @unsubscribed.nil? + return false if @hard_bounces.nil? + return false if @soft_bounces.nil? + return false if @complaints.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + openers == o.openers && + clicks == o.clicks && + unsubscribed == o.unsubscribed && + hard_bounces == o.hard_bounces && + soft_bounces == o.soft_bounces && + complaints == o.complaints + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [openers, clicks, unsubscribed, hard_bounces, soft_bounces, complaints].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SibApiV3Sdk.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb b/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb new file mode 100644 index 0000000..6aaffaa --- /dev/null +++ b/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb @@ -0,0 +1,175 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'date' + +module SibApiV3Sdk + # Information on clicked links for a particular version + class AbTestVersionClicks + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SibApiV3Sdk.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb b/lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb new file mode 100644 index 0000000..67ef7c3 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb @@ -0,0 +1,219 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'date' + +module SibApiV3Sdk + class AbTestVersionClicksInner + # URL of the link + attr_accessor :link + + # Number of times a link is clicked + attr_accessor :clicks_count + + # Percentage of clicks of link with respect to total clicks + attr_accessor :click_rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'link' => :'link', + :'clicks_count' => :'clicksCount', + :'click_rate' => :'clickRate' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'link' => :'String', + :'clicks_count' => :'Float', + :'click_rate' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'link') + self.link = attributes[:'link'] + end + + if attributes.has_key?(:'clicksCount') + self.clicks_count = attributes[:'clicksCount'] + end + + if attributes.has_key?(:'clickRate') + self.click_rate = attributes[:'clickRate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @link.nil? + invalid_properties.push('invalid value for "link", link cannot be nil.') + end + + if @clicks_count.nil? + invalid_properties.push('invalid value for "clicks_count", clicks_count cannot be nil.') + end + + if @click_rate.nil? + invalid_properties.push('invalid value for "click_rate", click_rate cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @link.nil? + return false if @clicks_count.nil? + return false if @click_rate.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + link == o.link && + clicks_count == o.clicks_count && + click_rate == o.click_rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [link, clicks_count, click_rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SibApiV3Sdk.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb b/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb new file mode 100644 index 0000000..1bb15e3 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb @@ -0,0 +1,205 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'date' + +module SibApiV3Sdk + # Percentage of a particular event for both versions + class AbTestVersionStats + # percentage of an event for version A + attr_accessor :version_a + + # percentage of an event for version B + attr_accessor :version_b + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'version_a' => :'Version A', + :'version_b' => :'Version B' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'version_a' => :'String', + :'version_b' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'Version A') + self.version_a = attributes[:'Version A'] + end + + if attributes.has_key?(:'Version B') + self.version_b = attributes[:'Version B'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @version_a.nil? + invalid_properties.push('invalid value for "version_a", version_a cannot be nil.') + end + + if @version_b.nil? + invalid_properties.push('invalid value for "version_b", version_b cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @version_a.nil? + return false if @version_b.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + version_a == o.version_a && + version_b == o.version_b + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [version_a, version_b].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SibApiV3Sdk.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/sib-api-v3-sdk/models/add_contact_to_list.rb b/lib/sib-api-v3-sdk/models/add_contact_to_list.rb index f4406a3..5069125 100644 --- a/lib/sib-api-v3-sdk/models/add_contact_to_list.rb +++ b/lib/sib-api-v3-sdk/models/add_contact_to_list.rb @@ -14,20 +14,25 @@ module SibApiV3Sdk class AddContactToList - # Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + # Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. attr_accessor :emails + # Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + attr_accessor :ids + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'emails' => :'emails' + :'emails' => :'emails', + :'ids' => :'ids' } end # Attribute type mapping. def self.swagger_types { - :'emails' => :'Array' + :'emails' => :'Array', + :'ids' => :'Array' } end @@ -44,6 +49,12 @@ def initialize(attributes = {}) self.emails = value end end + + if attributes.has_key?(:'ids') + if (value = attributes[:'ids']).is_a?(Array) + self.ids = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -64,7 +75,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - emails == o.emails + emails == o.emails && + ids == o.ids end # @see the `==` method @@ -76,7 +88,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [emails].hash + [emails, ids].hash end # Builds the object from hash diff --git a/lib/sib-api-v3-sdk/models/create_doi_contact.rb b/lib/sib-api-v3-sdk/models/create_doi_contact.rb index 84d440f..fe3f5e9 100644 --- a/lib/sib-api-v3-sdk/models/create_doi_contact.rb +++ b/lib/sib-api-v3-sdk/models/create_doi_contact.rb @@ -109,6 +109,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') end + if @redirection_url.nil? + invalid_properties.push('invalid value for "redirection_url", redirection_url cannot be nil.') + end + invalid_properties end @@ -118,6 +122,7 @@ def valid? return false if @email.nil? return false if @include_list_ids.nil? return false if @template_id.nil? + return false if @redirection_url.nil? true end diff --git a/lib/sib-api-v3-sdk/models/create_sms_campaign.rb b/lib/sib-api-v3-sdk/models/create_sms_campaign.rb index 19547da..2ea921a 100644 --- a/lib/sib-api-v3-sdk/models/create_sms_campaign.rb +++ b/lib/sib-api-v3-sdk/models/create_sms_campaign.rb @@ -17,7 +17,7 @@ class CreateSmsCampaign # Name of the campaign attr_accessor :name - # Name of the sender. The number of characters is limited to 11 + # Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** attr_accessor :sender # Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS @@ -91,8 +91,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "sender", sender cannot be nil.') end - if @sender.to_s.length > 11 - invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 11.') + if @sender.to_s.length > 15 + invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 15.') end if @content.nil? @@ -107,7 +107,7 @@ def list_invalid_properties def valid? return false if @name.nil? return false if @sender.nil? - return false if @sender.to_s.length > 11 + return false if @sender.to_s.length > 15 return false if @content.nil? true end @@ -119,8 +119,8 @@ def sender=(sender) fail ArgumentError, 'sender cannot be nil' end - if sender.to_s.length > 11 - fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 11.' + if sender.to_s.length > 15 + fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 15.' end @sender = sender diff --git a/lib/sib-api-v3-sdk/models/create_webhook.rb b/lib/sib-api-v3-sdk/models/create_webhook.rb index d07158d..03b580c 100644 --- a/lib/sib-api-v3-sdk/models/create_webhook.rb +++ b/lib/sib-api-v3-sdk/models/create_webhook.rb @@ -20,7 +20,7 @@ class CreateWebhook # Description of the webhook attr_accessor :description - # Events triggering the webhook. Possible values for Transactional type webhook – sent, request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition & delivered + # Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` attr_accessor :events # Type of the webhook diff --git a/lib/sib-api-v3-sdk/models/get_aggregated_report.rb b/lib/sib-api-v3-sdk/models/get_aggregated_report.rb index 5f9b9aa..b996934 100644 --- a/lib/sib-api-v3-sdk/models/get_aggregated_report.rb +++ b/lib/sib-api-v3-sdk/models/get_aggregated_report.rb @@ -156,77 +156,12 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @range.nil? - invalid_properties.push('invalid value for "range", range cannot be nil.') - end - - if @requests.nil? - invalid_properties.push('invalid value for "requests", requests cannot be nil.') - end - - if @delivered.nil? - invalid_properties.push('invalid value for "delivered", delivered cannot be nil.') - end - - if @hard_bounces.nil? - invalid_properties.push('invalid value for "hard_bounces", hard_bounces cannot be nil.') - end - - if @soft_bounces.nil? - invalid_properties.push('invalid value for "soft_bounces", soft_bounces cannot be nil.') - end - - if @clicks.nil? - invalid_properties.push('invalid value for "clicks", clicks cannot be nil.') - end - - if @unique_clicks.nil? - invalid_properties.push('invalid value for "unique_clicks", unique_clicks cannot be nil.') - end - - if @opens.nil? - invalid_properties.push('invalid value for "opens", opens cannot be nil.') - end - - if @unique_opens.nil? - invalid_properties.push('invalid value for "unique_opens", unique_opens cannot be nil.') - end - - if @spam_reports.nil? - invalid_properties.push('invalid value for "spam_reports", spam_reports cannot be nil.') - end - - if @blocked.nil? - invalid_properties.push('invalid value for "blocked", blocked cannot be nil.') - end - - if @invalid.nil? - invalid_properties.push('invalid value for "invalid", invalid cannot be nil.') - end - - if @unsubscribed.nil? - invalid_properties.push('invalid value for "unsubscribed", unsubscribed cannot be nil.') - end - invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @range.nil? - return false if @requests.nil? - return false if @delivered.nil? - return false if @hard_bounces.nil? - return false if @soft_bounces.nil? - return false if @clicks.nil? - return false if @unique_clicks.nil? - return false if @opens.nil? - return false if @unique_opens.nil? - return false if @spam_reports.nil? - return false if @blocked.nil? - return false if @invalid.nil? - return false if @unsubscribed.nil? true end diff --git a/lib/sib-api-v3-sdk/models/get_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_campaign_stats.rb index 533d5f4..4a64800 100644 --- a/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_campaign_stats.rb @@ -50,6 +50,9 @@ class GetCampaignStats # Number of deferred emails for the campaign attr_accessor :deferred + # Total number of non-delivered campaigns for a particular campaign id. + attr_accessor :return_bounce + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -64,7 +67,8 @@ def self.attribute_map :'unique_views' => :'uniqueViews', :'unsubscriptions' => :'unsubscriptions', :'viewed' => :'viewed', - :'deferred' => :'deferred' + :'deferred' => :'deferred', + :'return_bounce' => :'returnBounce' } end @@ -82,7 +86,8 @@ def self.swagger_types :'unique_views' => :'Integer', :'unsubscriptions' => :'Integer', :'viewed' => :'Integer', - :'deferred' => :'Integer' + :'deferred' => :'Integer', + :'return_bounce' => :'Integer' } end @@ -141,6 +146,10 @@ def initialize(attributes = {}) if attributes.has_key?(:'deferred') self.deferred = attributes[:'deferred'] end + + if attributes.has_key?(:'returnBounce') + self.return_bounce = attributes[:'returnBounce'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -222,7 +231,8 @@ def ==(o) unique_views == o.unique_views && unsubscriptions == o.unsubscriptions && viewed == o.viewed && - deferred == o.deferred + deferred == o.deferred && + return_bounce == o.return_bounce end # @see the `==` method @@ -234,7 +244,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [list_id, unique_clicks, clickers, complaints, delivered, sent, soft_bounces, hard_bounces, unique_views, unsubscriptions, viewed, deferred].hash + [list_id, unique_clicks, clickers, complaints, delivered, sent, soft_bounces, hard_bounces, unique_views, unsubscriptions, viewed, deferred, return_bounce].hash end # Builds the object from hash diff --git a/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb b/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb index e598b91..7c2665d 100644 --- a/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb +++ b/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb @@ -17,13 +17,17 @@ class RemoveContactFromList # Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. attr_accessor :emails - # Required if 'emails' is empty. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress + # Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + attr_accessor :ids + + # Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress attr_accessor :all # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'emails' => :'emails', + :'ids' => :'ids', :'all' => :'all' } end @@ -32,6 +36,7 @@ def self.attribute_map def self.swagger_types { :'emails' => :'Array', + :'ids' => :'Array', :'all' => :'BOOLEAN' } end @@ -50,6 +55,12 @@ def initialize(attributes = {}) end end + if attributes.has_key?(:'ids') + if (value = attributes[:'ids']).is_a?(Array) + self.ids = value + end + end + if attributes.has_key?(:'all') self.all = attributes[:'all'] end @@ -74,6 +85,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && emails == o.emails && + ids == o.ids && all == o.all end @@ -86,7 +98,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [emails, all].hash + [emails, ids, all].hash end # Builds the object from hash diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb index e654251..9e808eb 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb @@ -13,7 +13,7 @@ require 'date' module SibApiV3Sdk - # Mandatory if 'templateId' is not passed. Pass name (optional) and email of sender from which emails will be sent. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} + # Mandatory if `templateId` is not passed. Pass name (optional) and email or id of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} or {\"id\":2} class SendSmtpEmailSender # Name of the sender from which the emails will be sent. Maximum allowed characters are 70. attr_accessor :name @@ -21,11 +21,15 @@ class SendSmtpEmailSender # Email of the sender from which the emails will be sent attr_accessor :email + # Id of the sender from which the emails will be sent + attr_accessor :id + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'name' => :'name', - :'email' => :'email' + :'email' => :'email', + :'id' => :'id' } end @@ -33,7 +37,8 @@ def self.attribute_map def self.swagger_types { :'name' => :'String', - :'email' => :'String' + :'email' => :'String', + :'id' => :'Integer' } end @@ -52,6 +57,10 @@ def initialize(attributes = {}) if attributes.has_key?(:'email') self.email = attributes[:'email'] end + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -78,7 +87,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && - email == o.email + email == o.email && + id == o.id end # @see the `==` method @@ -90,7 +100,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [name, email].hash + [name, email, id].hash end # Builds the object from hash diff --git a/lib/sib-api-v3-sdk/models/send_transac_sms.rb b/lib/sib-api-v3-sdk/models/send_transac_sms.rb index 77ac7f9..60e7af5 100644 --- a/lib/sib-api-v3-sdk/models/send_transac_sms.rb +++ b/lib/sib-api-v3-sdk/models/send_transac_sms.rb @@ -14,7 +14,7 @@ module SibApiV3Sdk class SendTransacSms - # Name of the sender. Only alphanumeric characters. No more than 11 characters + # Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** attr_accessor :sender # Mobile number to send SMS with the country code @@ -121,8 +121,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "sender", sender cannot be nil.') end - if @sender.to_s.length > 11 - invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 11.') + if @sender.to_s.length > 15 + invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 15.') end if @recipient.nil? @@ -140,7 +140,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @sender.nil? - return false if @sender.to_s.length > 11 + return false if @sender.to_s.length > 15 return false if @recipient.nil? return false if @content.nil? type_validator = EnumAttributeValidator.new('String', ['transactional', 'marketing']) @@ -155,8 +155,8 @@ def sender=(sender) fail ArgumentError, 'sender cannot be nil' end - if sender.to_s.length > 11 - fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 11.' + if sender.to_s.length > 15 + fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 15.' end @sender = sender diff --git a/lib/sib-api-v3-sdk/models/update_sms_campaign.rb b/lib/sib-api-v3-sdk/models/update_sms_campaign.rb index 1f6f869..fbb80c3 100644 --- a/lib/sib-api-v3-sdk/models/update_sms_campaign.rb +++ b/lib/sib-api-v3-sdk/models/update_sms_campaign.rb @@ -17,7 +17,7 @@ class UpdateSmsCampaign # Name of the campaign attr_accessor :name - # Name of the sender. The number of characters is limited to 11 + # Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** attr_accessor :sender # Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS @@ -83,8 +83,8 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if !@sender.nil? && @sender.to_s.length > 11 - invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 11.') + if !@sender.nil? && @sender.to_s.length > 15 + invalid_properties.push('invalid value for "sender", the character length must be smaller than or equal to 15.') end invalid_properties @@ -93,15 +93,15 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if !@sender.nil? && @sender.to_s.length > 11 + return false if !@sender.nil? && @sender.to_s.length > 15 true end # Custom attribute writer method with validation # @param [Object] sender Value to be assigned def sender=(sender) - if !sender.nil? && sender.to_s.length > 11 - fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 11.' + if !sender.nil? && sender.to_s.length > 15 + fail ArgumentError, 'invalid value for "sender", the character length must be smaller than or equal to 15.' end @sender = sender diff --git a/lib/sib-api-v3-sdk/models/update_webhook.rb b/lib/sib-api-v3-sdk/models/update_webhook.rb index c9b5d14..73628ac 100644 --- a/lib/sib-api-v3-sdk/models/update_webhook.rb +++ b/lib/sib-api-v3-sdk/models/update_webhook.rb @@ -20,7 +20,7 @@ class UpdateWebhook # Description of the webhook attr_accessor :description - # Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition and delivered + # Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered` attr_accessor :events class EnumAttributeValidator diff --git a/lib/sib-api-v3-sdk/version.rb b/lib/sib-api-v3-sdk/version.rb index 7c7524a..01c949a 100644 --- a/lib/sib-api-v3-sdk/version.rb +++ b/lib/sib-api-v3-sdk/version.rb @@ -11,5 +11,5 @@ =end module SibApiV3Sdk - VERSION = "5.5.0" + VERSION = "6.0.0" end diff --git a/spec/api/contacts_api_spec.rb b/spec/api/contacts_api_spec.rb index 7c537cb..a276f80 100644 --- a/spec/api/contacts_api_spec.rb +++ b/spec/api/contacts_api_spec.rb @@ -35,7 +35,7 @@ # unit tests for add_contact_to_list # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] describe 'add_contact_to_list test' do @@ -115,7 +115,7 @@ # unit tests for delete_contact # Delete a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_contact test' do @@ -158,7 +158,7 @@ # unit tests for get_contact_info # Get a contact's details - # @param email Email (urlencoded) of the contact OR its SMS attribute value + # @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value # @param [Hash] opts the optional parameters # @return [GetExtendedContactDetails] describe 'get_contact_info test' do @@ -169,7 +169,7 @@ # unit tests for get_contact_stats # Get email campaigns' statistics for a contact - # @param email Email address (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate @@ -281,7 +281,7 @@ # unit tests for remove_contact_from_list # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] describe 'remove_contact_from_list test' do @@ -317,7 +317,7 @@ # unit tests for update_contact # Update a contact - # @param email Email (urlencoded) of the contact + # @param identifier Email (urlencoded) OR ID of the contact # @param update_contact Values to update a contact # @param [Hash] opts the optional parameters # @return [nil] diff --git a/spec/api/lists_api_spec.rb b/spec/api/lists_api_spec.rb index b635ab3..c6f8cda 100644 --- a/spec/api/lists_api_spec.rb +++ b/spec/api/lists_api_spec.rb @@ -35,7 +35,7 @@ # unit tests for add_contact_to_list # Add existing contacts to a list # @param list_id Id of the list - # @param contact_emails Emails addresses of the contacts + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] describe 'add_contact_to_list test' do @@ -119,7 +119,7 @@ # unit tests for remove_contact_from_list # Delete a contact from a list # @param list_id Id of the list - # @param contact_emails Emails adresses of the contact + # @param contact_emails Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] describe 'remove_contact_from_list test' do diff --git a/spec/api/smtp_api_spec.rb b/spec/api/transactional_emails_api_spec.rb similarity index 97% rename from spec/api/smtp_api_spec.rb rename to spec/api/transactional_emails_api_spec.rb index 7cf6a22..c5f5928 100644 --- a/spec/api/smtp_api_spec.rb +++ b/spec/api/transactional_emails_api_spec.rb @@ -13,22 +13,22 @@ require 'spec_helper' require 'json' -# Unit tests for SibApiV3Sdk::SMTPApi +# Unit tests for SibApiV3Sdk::TransactionalEmailsApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate -describe 'SMTPApi' do +describe 'TransactionalEmailsApi' do before do # run before each test - @instance = SibApiV3Sdk::SMTPApi.new + @instance = SibApiV3Sdk::TransactionalEmailsApi.new end after do # run after each test end - describe 'test an instance of SMTPApi' do - it 'should create an instance of SMTPApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SMTPApi) + describe 'test an instance of TransactionalEmailsApi' do + it 'should create an instance of TransactionalEmailsApi' do + expect(@instance).to be_instance_of(SibApiV3Sdk::TransactionalEmailsApi) end end diff --git a/spec/models/ab_test_campaign_result_clicked_links_spec.rb b/spec/models/ab_test_campaign_result_clicked_links_spec.rb new file mode 100644 index 0000000..8c1ed7f --- /dev/null +++ b/spec/models/ab_test_campaign_result_clicked_links_spec.rb @@ -0,0 +1,47 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::AbTestCampaignResultClickedLinks +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AbTestCampaignResultClickedLinks' do + before do + # run before each test + @instance = SibApiV3Sdk::AbTestCampaignResultClickedLinks.new + end + + after do + # run after each test + end + + describe 'test an instance of AbTestCampaignResultClickedLinks' do + it 'should create an instance of AbTestCampaignResultClickedLinks' do + expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultClickedLinks) + end + end + describe 'test attribute "version_a"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "version_b"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/ab_test_campaign_result_spec.rb b/spec/models/ab_test_campaign_result_spec.rb index 965de45..d992ed2 100644 --- a/spec/models/ab_test_campaign_result_spec.rb +++ b/spec/models/ab_test_campaign_result_spec.rb @@ -76,4 +76,16 @@ end end + describe 'test attribute "statistics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "clicked_links"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/ab_test_campaign_result_statistics_spec.rb b/spec/models/ab_test_campaign_result_statistics_spec.rb new file mode 100644 index 0000000..fe3cbeb --- /dev/null +++ b/spec/models/ab_test_campaign_result_statistics_spec.rb @@ -0,0 +1,71 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::AbTestCampaignResultStatistics +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AbTestCampaignResultStatistics' do + before do + # run before each test + @instance = SibApiV3Sdk::AbTestCampaignResultStatistics.new + end + + after do + # run after each test + end + + describe 'test an instance of AbTestCampaignResultStatistics' do + it 'should create an instance of AbTestCampaignResultStatistics' do + expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultStatistics) + end + end + describe 'test attribute "openers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "clicks"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unsubscribed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "hard_bounces"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "soft_bounces"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "complaints"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/ab_test_version_clicks_inner_spec.rb b/spec/models/ab_test_version_clicks_inner_spec.rb new file mode 100644 index 0000000..8af7aba --- /dev/null +++ b/spec/models/ab_test_version_clicks_inner_spec.rb @@ -0,0 +1,53 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::AbTestVersionClicksInner +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AbTestVersionClicksInner' do + before do + # run before each test + @instance = SibApiV3Sdk::AbTestVersionClicksInner.new + end + + after do + # run after each test + end + + describe 'test an instance of AbTestVersionClicksInner' do + it 'should create an instance of AbTestVersionClicksInner' do + expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionClicksInner) + end + end + describe 'test attribute "link"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "clicks_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "click_rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/ab_test_version_clicks_spec.rb b/spec/models/ab_test_version_clicks_spec.rb new file mode 100644 index 0000000..23ccdee --- /dev/null +++ b/spec/models/ab_test_version_clicks_spec.rb @@ -0,0 +1,35 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::AbTestVersionClicks +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AbTestVersionClicks' do + before do + # run before each test + @instance = SibApiV3Sdk::AbTestVersionClicks.new + end + + after do + # run after each test + end + + describe 'test an instance of AbTestVersionClicks' do + it 'should create an instance of AbTestVersionClicks' do + expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionClicks) + end + end +end diff --git a/spec/models/ab_test_version_stats_spec.rb b/spec/models/ab_test_version_stats_spec.rb new file mode 100644 index 0000000..6ab7ef5 --- /dev/null +++ b/spec/models/ab_test_version_stats_spec.rb @@ -0,0 +1,47 @@ +=begin +#SendinBlue API + +#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | + +OpenAPI spec version: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.12 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::AbTestVersionStats +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AbTestVersionStats' do + before do + # run before each test + @instance = SibApiV3Sdk::AbTestVersionStats.new + end + + after do + # run after each test + end + + describe 'test an instance of AbTestVersionStats' do + it 'should create an instance of AbTestVersionStats' do + expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionStats) + end + end + describe 'test attribute "version_a"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "version_b"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/add_contact_to_list_spec.rb b/spec/models/add_contact_to_list_spec.rb index 482df66..3636710 100644 --- a/spec/models/add_contact_to_list_spec.rb +++ b/spec/models/add_contact_to_list_spec.rb @@ -38,4 +38,10 @@ end end + describe 'test attribute "ids"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/get_campaign_stats_spec.rb b/spec/models/get_campaign_stats_spec.rb index 323da69..332999f 100644 --- a/spec/models/get_campaign_stats_spec.rb +++ b/spec/models/get_campaign_stats_spec.rb @@ -104,4 +104,10 @@ end end + describe 'test attribute "return_bounce"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/remove_contact_from_list_spec.rb b/spec/models/remove_contact_from_list_spec.rb index a644d51..a826b4d 100644 --- a/spec/models/remove_contact_from_list_spec.rb +++ b/spec/models/remove_contact_from_list_spec.rb @@ -38,6 +38,12 @@ end end + describe 'test attribute "ids"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "all"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/send_smtp_email_sender_spec.rb b/spec/models/send_smtp_email_sender_spec.rb index 5b7d051..34e02e2 100644 --- a/spec/models/send_smtp_email_sender_spec.rb +++ b/spec/models/send_smtp_email_sender_spec.rb @@ -44,4 +44,10 @@ end end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end