Skip to content

Commit 2814bd6

Browse files
committed
Updated 'getTenants' to TB 3.1 REST API
1 parent 52229bd commit 2814bd6

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

tb_rest_client/api/api_ce/device_controller_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ def get_tenant_devices_using_get_with_http_info(self, **kwargs): # noqa: E501
11541154
if ('page_size' not in params or
11551155
params['page_size'] is None):
11561156
raise ValueError("Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`") # noqa: E501
1157-
# verify the required parameter 'page_size' is set
1157+
# verify the required parameter 'page' is set
11581158
if ('page' not in params or
11591159
params['page'] is None):
11601160
raise ValueError("Missing the required parameter `page` when calling `get_tenant_devices_using_get`") # noqa: E501

tb_rest_client/api/api_ce/tenant_controller_api.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -220,49 +220,51 @@ def get_tenant_by_id_using_get_with_http_info(self, tenant_id, **kwargs): # noq
220220
_request_timeout=params.get('_request_timeout'),
221221
collection_formats=collection_formats)
222222

223-
def get_tenants_using_get(self, limit, **kwargs): # noqa: E501
223+
def get_tenants_using_get(self, **kwargs): # noqa: E501
224224
"""getTenants # noqa: E501
225225
226226
This method makes a synchronous HTTP request by default. To make an
227227
asynchronous HTTP request, please pass async_req=True
228-
>>> thread = api_pe.get_tenants_using_get(limit, async_req=True)
228+
>>> thread = api_pe.get_tenants_using_get(async_req=True)
229229
>>> result = thread.get()
230230
231231
:param async_req bool
232-
:param str limit: limit (required)
233232
:param str text_search: textSearch
234-
:param str id_offset: idOffset
235-
:param str text_offset: textOffset
233+
:param str sort_property: sortProperty
234+
:param str sort_order: sortOrder
235+
:param str page_size: pageSize (required)
236+
:param str page: page (required)
236237
:return: TextPageDataTenant
237238
If the method is called asynchronously,
238239
returns the request thread.
239240
"""
240241
kwargs['_return_http_data_only'] = True
241242
if kwargs.get('async_req'):
242-
return self.get_tenants_using_get_with_http_info(limit, **kwargs) # noqa: E501
243+
return self.get_tenants_using_get_with_http_info(**kwargs) # noqa: E501
243244
else:
244-
(data) = self.get_tenants_using_get_with_http_info(limit, **kwargs) # noqa: E501
245+
(data) = self.get_tenants_using_get_with_http_info(**kwargs) # noqa: E501
245246
return data
246247

247-
def get_tenants_using_get_with_http_info(self, limit, **kwargs): # noqa: E501
248+
def get_tenants_using_get_with_http_info(self, **kwargs): # noqa: E501
248249
"""getTenants # noqa: E501
249250
250251
This method makes a synchronous HTTP request by default. To make an
251252
asynchronous HTTP request, please pass async_req=True
252-
>>> thread = api_pe.get_tenants_using_get_with_http_info(limit, async_req=True)
253+
>>> thread = api_pe.get_tenants_using_get_with_http_info(async_req=True)
253254
>>> result = thread.get()
254255
255256
:param async_req bool
256-
:param str limit: limit (required)
257257
:param str text_search: textSearch
258-
:param str id_offset: idOffset
259-
:param str text_offset: textOffset
258+
:param str sort_property: sortProperty
259+
:param str sort_order: sortOrder
260+
:param str page_size: pageSize (required)
261+
:param str page: page (required)
260262
:return: TextPageDataTenant
261263
If the method is called asynchronously,
262264
returns the request thread.
263265
"""
264266

265-
all_params = ['limit', 'text_search', 'id_offset', 'text_offset'] # noqa: E501
267+
all_params = ['text_search', 'sort_property', 'sort_order', 'page_size', 'page'] # noqa: E501
266268
all_params.append('async_req')
267269
all_params.append('_return_http_data_only')
268270
all_params.append('_preload_content')
@@ -273,10 +275,14 @@ def get_tenants_using_get_with_http_info(self, limit, **kwargs): # noqa: E501
273275

274276
params[key] = val
275277
del params['kwargs']
276-
# verify the required parameter 'limit' is set
277-
if ('limit' not in params or
278-
params['limit'] is None):
279-
raise ValueError("Missing the required parameter `limit` when calling `get_tenants_using_get`") # noqa: E501
278+
# verify the required parameter 'page_size' is set
279+
if ('page_size' not in params or
280+
params['page_size'] is None):
281+
raise ValueError("Missing the required parameter `page_size` when calling `get_tenants_using_get`") # noqa: E501
282+
# verify the required parameter 'page' is set
283+
if ('page' not in params or
284+
params['page'] is None):
285+
raise ValueError("Missing the required parameter `page` when calling `get_tenants_using_get`") # noqa: E501
280286

281287
collection_formats = {}
282288

@@ -285,12 +291,14 @@ def get_tenants_using_get_with_http_info(self, limit, **kwargs): # noqa: E501
285291
query_params = []
286292
if 'text_search' in params:
287293
query_params.append(('textSearch', params['text_search'])) # noqa: E501
288-
if 'id_offset' in params:
289-
query_params.append(('idOffset', params['id_offset'])) # noqa: E501
290-
if 'text_offset' in params:
291-
query_params.append(('textOffset', params['text_offset'])) # noqa: E501
292-
if 'limit' in params:
293-
query_params.append(('limit', params['limit'])) # noqa: E501
294+
if 'sort_property' in params:
295+
query_params.append(('sortProperty', params['sort_property'])) # noqa: E501
296+
if 'sort_order' in params:
297+
query_params.append(('sortOrder', params['sort_order'])) # noqa: E501
298+
if 'page_size' in params:
299+
query_params.append(('pageSize', params['page_size'])) # noqa: E501
300+
if 'page' in params:
301+
query_params.append(('page', params['page'])) # noqa: E501
294302

295303
header_params = {}
296304

@@ -310,7 +318,7 @@ def get_tenants_using_get_with_http_info(self, limit, **kwargs): # noqa: E501
310318
auth_settings = ['X-Authorization'] # noqa: E501
311319

312320
return self.api_client.call_api(
313-
'/api/tenants{?textSearch,idOffset,textOffset,limit}', 'GET',
321+
'/api/tenants{?textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',
314322
path_params,
315323
query_params,
316324
header_params,

0 commit comments

Comments
 (0)