8000 Add $top to DE Rows Retrieve via REST API · kogan/FuelSDK-Python-Wrapper@e59eacc · GitHub
[go: up one dir, main page]

Skip to content

Commit e59eacc

Browse files
author
Sebastien.Dangelo
committed
Add $top to DE Rows Retrieve via REST API
1 parent 4a9a9c3 commit e59eacc

File tree

3 files changed

+11
-9
lines changed
Expand file tree

3 files changed

+11
-9
lines changed

FuelSDKWrapper.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,8 @@ def search_filter_for_rest_call(search_filter):
289289
else: # Simple Filter
290290
prop = search_filter['Property']
291291
operator = operator_for_rest_call(search_filter['SimpleOperator'])
292-
293-
if operator == Operator.IS_NULL:
294-
return "{}%20IS%20NULL".format(prop)
295-
elif operator == Operator.IS_NOT_NULL:
296-
return "{}%20IS%20NOT%20NULL".format(prop)
292+
if "NULL" in operator:
293+
return "{}%20{}".format(prop, operator)
297294
else:
298295
value = search_filter.get('Value', search_filter.get('DateValue'))
299296
if operator == 'like':
@@ -309,7 +306,9 @@ def operator_for_rest_call(operator):
309306
'greaterThanOrEqual': 'gte',
310307
'lessThan': 'lt',
311308
'lessThanOrEqual': 'lte',
312-
'like': 'like'
309+
'like': 'like',
310+
'isNull': 'IS%20NULL',
311+
'isNotNull': 'IS%20NOT%20NULL'
313312
}
314313
return operators[operator]
315314

@@ -448,7 +447,7 @@ def get_data_extension_columns(self, customer_key, property_list=None):
448447
def get_list_subscriber(self, search_filter=None, property_list=None):
449448
return self.get_objects(ObjectType.LIST_SUBSCRIBER, search_filter, property_list)
450449

451-
def get_data_extension_rows_rest(self, customer_key, search_filter=None, property_list=None, order_by=None, page_size=None, page=None, max_rows=2500):
450+
def get_data_extension_rows_rest(self, customer_key, search_filter=None, property_list=None, order_by=None, page_size=None, page=None, top=None, max_rows=2500):
452451
headers = {'content-type': 'application/json', 'Authorization': 'Bearer {}'.format(self.client.authToken)}
453452
endpoint = "{}data/v1/customobjectdata/key/{}/rowset?".format(self.client.base_api_url, customer_key)
454453

@@ -467,6 +466,9 @@ def get_data_extension_rows_rest(self, customer_key, search_filter=None, propert
467466
if page:
468467
endpoint += "&$page={}".format(page)
469468

469+
if top:
470+
endpoint += "&$top={}".format(top)
471+
470472
if max_rows < 0:
471473
max_rows = 2500
472474

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__title__ = 'FuelSDKWrapper'
2-
__version__ = '1.2.6'
2+
__version__ = '1.2.7'
33
__author__ = 'Seb Angel'
44
__license__ = 'MIT'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
readme = f.read()
55

66
setup(
7-
version='1.2.6',
7+
version='1.2.7',
88
name='FuelSDKWrapper',
99
description='Simplify and enhance the FuelSDK for Salesforce Marketing Cloud (ExactTarget)',
1010
long_description=readme,

0 commit comments

Comments
 (0)
0