Skip to content

Commit

Permalink
add kwargs to paging method inits
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed Dec 23, 2020
1 parent 52c7bb6 commit c385d60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/core/azure-core/azure/core/paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def get_continuation_token(self, pipeline_response, deserialized, continuation_t

class NextLinkPagingMethod(PagingMethodABC):

def __init__(self, path_format_arguments=None):
def __init__(self, path_format_arguments=None, **kwargs):
"""Most common paging method. Uses the continuation token as the URL for the next call.
"""
self._path_format_arguments = path_format_arguments or {}
Expand Down Expand Up @@ -274,13 +274,13 @@ def get_continuation_token(self, pipeline_response, deserialized, continuation_t


class CallbackPagingMethod(NextLinkPagingMethod): # pylint: disable=too-many-instance-attributes
def __init__(self, next_request_callback):
def __init__(self, next_request_callback, **kwargs):
"""Base paging method. Accepts the callback for the next request as an init arg.
:param callable next_request_callback: Takes the continuation token as input and
outputs the next request
"""
super(CallbackPagingMethod, self).__init__()
super(CallbackPagingMethod, self).__init__(**kwargs)
self._next_request_callback = next_request_callback


Expand All @@ -300,10 +300,10 @@ def get_next_request(self, continuation_token, initial_request, client):

class HeaderPagingMethod(NextLinkPagingMethod):

def __init__(self, header_name):
def __init__(self, header_name, **kwargs):
"""Passes continuation token as a header parameter to next call.
"""
super(HeaderPagingMethod, self).__init__()
super(HeaderPagingMethod, self).__init__(**kwargs)
self._header_name = header_name

def get_next_request(self, continuation_token, initial_request, client):
Expand Down

0 comments on commit c385d60

Please sign in to comment.