Skip to content

Commit a7a7aad

Browse files
Merge pull request #21 from sendinblue/feature_updated_swagger_sync
Swagger update for email campaign filters
2 parents 2aeb842 + a0e161e commit a7a7aad

9 files changed

+82
-12
lines changed

docs/CreateAttribute.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
**value** | **str** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
77
**enumeration** | [**list[CreateAttributeEnumeration]**](CreateAttributeEnumeration.md) | List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}] | [optional]
8-
**type** | **str** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
8+
**type** | **str** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
99

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

docs/EmailCampaignsApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Name | Type | Description | Notes
226226
[[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)
227227

228228
# **get_email_campaigns**
229-
> GetEmailCampaigns get_email_campaigns(type=type, status=status, limit=limit, offset=offset)
229+
> GetEmailCampaigns get_email_campaigns(type=type, status=status, start_date=start_date, end_date=end_date, limit=limit, offset=offset)
230230
231231
Return all your created campaigns
232232

@@ -248,12 +248,14 @@ configuration.api_key['api-key'] = 'YOUR_API_KEY'
248248
api_instance = sib_api_v3_sdk.EmailCampaignsApi(sib_api_v3_sdk.ApiClient(configuration))
249249
type = 'type_example' # str | Filter on the type of the campaigns (optional)
250250
status = 'status_example' # str | Filter on the status of the campaign (optional)
251+
start_date = '2013-10-20T19:20:30+01:00' # datetime | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
252+
end_date = '2013-10-20T19:20:30+01:00' # datetime | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional)
251253
limit = 500 # int | Number of documents per page (optional) (default to 500)
252254
offset = 0 # int | Index of the first document in the page (optional) (default to 0)
253255

254256
try:
255257
# Return all your created campaigns
256-
api_response = api_instance.get_email_campaigns(type=type, status=status, limit=limit, offset=offset)
258+
api_response = api_instance.get_email_campaigns(type=type, status=status, start_date=start_date, end_date=end_date, limit=limit, offset=offset)
257259
pprint(api_response)
258260
except ApiException as e:
259261
print("Exception when calling EmailCampaignsApi->get_email_campaigns: %s\n" % e)
@@ -265,6 +267,8 @@ Name | Type | Description | Notes
265267
------------- | ------------- | ------------- | -------------
266268
**type** | **str**| Filter on the type of the campaigns | [optional]
267269
**status** | **str**| Filter on the status of the campaign | [optional]
270+
**start_date** | **datetime**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
271+
**end_date** | **datetime**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
268272
**limit** | **int**| Number of documents per page | [optional] [default to 500]
269273
**offset** | **int**| Index of the first document in the page | [optional] [default to 0]
270274

docs/GetEmailCampaign.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Name | Type | Description | Notes
2323
**inline_image_activation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
2424
**mirror_active** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
2525
**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
26+
**sent_date** | **datetime** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
2627
**recipients** | **object** | |
2728
**statistics** | **object** | |
2829

docs/GetExtendedCampaignOverview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Name | Type | Description | Notes
2323
**inline_image_activation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
2424
**mirror_active** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
2525
**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
26+
**sent_date** | **datetime** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
2627

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

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.0.1"
18+
VERSION = "4.1.0"
1919
# To install the library, run the following
2020
#
2121
# python setup.py install

sib_api_v3_sdk/api/email_campaigns_api.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ def get_email_campaigns(self, **kwargs): # noqa: E501
436436
:param async bool
437437
:param str type: Filter on the type of the campaigns
438438
:param str status: Filter on the status of the campaign
439+
:param datetime start_date: Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
440+
:param datetime end_date: Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
439441
:param int limit: Number of documents per page
440442
:param int offset: Index of the first document in the page
441443
:return: GetEmailCampaigns
@@ -460,14 +462,16 @@ def get_email_campaigns_with_http_info(self, **kwargs): # noqa: E501
460462
:param async bool
461463
:param str type: Filter on the type of the campaigns
462464
:param str status: Filter on the status of the campaign
465+
:param datetime start_date: Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
466+
:param datetime end_date: Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
463467
:param int limit: Number of documents per page
464468
:param int offset: Index of the first document in the page
465469
:return: GetEmailCampaigns
466470
If the method is called asynchronously,
467471
returns the request thread.
468472
"""
469473

470-
all_params = ['type', 'status', 'limit', 'offset'] # noqa: E501
474+
all_params = ['type', 'status', 'start_date', 'end_date', 'limit', 'offset'] # noqa: E501
471475
all_params.append('async')
472476
all_params.append('_return_http_data_only')
473477
all_params.append('_preload_content')
@@ -494,6 +498,10 @@ def get_email_campaigns_with_http_info(self, **kwargs): # noqa: E501
494498
query_params.append(('type', params['type'])) # noqa: E501
495499
if 'status' in params:
496500
query_params.append(('status', params['status'])) # noqa: E501
501+
if 'start_date' in params:
502+
query_params.append(('startDate', params['start_date'])) # noqa: E501
503+
if 'end_date' in params:
504+
query_params.append(('endDate', params['end_date'])) # noqa: E501
497505
if 'limit' in params:
498506
query_params.append(('limit', params['limit'])) # noqa: E501
499507
if 'offset' in params:

sib_api_v3_sdk/models/create_attribute.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def enumeration(self, enumeration):
109109
def type(self):
110110
"""Gets the type of this CreateAttribute. # noqa: E501
111111
112-
Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) # noqa: E501
112+
Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) # noqa: E501
113113
114114
:return: The type of this CreateAttribute. # noqa: E501
115115
:rtype: str
@@ -120,12 +120,12 @@ def type(self):
120120
def type(self, type):
121121
"""Sets the type of this CreateAttribute.
122122
123-
Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) # noqa: E501
123+
Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) # noqa: E501
124124
125125
:param type: The type of this CreateAttribute. # noqa: E501
126126
:type: str
127127
"""
128-
allowed_values = ["text", "date", "float", "id", "category"] # noqa: E501
128+
allowed_values = ["text", "date", "float", "boolean", "id", "category"] # noqa: E501
129129
if type not in allowed_values:
130130
raise ValueError(
131131
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501

sib_api_v3_sdk/models/get_email_campaign.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class GetEmailCampaign(object):
5454
'inline_image_activation': 'bool',
5555
'mirror_active': 'bool',
5656
'recurring': 'bool',
57+
'sent_date': 'datetime',
5758
'recipients': 'object',
5859
'statistics': 'object'
5960
}
@@ -79,11 +80,12 @@ class GetEmailCampaign(object):
7980
'inline_image_activation': 'inlineImageActivation',
8081
'mirror_active': 'mirrorActive',
8182
'recurring': 'recurring',
83+
'sent_date': 'sentDate',
8284
'recipients': 'recipients',
8385
'statistics': 'statistics'
8486
}
8587

