Skip to content

Commit b64ea05

Browse files
committed
fix const naming [#20]
1 parent 677fa52 commit b64ea05

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

bunq/sdk/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,10 @@ class Pagination(object):
393393
_ERROR_NO_PREVIOUS_PAGE = 'Could not generate previous page URL params: ' \
394394
'there is no previous page.'
395395

396-
# Field constants
397-
FIELD_OLDER_ID = 'older_id'
398-
FIELD_NEWER_ID = 'newer_id'
399-
FIELD_COUNT = 'count'
396+
# URL Param constants
397+
URL_PARAM_OLDER_ID = 'older_id'
398+
URL_PARAM_NEWER_ID = 'newer_id'
399+
URL_PARAM_COUNT = 'count'
400400

401401
def __init__(self):
402402
self._older_id = None
@@ -415,7 +415,7 @@ def url_params_previous_page(self):
415415
raise exception.BunqException(self._ERROR_NO_PREVIOUS_PAGE)
416416

417417
params = {
418-
self.FIELD_OLDER_ID: str(self._older_id),
418+
self.URL_PARAM_OLDER_ID: str(self._older_id),
419419
}
420420
self._add_count_to_params_if_needed(params)
421421

@@ -436,7 +436,7 @@ def _add_count_to_params_if_needed(self, params):
436436
"""
437437

438438
if self._count is not None:
439-
params[self.FIELD_COUNT] = str(self._count)
439+
params[self.URL_PARAM_COUNT] = str(self._count)
440440

441441
@property
442442
def _next_id(self):
@@ -463,7 +463,7 @@ def url_params_next_page(self):
463463
"""
464464

465465
params = {
466-
self.FIELD_NEWER_ID: str(self._next_id),
466+
self.URL_PARAM_NEWER_ID: str(self._next_id),
467467
}
468468
self._add_count_to_params_if_needed(params)
469469

bunq/sdk/json/adapters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,21 +488,21 @@ def parse_pagination_dict(cls, response_obj):
488488
cls._FIELD_OLDER_ID,
489489
response_obj,
490490
cls._FIELD_OLDER_URL,
491-
client.Pagination.FIELD_OLDER_ID
491+
client.Pagination.URL_PARAM_OLDER_ID
492492
)
493493
cls.update_dict_id_field_from_response_field(
494494
pagination_dict,
495495
cls._FIELD_NEWER_ID,
496496
response_obj,
497497
cls._FIELD_NEWER_URL,
498-
client.Pagination.FIELD_NEWER_ID
498+
client.Pagination.URL_PARAM_NEWER_ID
499499
)
500500
cls.update_dict_id_field_from_response_field(
501501
pagination_dict,
502502
cls._FIELD_FUTURE_ID,
503503
response_obj,
504504
cls._FIELD_FUTURE_URL,
505-
client.Pagination.FIELD_NEWER_ID
505+
client.Pagination.URL_PARAM_NEWER_ID
506506
)
507507

508508
return pagination_dict
@@ -530,7 +530,8 @@ def update_dict_id_field_from_response_field(cls, dict_, dict_id_field,
530530

531531
if cls._FIELD_COUNT in parameters:
532532
dict_[cls._FIELD_COUNT] = int(
533-
parameters[client.Pagination.FIELD_COUNT][cls._INDEX_FIRST]
533+
parameters[client.Pagination.URL_PARAM_COUNT][
534+
cls._INDEX_FIRST]
534535
)
535536

536537
@classmethod

0 commit comments

Comments
 (0)