Skip to content

Commit 107c4a3

Browse files
committed
Remove pagination from APIs that don't support it
The Licenses, Organizations, and Roles APIs do not support pagination. Remove pagination references and the `max=` argument from their `list()` methods.
1 parent 8ff799b commit 107c4a3

File tree

3 files changed

+11
-57
lines changed

3 files changed

+11
-57
lines changed

webexteamssdk/api/licenses.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,14 @@ def __init__(self, session, object_factory):
7373
self._object_factory = object_factory
7474

7575
@generator_container
76-
def list(self, orgId=None, max=None, **request_parameters):
76+
def list(self, orgId=None, **request_parameters):
7777
"""List all licenses for a given organization.
7878
7979
If no orgId is specified, the default is the organization of the
8080
authenticated user.
8181
82-
This method supports Webex Teams's implementation of RFC5988 Web
83-
Linking to provide pagination support. It returns a generator
84-
container that incrementally yields all objects returned by the
85-
query. The generator will automatically request additional 'pages' of
86-
responses from Webex as needed until all responses have been returned.
87-
The container makes the generator safe for reuse. A new API call will
88-
be made, using the same parameters that were specified when the
89-
generator was created, every time a new iterator is requested from the
90-
container.
91-
9282
Args:
9383
orgId(basestring): Specify the organization, by ID.
94-
max(int): Limit the maximum number of items returned from the Webex
95-
Teams service per request.
9684
**request_parameters: Additional request parameters (provides
9785
support for parameters that may be added in the future).
9886
@@ -106,12 +94,10 @@ def list(self, orgId=None, max=None, **request_parameters):
10694
10795
"""
10896
check_type(orgId, basestring)
109-
check_type(max, int)
11097

11198
params = dict_from_items_with_values(
11299
request_parameters,
113100
orgId=orgId,
114-
max=max,
115101
)
116102

117103
# API request - get items

webexteamssdk/api/organizations.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,10 @@ def __init__(self, session, object_factory):
7070
self._object_factory = object_factory
7171

7272
@generator_container
73-
def list(self, max=None, **request_parameters):
73+
def list(self, **request_parameters):
7474
"""List Organizations.
7575
76-
This method supports Webex Teams's implementation of RFC5988 Web
77-
Linking to provide pagination support. It returns a generator
78-
container that incrementally yields all objects returned by the
79-
query. The generator will automatically request additional 'pages' of
80-
responses from Webex as needed until all responses have been returned.
81-
The container makes the generator safe for reuse. A new API call will
82-
be made, using the same parameters that were specified when the
83-
generator was created, every time a new iterator is requested from the
84-
container.
85-
8676
Args:
87-
max(int): Limit the maximum number of items returned from the
88-
Webex Teams service per request.
8977
**request_parameters: Additional request parameters (provides
9078
support for parameters that may be added in the future).
9179
@@ -98,15 +86,11 @@ def list(self, max=None, **request_parameters):
9886
ApiError: If the Webex Teams cloud returns an error.
9987
10088
"""
101-
check_type(max, int)
102-
103-
params = dict_from_items_with_values(
104-
request_parameters,
105-
max=max,
106-
)
107-
10889
# API request - get items
109-
items = self._session.get_items(API_ENDPOINT, params=params)
90+
items = self._session.get_items(
91+
API_ENDPOINT,
92+
params=request_parameters
93+
)
11094

11195
# Yield organization objects created from the returned JSON objects
11296
for item in items:

webexteamssdk/api/roles.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,10 @@ def __init__(self, session, object_factory):
7373
self._object_factory = object_factory
7474

7575
@generator_container
76-
def list(self, max=None, **request_parameters):
76+
def list(self, **request_parameters):
7777
"""List all roles.
7878
79-
This method supports Webex Teams's implementation of RFC5988 Web
80-
Linking to provide pagination support. It returns a generator
81-
container that incrementally yields all objects returned by the
82-
query. The generator will automatically request additional 'pages' of
83-
responses from Webex as needed until all responses have been returned.
84-
The container makes the generator safe for reuse. A new API call will
85-
be made, using the same parameters that were specified when the
86-
generator was created, every time a new iterator is requested from the
87-
container.
88-
8979
Args:
90-
max(int): Limit the maximum number of items returned from the Webex
91-
Teams service per request.
9280
**request_parameters: Additional request parameters (provides
9381
support for parameters that may be added in the future).
9482
@@ -101,15 +89,11 @@ def list(self, max=None, **request_parameters):
10189
ApiError: If the Webex Teams cloud returns an error.
10290
10391
"""
104-
check_type(max, int)
105-
106-
params = dict_from_items_with_values(
107-
request_parameters,
108-
max=max,
109-
)
110-
11192
# API request - get items
112-
items = self._session.get_items(API_ENDPOINT, params=params)
93+
items = self._session.get_items(
94+
API_ENDPOINT,
95+
params=request_parameters
96+
)
11397

11498
# Yield role objects created from the returned JSON objects
11599
for item in items:

0 commit comments

Comments
 (0)