Skip to content

Commit 1927281

Browse files
Merge pull request #26 from sendinblue/feature_updated_swagger_sync
Swagger updates for sms api
2 parents 6c6d625 + a9eb002 commit 1927281

24 files changed

+199
-77
lines changed

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 SendinBlue
3+
Copyright (c) 2019 SendinBlue
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
21+
THE SOFTWARE.

docs/CreateWebhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**url** | **str** | URL of the webhook |
77
**description** | **str** | Description of the webhook | [optional]
8-
**events** | **list[str]** | 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 & delivered | [optional]
8+
**events** | **list[str]** | 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 & delivered |
99
**type** | **str** | Type of the webhook | [optional] [default to 'transactional']
1010

1111
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/GetSmsEventReportEvents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**phone_number** | **str** | Phone number which has generated the event |
7-
**date** | **date** | Date on which the event has been generated |
7+
**date** | **datetime** | UTC date-time on which the event has been generated |
88
**message_id** | **str** | Message ID which generated the event |
99
**event** | **str** | Event which occurred |
1010
**reason** | **str** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]

docs/RequestContactImport.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**email_blacklist** | **bool** | To blacklist all the contacts for email | [optional] [default to False]
1212
**sms_blacklist** | **bool** | To blacklist all the contacts for sms | [optional] [default to False]
1313
**update_existing_contacts** | **bool** | To facilitate the choice to update the existing contacts | [optional] [default to True]
14+
**empty_contacts_attributes** | **bool** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) | [optional] [default to False]
1415

1516
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1617

docs/RequestSMSRecipientExport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**notify_url** | **str** | URL that will be called once the export process is finished | [optional]
7-
**recipients_type** | **str** | Filter the recipients based on how they interacted with the campaign | [default to 'all']
7+
**recipients_type** | **str** | Filter the recipients based on how they interacted with the campaign |
88

99
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1010