86-
def __init__(self, id=None, name=None, subject=None, type=None, status=None, scheduled_at=None, test_sent=None, header=None, footer=None, sender=None, reply_to=None, to_field=None, html_content=None, share_link=None, tag=None, created_at=None, modified_at=None, inline_image_activation=None, mirror_active=None, recurring=None, recipients=None, statistics=None): # noqa: E501
88+
def __init__(self, id=None, name=None, subject=None, type=None, status=None, scheduled_at=None, test_sent=None, header=None, footer=None, sender=None, reply_to=None, to_field=None, html_content=None, share_link=None, tag=None, created_at=None, modified_at=None, inline_image_activation=None, mirror_active=None, recurring=None, sent_date=None, recipients=None, statistics=None): # noqa: E501
8789
"""GetEmailCampaign - a model defined in Swagger""" # noqa: E501
8890

8991
self._id = None
@@ -106,6 +108,7 @@ def __init__(self, id=None, name=None, subject=None, type=None, status=None, sch
106108
self._inline_image_activation = None
107109
self._mirror_active = None
108110
self._recurring = None
111+
self._sent_date = None
109112
self._recipients = None
110113
self._statistics = None
111114
self.discriminator = None
@@ -135,6 +138,8 @@ def __init__(self, id=None, name=None, subject=None, type=None, status=None, sch
135138
self.mirror_active = mirror_active
136139
if recurring is not None:
137140
self.recurring = recurring
141+
if sent_date is not None:
142+
self.sent_date = sent_date
138143
self.recipients = recipients
139144
self.statistics = statistics
140145

@@ -638,6 +643,29 @@ def recurring(self, recurring):
638643

639644
self._recurring = recurring
640645

646+
@property
647+
def sent_date(self):
648+
"""Gets the sent_date of this GetEmailCampaign. # noqa: E501
649+
650+
Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' # noqa: E501
651+
652+
:return: The sent_date of this GetEmailCampaign. # noqa: E501
653+
:rtype: datetime
654+
"""
655+
return self._sent_date
656+
657+
@sent_date.setter
658+
def sent_date(self, sent_date):
659+
"""Sets the sent_date of this GetEmailCampaign.
660+
661+
Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' # noqa: E501
662+
663+
:param sent_date: The sent_date of this GetEmailCampaign. # noqa: E501
664+
:type: datetime
665+
"""
666+
667+
self._sent_date = sent_date
668+
641669
@property
642670
def recipients(self):
643671
"""Gets the recipients of this GetEmailCampaign. # noqa: E501

sib_api_v3_sdk/models/get_extended_campaign_overview.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class GetExtendedCampaignOverview(object):
5353
'modified_at': 'datetime',
5454
'inline_image_activation': 'bool',
5555
'mirror_active': 'bool',
56-
'recurring': 'bool'
56+
'recurring': 'bool',
57+
'sent_date': 'datetime'
5758
}
5859

5960
attribute_map = {
@@ -76,10 +77,11 @@ class GetExtendedCampaignOverview(object):
7677
'modified_at': 'modifiedAt',
7778
'inline_image_activation': 'inlineImageActivation',
7879
'mirror_active': 'mirrorActive',
79-
'recurring': 'recurring'
80+
'recurring': 'recurring',
81+
'sent_date': 'sentDate'
8082
}
8183

82-
def __init__(self, id=None, name=None, subject=None, type=None, status=None, scheduled_at=None, test_sent=None, header=None, footer=None, sender=None, reply_to=None, to_field=None, html_content=None, share_link=None, tag=None, created_at=None, modified_at=None, inline_image_activation=None, mirror_active=None, recurring=None): # noqa: E501
84+
def __init__(self, id=None, name=None, subject=None, type=None, status=None, scheduled_at=None, test_sent=None, header=None, footer=None, sender=None, reply_to=None, to_field=None, html_content=None, share_link=None, tag=None, created_at=None, modified_at=None, inline_image_activation=None, mirror_active=None, recurring=None, sent_date=None): # noqa: E501
8385
"""GetExtendedCampaignOverview - a model defined in Swagger""" # noqa: E501
8486

8587
self._id = None
@@ -102,6 +104,7 @@ def __init__(self, id=None, name=None, subject=None, type=None, status=None, sch
102104
self._inline_image_activation = None
103105
self._mirror_active = None
104106
self._recurring = None
107+
self._sent_date = None
105108
self.discriminator = None
106109

107110
self.id = id
@@ -129,6 +132,8 @@ def __init__(self, id=None, name=None, subject=None, type=None, status=None, sch
129132
self.mirror_active = mirror_active
130133
if recurring is not None:
131134
self.recurring = recurring
135+
if sent_date is not None:
136+
self.sent_date = sent_date
132137

133138
@property
134139
def id(self):
@@ -630,6 +635,29 @@ def recurring(self, recurring):
630635

631636
self._recurring = recurring
632637

638+
@property
639+
def sent_date(self):
640+
"""Gets the sent_date of this GetExtendedCampaignOverview. # noqa: E501
641+
642+
Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' # noqa: E501
643+
644+
:return: The sent_date of this GetExtendedCampaignOverview. # noqa: E501
645+
:rtype: datetime
646+
"""
647+
return self._sent_date
648+
649+
@sent_date.setter
650+
def sent_date(self, sent_date):
651+
"""Sets the sent_date of this GetExtendedCampaignOverview.
652+
653+
Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' # noqa: E501
654+
655+
:param sent_date: The sent_date of this GetExtendedCampaignOverview. # noqa: E501
656+
:type: datetime
657+
"""
658+
659+
self._sent_date = sent_date
660+
633661
def to_dict(self):
634662
"""Returns the model properties as a dict"""
635663
result = {}

0 commit comments

Comments
 (0)