From d87448f5c4e575fbe4dc72e39840e02aa9f366dd Mon Sep 17 00:00:00 2001 From: Aakanksha Sharma Date: Wed, 8 Nov 2017 15:58:21 +0530 Subject: [PATCH] swagger sync: delete route added for templates --- README.md | 7 +- docs/ContactsApi.md | 6 +- docs/CreateContact.md | 1 + docs/GetEmailEventReportEvents.md | 5 +- docs/SMSCampaignsApi.md | 18 +-- docs/SMTPApi.md | 51 +++++++++ setup.py | 2 +- sib_api_v3_sdk/apis/contacts_api.py | 6 +- sib_api_v3_sdk/apis/sms_campaigns_api.py | 12 +- sib_api_v3_sdk/apis/smtp_api.py | 104 ++++++++++++++++++ sib_api_v3_sdk/models/create_contact.py | 34 +++++- .../models/get_email_event_report_events.py | 46 ++++++-- test/test_sms_campaigns_api.py | 6 +- test/test_smtp_api.py | 8 ++ 14 files changed, 267 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index f4e34d2..f16700d 100644 --- a/README.md +++ b/README.md @@ -143,18 +143,19 @@ Class | Method | HTTP request | Description *ResellerApi* | [**get_reseller_childs**](docs/ResellerApi.md#get_reseller_childs) | **GET** /reseller/children | Gets the list of all reseller's children accounts *ResellerApi* | [**remove_credits**](docs/ResellerApi.md#remove_credits) | **POST** /reseller/children/{childId}/credits/remove | Remove Email and/or SMS credits from a specific child account *ResellerApi* | [**update_reseller_child**](docs/ResellerApi.md#update_reseller_child) | **PUT** /reseller/children/{childId} | Updates infos of reseller's child based on the childId supplied -*SMSCampaignsApi* | [**create_sms_campaign**](docs/SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates a SMS campaign +*SMSCampaignsApi* | [**create_sms_campaign**](docs/SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign *SMSCampaignsApi* | [**delete_sms_campaigns**](docs/SMSCampaignsApi.md#delete_sms_campaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign -*SMSCampaignsApi* | [**get_sms_campaign**](docs/SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign +*SMSCampaignsApi* | [**get_sms_campaign**](docs/SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign *SMSCampaignsApi* | [**get_sms_campaigns**](docs/SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns *SMSCampaignsApi* | [**request_sms_recipient_export**](docs/SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign. *SMSCampaignsApi* | [**send_sms_campaign_now**](docs/SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately *SMSCampaignsApi* | [**send_sms_report**](docs/SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns *SMSCampaignsApi* | [**send_test_sms**](docs/SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS -*SMSCampaignsApi* | [**update_sms_campaign**](docs/SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign +*SMSCampaignsApi* | [**update_sms_campaign**](docs/SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign *SMSCampaignsApi* | [**update_sms_campaign_status**](docs/SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status *SMTPApi* | [**create_smtp_template**](docs/SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an smtp template *SMTPApi* | [**delete_hardbounces**](docs/SMTPApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces +*SMTPApi* | [**delete_smtp_template**](docs/SMTPApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template *SMTPApi* | [**get_aggregated_smtp_report**](docs/SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time *SMTPApi* | [**get_email_event_report**](docs/SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events) *SMTPApi* | [**get_smtp_report**](docs/SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md index 4dc161e..e77a0c2 100644 --- a/docs/ContactsApi.md +++ b/docs/ContactsApi.md @@ -587,7 +587,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_contacts** -> GetContacts get_contacts(limit=limit, offset=offset) +> GetContacts get_contacts(limit=limit, offset=offset, modified_since=modified_since) Get all the contacts @@ -608,10 +608,11 @@ sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY' api_instance = sib_api_v3_sdk.ContactsApi() limit = 50 # int | Number of documents per page (optional) (default to 50) offset = 0 # int | Index of the first document of the page (optional) (default to 0) +modified_since = '2013-10-20T19:20:30+01:00' # datetime | Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) (optional) try: # Get all the contacts - api_response = api_instance.get_contacts(limit=limit, offset=offset) + api_response = api_instance.get_contacts(limit=limit, offset=offset, modified_since=modified_since) pprint(api_response) except ApiException as e: print("Exception when calling ContactsApi->get_contacts: %s\n" % e) @@ -623,6 +624,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int**| Number of documents per page | [optional] [default to 50] **offset** | **int**| Index of the first document of the page | [optional] [default to 0] + **modified_since** | **datetime**| Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] ### Return type diff --git a/docs/CreateContact.md b/docs/CreateContact.md index bcae2bb..6ea49f8 100644 --- a/docs/CreateContact.md +++ b/docs/CreateContact.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **email_blacklisted** | **bool** | Blacklist the contact for emails (emailBlacklisted = true) | [optional] **sms_blacklisted** | **bool** | Blacklist the contact for SMS (smsBlacklisted = true) | [optional] **list_ids** | **list[int]** | Ids of the lists to add the contact to | [optional] +**update_enabled** | **bool** | Facilitate to update existing contact in same request (updateEnabled = true) | [optional] [default to False] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GetEmailEventReportEvents.md b/docs/GetEmailEventReportEvents.md index 5449daa..7fab074 100644 --- a/docs/GetEmailEventReportEvents.md +++ b/docs/GetEmailEventReportEvents.md @@ -4,14 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | Email address which generates the event | -**date** | **date** | Date on which the event has been generated | +**date** | **datetime** | Date on which the event has been generated | **subject** | **str** | Subject of the event | [optional] **message_id** | **str** | Message ID which generated the event | **event** | **str** | Event which occurred | -**reason** | **str** | Reason of bounce (only available if the event is hardbounce or softbounce) | +**reason** | **str** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional] **tag** | **str** | Tag of the email which generated the event | **ip** | **str** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional] **link** | **str** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional] +**_from** | **str** | Sender email from which the emails are sent | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SMSCampaignsApi.md b/docs/SMSCampaignsApi.md index c829c6e..65e8006 100644 --- a/docs/SMSCampaignsApi.md +++ b/docs/SMSCampaignsApi.md @@ -4,22 +4,22 @@ All URIs are relative to *https://api.sendinblue.com/v3* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates a SMS campaign +[**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign [**delete_sms_campaigns**](SMSCampaignsApi.md#delete_sms_campaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign -[**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign +[**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign [**get_sms_campaigns**](SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns [**request_sms_recipient_export**](SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign. [**send_sms_campaign_now**](SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately [**send_sms_report**](SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns [**send_test_sms**](SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS -[**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign +[**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign [**update_sms_campaign_status**](SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status # **create_sms_campaign** > CreateModel create_sms_campaign(create_sms_campaign) -Creates a SMS campaign +Creates an SMS campaign ### Example ```python @@ -39,7 +39,7 @@ api_instance = sib_api_v3_sdk.SMSCampaignsApi() create_sms_campaign = sib_api_v3_sdk.CreateSmsCampaign() # CreateSmsCampaign | Values to create an SMS Campaign try: - # Creates a SMS campaign + # Creates an SMS campaign api_response = api_instance.create_sms_campaign(create_sms_campaign) pprint(api_response) except ApiException as e: @@ -120,7 +120,7 @@ void (empty response body) # **get_sms_campaign** > GetSmsCampaign get_sms_campaign(campaign_id, get_sms_campaign) -Get a SMS campaign +Get an SMS campaign ### Example ```python @@ -141,7 +141,7 @@ campaign_id = 789 # int | id of the SMS campaign get_sms_campaign = sib_api_v3_sdk.GetSmsCampaign() # GetSmsCampaign | Values to update an SMS Campaign try: - # Get a SMS campaign + # Get an SMS campaign api_response = api_instance.get_sms_campaign(campaign_id, get_sms_campaign) pprint(api_response) except ApiException as e: @@ -439,7 +439,7 @@ void (empty response body) # **update_sms_campaign** > update_sms_campaign(campaign_id, update_sms_campaign) -Updates a SMS campaign +Updates an SMS campaign ### Example ```python @@ -460,7 +460,7 @@ campaign_id = 789 # int | id of the SMS campaign update_sms_campaign = sib_api_v3_sdk.UpdateSmsCampaign() # UpdateSmsCampaign | Values to update an SMS Campaign try: - # Updates a SMS campaign + # Updates an SMS campaign api_instance.update_sms_campaign(campaign_id, update_sms_campaign) except ApiException as e: print("Exception when calling SMSCampaignsApi->update_sms_campaign: %s\n" % e) diff --git a/docs/SMTPApi.md b/docs/SMTPApi.md index 45033fa..39d45e1 100644 --- a/docs/SMTPApi.md +++ b/docs/SMTPApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_smtp_template**](SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an smtp 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 smtp template [**get_aggregated_smtp_report**](SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time [**get_email_event_report**](SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events) [**get_smtp_report**](SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day @@ -120,6 +121,56 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_smtp_template** +> delete_smtp_template(template_id) + +Delete an inactive smtp template + +### Example +```python +from __future__ import print_function +import time +import sib_api_v3_sdk +from sib_api_v3_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api-key +sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# sib_api_v3_sdk.configuration.api_key_prefix['api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = sib_api_v3_sdk.SMTPApi() +template_id = 789 # int | id of the template + +try: + # Delete an inactive smtp template + api_instance.delete_smtp_template(template_id) +except ApiException as e: + print("Exception when calling SMTPApi->delete_smtp_template: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **int**| id of the template | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_aggregated_smtp_report** > GetAggregatedReport get_aggregated_smtp_report(start_date=start_date, end_date=end_date, days=days, tag=tag) diff --git a/setup.py b/setup.py index 4ca81f4..7f48d72 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ from setuptools import setup, find_packages NAME = "sib-api-v3-sdk" -VERSION = "1.1.1" +VERSION = "1.1.2" # To install the library, run the following # # python setup.py install diff --git a/sib_api_v3_sdk/apis/contacts_api.py b/sib_api_v3_sdk/apis/contacts_api.py index 863e150..000c9cf 100644 --- a/sib_api_v3_sdk/apis/contacts_api.py +++ b/sib_api_v3_sdk/apis/contacts_api.py @@ -1198,6 +1198,7 @@ def get_contacts(self, **kwargs): for asynchronous request. (optional) :param int limit: Number of documents per page :param int offset: Index of the first document of the page + :param datetime modified_since: Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) :return: GetContacts If the method is called asynchronously, returns the request thread. @@ -1224,12 +1225,13 @@ def get_contacts_with_http_info(self, **kwargs): for asynchronous request. (optional) :param int limit: Number of documents per page :param int offset: Index of the first document of the page + :param datetime modified_since: Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) :return: GetContacts If the method is called asynchronously, returns the request thread. """ - all_params = ['limit', 'offset'] + all_params = ['limit', 'offset', 'modified_since'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1257,6 +1259,8 @@ def get_contacts_with_http_info(self, **kwargs): query_params.append(('limit', params['limit'])) if 'offset' in params: query_params.append(('offset', params['offset'])) + if 'modified_since' in params: + query_params.append(('modifiedSince', params['modified_since'])) header_params = {} diff --git a/sib_api_v3_sdk/apis/sms_campaigns_api.py b/sib_api_v3_sdk/apis/sms_campaigns_api.py index d6d94f0..5ce3c2c 100644 --- a/sib_api_v3_sdk/apis/sms_campaigns_api.py +++ b/sib_api_v3_sdk/apis/sms_campaigns_api.py @@ -42,7 +42,7 @@ def __init__(self, api_client=None): def create_sms_campaign(self, create_sms_campaign, **kwargs): """ - Creates a SMS campaign + Creates an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -67,7 +67,7 @@ def create_sms_campaign(self, create_sms_campaign, **kwargs): def create_sms_campaign_with_http_info(self, create_sms_campaign, **kwargs): """ - Creates a SMS campaign + Creates an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -250,7 +250,7 @@ def delete_sms_campaigns_with_http_info(self, campaign_id, **kwargs): def get_sms_campaign(self, campaign_id, get_sms_campaign, **kwargs): """ - Get a SMS campaign + Get an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -276,7 +276,7 @@ def get_sms_campaign(self, campaign_id, get_sms_campaign, **kwargs): def get_sms_campaign_with_http_info(self, campaign_id, get_sms_campaign, **kwargs): """ - Get a SMS campaign + Get an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -910,7 +910,7 @@ def send_test_sms_with_http_info(self, campaign_id, send_test_sms, **kwargs): def update_sms_campaign(self, campaign_id, update_sms_campaign, **kwargs): """ - Updates a SMS campaign + Updates an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -936,7 +936,7 @@ def update_sms_campaign(self, campaign_id, update_sms_campaign, **kwargs): def update_sms_campaign_with_http_info(self, campaign_id, update_sms_campaign, **kwargs): """ - Updates a SMS campaign + Updates an SMS campaign This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. diff --git a/sib_api_v3_sdk/apis/smtp_api.py b/sib_api_v3_sdk/apis/smtp_api.py index f160f43..5213808 100644 --- a/sib_api_v3_sdk/apis/smtp_api.py +++ b/sib_api_v3_sdk/apis/smtp_api.py @@ -247,6 +247,110 @@ def delete_hardbounces_with_http_info(self, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def delete_smtp_template(self, template_id, **kwargs): + """ + Delete an inactive smtp template + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_smtp_template(template_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int template_id: id of the template (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.delete_smtp_template_with_http_info(template_id, **kwargs) + else: + (data) = self.delete_smtp_template_with_http_info(template_id, **kwargs) + return data + + def delete_smtp_template_with_http_info(self, template_id, **kwargs): + """ + Delete an inactive smtp template + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_smtp_template_with_http_info(template_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int template_id: id of the template (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['template_id'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_smtp_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'template_id' is set + if ('template_id' not in params) or (params['template_id'] is None): + raise ValueError("Missing the required parameter `template_id` when calling `delete_smtp_template`") + + + collection_formats = {} + + path_params = {} + if 'template_id' in params: + path_params['templateId'] = params['template_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['api-key'] + + return self.api_client.call_api('/smtp/templates/{templateId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def get_aggregated_smtp_report(self, **kwargs): """ Get your SMTP activity aggregated over a period of time diff --git a/sib_api_v3_sdk/models/create_contact.py b/sib_api_v3_sdk/models/create_contact.py index 48d531a..1fa1577 100644 --- a/sib_api_v3_sdk/models/create_contact.py +++ b/sib_api_v3_sdk/models/create_contact.py @@ -35,7 +35,8 @@ class CreateContact(object): 'attributes': 'object', 'email_blacklisted': 'bool', 'sms_blacklisted': 'bool', - 'list_ids': 'list[int]' + 'list_ids': 'list[int]', + 'update_enabled': 'bool' } attribute_map = { @@ -43,10 +44,11 @@ class CreateContact(object): 'attributes': 'attributes', 'email_blacklisted': 'emailBlacklisted', 'sms_blacklisted': 'smsBlacklisted', - 'list_ids': 'listIds' + 'list_ids': 'listIds', + 'update_enabled': 'updateEnabled' } - def __init__(self, email=None, attributes=None, email_blacklisted=None, sms_blacklisted=None, list_ids=None): + def __init__(self, email=None, attributes=None, email_blacklisted=None, sms_blacklisted=None, list_ids=None, update_enabled=False): """ CreateContact - a model defined in Swagger """ @@ -56,6 +58,7 @@ def __init__(self, email=None, attributes=None, email_blacklisted=None, sms_blac self._email_blacklisted = None self._sms_blacklisted = None self._list_ids = None + self._update_enabled = None if email is not None: self.email = email @@ -67,6 +70,8 @@ def __init__(self, email=None, attributes=None, email_blacklisted=None, sms_blac self.sms_blacklisted = sms_blacklisted if list_ids is not None: self.list_ids = list_ids + if update_enabled is not None: + self.update_enabled = update_enabled @property def email(self): @@ -183,6 +188,29 @@ def list_ids(self, list_ids): self._list_ids = list_ids + @property + def update_enabled(self): + """ + Gets the update_enabled of this CreateContact. + Facilitate to update existing contact in same request (updateEnabled = true) + + :return: The update_enabled of this CreateContact. + :rtype: bool + """ + return self._update_enabled + + @update_enabled.setter + def update_enabled(self, update_enabled): + """ + Sets the update_enabled of this CreateContact. + Facilitate to update existing contact in same request (updateEnabled = true) + + :param update_enabled: The update_enabled of this CreateContact. + :type: bool + """ + + self._update_enabled = update_enabled + def to_dict(self): """ Returns the model properties as a dict diff --git a/sib_api_v3_sdk/models/get_email_event_report_events.py b/sib_api_v3_sdk/models/get_email_event_report_events.py index b212d6f..fcb6b2f 100644 --- a/sib_api_v3_sdk/models/get_email_event_report_events.py +++ b/sib_api_v3_sdk/models/get_email_event_report_events.py @@ -32,14 +32,15 @@ class GetEmailEventReportEvents(object): """ swagger_types = { 'email': 'str', - 'date': 'date', + 'date': 'datetime', 'subject': 'str', 'message_id': 'str', 'event': 'str', 'reason': 'str', 'tag': 'str', 'ip': 'str', - 'link': 'str' + 'link': 'str', + '_from': 'str' } attribute_map = { @@ -51,10 +52,11 @@ class GetEmailEventReportEvents(object): 'reason': 'reason', 'tag': 'tag', 'ip': 'ip', - 'link': 'link' + 'link': 'link', + '_from': 'from' } - def __init__(self, email=None, date=None, subject=None, message_id=None, event=None, reason=None, tag=None, ip=None, link=None): + def __init__(self, email=None, date=None, subject=None, message_id=None, event=None, reason=None, tag=None, ip=None, link=None, _from=None): """ GetEmailEventReportEvents - a model defined in Swagger """ @@ -68,6 +70,7 @@ def __init__(self, email=None, date=None, subject=None, message_id=None, event=N self._tag = None self._ip = None self._link = None + self.__from = None self.email = email self.date = date @@ -75,12 +78,14 @@ def __init__(self, email=None, date=None, subject=None, message_id=None, event=N self.subject = subject self.message_id = message_id self.event = event - self.reason = reason + if reason is not None: + self.reason = reason self.tag = tag if ip is not None: self.ip = ip if link is not None: self.link = link + self._from = _from @property def email(self): @@ -114,7 +119,7 @@ def date(self): Date on which the event has been generated :return: The date of this GetEmailEventReportEvents. - :rtype: date + :rtype: datetime """ return self._date @@ -125,7 +130,7 @@ def date(self, date): Date on which the event has been generated :param date: The date of this GetEmailEventReportEvents. - :type: date + :type: datetime """ if date is None: raise ValueError("Invalid value for `date`, must not be `None`") @@ -231,8 +236,6 @@ def reason(self, reason): :param reason: The reason of this GetEmailEventReportEvents. :type: str """ - if reason is None: - raise ValueError("Invalid value for `reason`, must not be `None`") self._reason = reason @@ -307,6 +310,31 @@ def link(self, link): self._link = link + @property + def _from(self): + """ + Gets the _from of this GetEmailEventReportEvents. + Sender email from which the emails are sent + + :return: The _from of this GetEmailEventReportEvents. + :rtype: str + """ + return self.__from + + @_from.setter + def _from(self, _from): + """ + Sets the _from of this GetEmailEventReportEvents. + Sender email from which the emails are sent + + :param _from: The _from of this GetEmailEventReportEvents. + :type: str + """ + if _from is None: + raise ValueError("Invalid value for `_from`, must not be `None`") + + self.__from = _from + def to_dict(self): """ Returns the model properties as a dict diff --git a/test/test_sms_campaigns_api.py b/test/test_sms_campaigns_api.py index def182b..943f6f2 100644 --- a/test/test_sms_campaigns_api.py +++ b/test/test_sms_campaigns_api.py @@ -35,7 +35,7 @@ def test_create_sms_campaign(self): """ Test case for create_sms_campaign - Creates a SMS campaign + Creates an SMS campaign """ pass @@ -51,7 +51,7 @@ def test_get_sms_campaign(self): """ Test case for get_sms_campaign - Get a SMS campaign + Get an SMS campaign """ pass @@ -99,7 +99,7 @@ def test_update_sms_campaign(self): """ Test case for update_sms_campaign - Updates a SMS campaign + Updates an SMS campaign """ pass diff --git a/test/test_smtp_api.py b/test/test_smtp_api.py index d97086a..a5f7792 100644 --- a/test/test_smtp_api.py +++ b/test/test_smtp_api.py @@ -47,6 +47,14 @@ def test_delete_hardbounces(self): """ pass + def test_delete_smtp_template(self): + """ + Test case for delete_smtp_template + + Delete an inactive smtp template + """ + pass + def test_get_aggregated_smtp_report(self): """ Test case for get_aggregated_smtp_report