docs/SMSCampaignsApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void (empty response body)
396396
[[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)
397397

398398
# **send_test_sms**
399-
> send_test_sms(campaign_id, send_test_sms)
399+
> send_test_sms(campaign_id, phone_number)
400400
401401
Send an SMS
402402

@@ -417,11 +417,11 @@ configuration.api_key['api-key'] = 'YOUR_API_KEY'
417417
# create an instance of the API class
418418
api_instance = sib_api_v3_sdk.SMSCampaignsApi(sib_api_v3_sdk.ApiClient(configuration))
419419
campaign_id = 789 # int | Id of the SMS campaign
420-
send_test_sms = sib_api_v3_sdk.SendTestSms() # SendTestSms | Mobile number to which send the test
420+
phone_number = sib_api_v3_sdk.SendTestSms() # SendTestSms | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
421421

422422
try:
423423
# Send an SMS
424-
api_instance.send_test_sms(campaign_id, send_test_sms)
424+
api_instance.send_test_sms(campaign_id, phone_number)
425425
except ApiException as e:
426426
print("Exception when calling SMSCampaignsApi->send_test_sms: %s\n" % e)
427427
```
@@ -431,7 +431,7 @@ except ApiException as e:
431431
Name | Type | Description | Notes
432432
------------- | ------------- | ------------- | -------------
433433
**campaign_id** | **int**| Id of the SMS campaign |
434-
**send_test_sms** | [**SendTestSms**](SendTestSms.md)| Mobile number to which send the test |
434+
**phone_number** | [**SendTestSms**](SendTestSms.md)| Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted |
435435

436436
### Return type
437437

docs/SendReportEmail.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**subject** | **str** | Subject of the email message | [optional]
7-
**to** | **list[str]** | Email addresses of the recipients | [optional]
8-
**content_type** | **str** | Type of the message body | [optional]
6+
**subject** | **str** | Subject of the email message |
7+
**to** | **list[str]** | Email addresses of the recipients |
8+
**content_type** | **str** | Type of the message body | [optional] [default to 'html']
99
**bcc** | **list[str]** | Email addresses of the recipients in bcc | [optional]
1010
**cc** | **list[str]** | Email addresses of the recipients in cc | [optional]
11-
**body** | **str** | Body of the email message | [optional]
11+
**body** | **str** | Body of the email message |
1212

1313
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1414

docs/SendSms.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**reference** | **str** | |
77
**message_id** | **int** | |
8+
**sms_count** | **int** | Count of SMS's to send multiple text messages | [optional]
9+
**used_credits** | **float** | SMS credits used per text message | [optional]
10+
**remaining_credits** | **float** | Remaining SMS credits of the user | [optional]
811

912
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1013

docs/SendSmtpEmail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
1111
**text_content** | **str** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional]
1212
**subject** | **str** | Subject of the message. Mandatory if 'templateId' is not passed | [optional]
1313
**reply_to** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
14-
**attachment** | [**list[SendSmtpEmailAttachment]**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, [{'url':'https://attachment.domain.com/myAttachmentFromUrl.jpg', 'name':'My attachment 1'}, {'content':'base64 exmaple content', 'name':'My attachment 2'}]. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps ( Ignored if 'templateId' is passed ) | [optional]
14+
**attachment** | [**list[SendSmtpEmailAttachment]**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, [{'url':'https://attachment.domain.com/myAttachmentFromUrl.jpg', 'name':'My attachment 1'}, {'content':'base64 exmaple content', 'name':'My attachment 2'}]. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps and odt ( Ignored if 'templateId' is passed ) | [optional]
1515
**headers** | **object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'1.2.3.4'} | [optional]
1616
**template_id** | **int** | Id of the template | [optional]
1717
**params** | **object** | Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. It's considered only if template is in New Template Language format. | [optional]

docs/SendTestSms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**phone_numbers** | **list[str]** | Mobile number with the country code to send test SMS. The mobile number defined here must belong to one of your contacts in SendinBlue account and must not be blacklisted | [optional]
6+
**phone_number** | **str** | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted | [optional]
77

88
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
99

docs/UpdateCampaignStatus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**status** | **str** | | [optional]
6+
**status** | **str** | Note:- replicateTemplate status will be available only for template type campaigns. | [optional]
77

88
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
99

docs/UpdateContact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**attributes** | **object** | Pass the set of attributes to be updated. These attributes must be present in your account. For eg. {'FNAME':'Ellie', 'LNAME':'Roger'} | [optional]
6+
**attributes** | **object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For eg. { 'EMAIL':'[email protected]', 'FNAME':'Ellie', 'LNAME':'Roger'} | [optional]
77
**email_blacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
88
**sms_blacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
99
**list_ids** | **list[int]** | Ids of the lists to add the contact to | [optional]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from setuptools import setup, find_packages
1616

1717
NAME = "sib-api-v3-sdk"
18-
VERSION = "4.1.2"
18+
VERSION = "4.1.3"
1919
# To install the library, run the following
2020
#
2121
# python setup.py install

sib_api_v3_sdk/api/sms_campaigns_api.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -750,45 +750,45 @@ def send_sms_report_with_http_info(self, campaign_id, send_report, **kwargs): #
750750
_request_timeout=params.get('_request_timeout'),
751751
collection_formats=collection_formats)
752752

753-
def send_test_sms(self, campaign_id, send_test_sms, **kwargs): # noqa: E501
753+
def send_test_sms(self, campaign_id, phone_number, **kwargs): # noqa: E501
754754
"""Send an SMS # noqa: E501
755755
756756
This method makes a synchronous HTTP request by default. To make an
757757
asynchronous HTTP request, please pass async=True
758-
>>> thread = api.send_test_sms(campaign_id, send_test_sms, async=True)
758+
>>> thread = api.send_test_sms(campaign_id, phone_number, async=True)
759759
>>> result = thread.get()
760760
761761
:param async bool
762762
:param int campaign_id: Id of the SMS campaign (required)
763-
:param SendTestSms send_test_sms: Mobile number to which send the test (required)
763+
:param SendTestSms phone_number: Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required)
764764
:return: None
765765
If the method is called asynchronously,
766766
returns the request thread.
767767
"""
768768
kwargs['_return_http_data_only'] = True
769769
if kwargs.get('async'):
770-
return self.send_test_sms_with_http_info(campaign_id, send_test_sms, **kwargs) # noqa: E501
770+
return self.send_test_sms_with_http_info(campaign_id, phone_number, **kwargs) # noqa: E501
771771
else:
772-
(data) = self.send_test_sms_with_http_info(campaign_id, send_test_sms, **kwargs) # noqa: E501
772+
(data) = self.send_test_sms_with_http_info(campaign_id, phone_number, **kwargs) # noqa: E501
773773
return data
774774

775-
def send_test_sms_with_http_info(self, campaign_id, send_test_sms, **kwargs): # noqa: E501
775+
def send_test_sms_with_http_info(self, campaign_id, phone_number, **kwargs): # noqa: E501
776776
"""Send an SMS # noqa: E501
777777
778778
This method makes a synchronous HTTP request by default. To make an
779779
asynchronous HTTP request, please pass async=True
780-
>>> thread = api.send_test_sms_with_http_info(campaign_id, send_test_sms, async=True)
780+
>>> thread = api.send_test_sms_with_http_info(campaign_id, phone_number, async=True)
781781
>>> result = thread.get()
782782
783783
:param async bool
784784
:param int campaign_id: Id of the SMS campaign (required)
785-
:param SendTestSms send_test_sms: Mobile number to which send the test (required)
785+
:param SendTestSms phone_number: Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required)
786786
:return: None
787787
If the method is called asynchronously,
788788
returns the request thread.
789789
"""
790790

791-
all_params = ['campaign_id', 'send_test_sms'] # noqa: E501
791+
all_params = ['campaign_id', 'phone_number'] # noqa: E501
792792
all_params.append('async')
793793
all_params.append('_return_http_data_only')
794794
all_params.append('_preload_content')
@@ -807,10 +807,10 @@ def send_test_sms_with_http_info(self, campaign_id, send_test_sms, **kwargs): #
807807
if ('campaign_id' not in params or
808808
params['campaign_id'] is None):
809809
raise ValueError("Missing the required parameter `campaign_id` when calling `send_test_sms`") # noqa: E501
810-
# verify the required parameter 'send_test_sms' is set
811-
if ('send_test_sms' not in params or
812-
params['send_test_sms'] is None):
813-
raise ValueError("Missing the required parameter `send_test_sms` when calling `send_test_sms`") # noqa: E501
810+
# verify the required parameter 'phone_number' is set
811+
if ('phone_number' not in params or
812+
params['phone_number'] is None):
813+
raise ValueError("Missing the required parameter `phone_number` when calling `send_test_sms`") # noqa: E501
814814

815815
collection_formats = {}
816816

@@ -826,8 +826,8 @@ def send_test_sms_with_http_info(self, campaign_id, send_test_sms, **kwargs): #
826826
local_var_files = {}
827827

828828
body_params = None
829-
if 'send_test_sms' in params:
830-
body_params = params['send_test_sms']
829+
if 'phone_number' in params:
830+
body_params = params['phone_number']
831831
# HTTP header `Accept`
832832
header_params['Accept'] = self.api_client.select_header_accept(
833833
['application/json']) # noqa: E501

sib_api_v3_sdk/models/create_webhook.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ def __init__(self, url=None, description=None, events=None, type='transactional'
5656
self.url = url
5757
if description is not None:
5858
self.description = description
59-
if events is not None:
60-
self.events = events
59+
self.events = events
6160
if type is not None:
6261
self.type = type
6362

@@ -129,6 +128,8 @@ def events(self, events):
129128
:param events: The events of this CreateWebhook. # noqa: E501
130129
:type: list[str]
131130
"""
131+
if events is None:
132+
raise ValueError("Invalid value for `events`, must not be `None`") # noqa: E501
132133
allowed_values = ["hardBounce", "softBounce", "blocked", "spam", "delivered", "request", "click", "invalid", "deferred", "opened", "uniqueOpened", "unsubscribed", "listAddition"] # noqa: E501
133134
if not set(events).issubset(set(allowed_values)):
134135
raise ValueError(

sib_api_v3_sdk/models/get_sms_event_report_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GetSmsEventReportEvents(object):
3232
"""
3333
swagger_types = {
3434
'phone_number': 'str',
35-
'date': 'date',
35+
'date': 'datetime',
3636
'message_id': 'str',
3737
'event': 'str',
3838
'reason': 'str',
@@ -102,21 +102,21 @@ def phone_number(self, phone_number):
102102
def date(self):
103103
"""Gets the date of this GetSmsEventReportEvents. # noqa: E501
104104
105-
Date on which the event has been generated # noqa: E501
105+
UTC date-time on which the event has been generated # noqa: E501
106106
107107
:return: The date of this GetSmsEventReportEvents. # noqa: E501
108-
:rtype: date
108+
:rtype: datetime
109109
"""
110110
return self._date
111111

112112
@date.setter
113113
def date(self, date):
114114
"""Sets the date of this GetSmsEventReportEvents.
115115
116-
Date on which the event has been generated # noqa: E501
116+
UTC date-time on which the event has been generated # noqa: E501
117117
118118
:param date: The date of this GetSmsEventReportEvents. # noqa: E501
119-
:type: date
119+
:type: datetime
120120
"""
121121
if date is None:
122122
raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501

0 commit comments

Comments
 (0)