Dataset Viewer
code
stringlengths 13
1.2M
| order_type
stringclasses 1
value | original_example
dict | step_ids
sequencelengths 1
5
|
---|---|---|---|
# coding: utf-8
# Copyright 2020. ThingsBoard
# #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from tb_rest_client.api.api_ce import DeviceControllerApi
class DeviceControllerApi(DeviceControllerApi):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
super(DeviceControllerApi, self).__init__(api_client)
def claim_device_using_post(self, device_name, **kwargs): # noqa: E501
"""claimDevice # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.claim_device_using_post(device_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_name: deviceName (required)
:param ClaimRequest claim_request: claimRequest
:param str sub_customer_id: subCustomerId
:return: DeferredResultResponseEntity
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.claim_device_using_post_with_http_info(device_name, **kwargs) # noqa: E501
else:
(data) = self.claim_device_using_post_with_http_info(device_name, **kwargs) # noqa: E501
return data
def claim_device_using_post_with_http_info(self, device_name, **kwargs): # noqa: E501
"""claimDevice # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str device_name: deviceName (required)
:param ClaimRequest claim_request: claimRequest
:param str sub_customer_id: subCustomerId
:return: DeferredResultResponseEntity
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_name', 'claim_request', 'sub_customer_id'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'device_name' is set
if ('device_name' not in params or
params['device_name'] is None):
raise ValueError("Missing the required parameter `device_name` when calling `claim_device_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_name' in params:
path_params['deviceName'] = params['device_name'] # noqa: E501
query_params = []
if 'sub_customer_id' in params:
query_params.append(('subCustomerId', params['sub_customer_id'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'claim_request' in params:
body_params = params['claim_request']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/customer/device/{deviceName}/claim{?subCustomerId}', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeferredResultResponseEntity', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_customer_devices_using_get(self, customer_id, page_size, page, **kwargs): # noqa: E501
"""getCustomerDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_customer_devices_using_get(customer_id, page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str customer_id: customerId (required)
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, **kwargs) # noqa: E501
else:
(data) = self.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, **kwargs) # noqa: E501
return data
def get_customer_devices_using_get_with_http_info(self, customer_id, page_size, page, **kwargs): # noqa: E501
"""getCustomerDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str customer_id: customerId (required)
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['customer_id', 'page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'customer_id' is set
if ('customer_id' not in params or
params['customer_id'] is None):
raise ValueError("Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`") # noqa: E501
# verify the required parameter 'page_size' is set
if ('page_size' not in params or
params['page_size'] is None):
raise ValueError("Missing the required parameter `page_size` when calling `get_customer_devices_using_get`") # noqa: E501
# verify the required parameter 'page' is set
if ('page' not in params or
params['page'] is None):
raise ValueError("Missing the required parameter `page` when calling `get_customer_devices_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
if 'customer_id' in params:
path_params['customerId'] = params['customer_id'] # noqa: E501
query_params = []
if 'type' in params:
query_params.append(('type', params['type'])) # noqa: E501
if 'text_search' in params:
query_params.append(('textSearch', params['text_search'])) # noqa: E501
if 'sort_property' in params:
query_params.append(('sortProperty', params['sort_property'])) # noqa: E501
if 'sort_order' in params:
query_params.append(('sortOrder', params['sort_order'])) # noqa: E501
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PageDataDevice', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_devices_by_entity_group_id_using_get(self, entity_group_id, page_size, page, **kwargs): # noqa: E501
"""getDevicesByEntityGroupId # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str entity_group_id: entityGroupId (required)
:param str page_size: Page size (required)
:param str page: Page (required)
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, **kwargs) # noqa: E501
else:
(data) = self.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, **kwargs) # noqa: E501
return data
def get_devices_by_entity_group_id_using_get_with_http_info(self, entity_group_id, page_size, page, **kwargs): # noqa: E501
"""getDevicesByEntityGroupId # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str entity_group_id: entityGroupId (required)
:param str page_size: Page size (required)
:param str page: Page (required)
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['entity_group_id', 'page_size', 'page', 'text_search', 'sort_property', 'sort_order'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'entity_group_id' is set
if ('entity_group_id' not in params or
params['entity_group_id'] is None):
raise ValueError("Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`") # noqa: E501
# verify the required parameter 'page_size' is set
if ('page_size' not in params or
params['page_size'] is None):
raise ValueError("Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`") # noqa: E501
# verify the required parameter 'page' is set
if ('page' not in params or
params['page'] is None):
raise ValueError("Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`") # noqa: E501
if 'page_size' in params and params['page_size'] < 1.0: # noqa: E501
raise ValueError("Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`") # noqa: E501
if 'page' in params and params['page'] < 0.0: # noqa: E501
raise ValueError("Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`") # noqa: E501
collection_formats = {}
path_params = {}
if 'entity_group_id' in params:
path_params['entityGroupId'] = params['entity_group_id'] # noqa: E501
query_params = []
if 'text_search' in params:
query_params.append(('textSearch', params['text_search'])) # noqa: E501
if 'sort_property' in params:
query_params.append(('sortProperty', params['sort_property'])) # noqa: E501
if 'sort_order' in params:
query_params.append(('sortOrder', params['sort_order'])) # noqa: E501
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PageDataDevice', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_tenant_devices_using_get(self, page_size, page, **kwargs): # noqa: E501
"""getTenantDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_tenant_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501
else:
(data) = self.get_tenant_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501
return data
def get_tenant_devices_using_get_with_http_info(self, page_size, page, **kwargs): # noqa: E501
"""getTenantDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'page_size' is set
if ('page_size' not in params or
params['page_size'] is None):
raise ValueError("Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`") # noqa: E501
# verify the required parameter 'page' is set
if ('page' not in params or
params['page'] is None):
raise ValueError("Missing the required parameter `page` when calling `get_tenant_devices_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'type' in params:
query_params.append(('type', params['type'])) # noqa: E501
if 'text_search' in params:
query_params.append(('textSearch', params['text_search'])) # noqa: E501
if 'sort_property' in params:
query_params.append(('sortProperty', params['sort_property'])) # noqa: E501
if 'sort_order' in params:
query_params.append(('sortOrder', params['sort_order'])) # noqa: E501
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PageDataDevice', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_user_devices_using_get(self, page_size, page, **kwargs): # noqa: E501
"""getUserDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_user_devices_using_get(page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_user_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501
else:
(data) = self.get_user_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501
return data
def get_user_devices_using_get_with_http_info(self, page_size, page, **kwargs): # noqa: E501
"""getUserDevices # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.get_user_devices_using_get_with_http_info(page_size, page, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str page_size: pageSize (required)
:param str page: page (required)
:param str type: type
:param str text_search: textSearch
:param str sort_property: sortProperty
:param str sort_order: sortOrder
:return: PageDataDevice
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'page_size' is set
if ('page_size' not in params or
params['page_size'] is None):
raise ValueError("Missing the required parameter `page_size` when calling `get_user_devices_using_get`") # noqa: E501
# verify the required parameter 'page' is set
if ('page' not in params or
params['page'] is None):
raise ValueError("Missing the required parameter `page` when calling `get_user_devices_using_get`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'type' in params:
query_params.append(('type', params['type'])) # noqa: E501
if 'text_search' in params:
query_params.append(('textSearch', params['text_search'])) # noqa: E501
if 'sort_property' in params:
query_params.append(('sortProperty', params['sort_property'])) # noqa: E501
if 'sort_order' in params:
query_params.append(('sortOrder', params['sort_order'])) # noqa: E501
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/user/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PageDataDevice', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def save_device_using_post(self, device, **kwargs): # noqa: E501
"""saveDevice # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.save_device_using_post(device, async_req=True)
>>> result = thread.get()
:param async_req bool
:param Device device: device (required)
:param str access_token: accessToken
:param str entity_group_id: entityGroupId
:return: Device
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.save_device_using_post_with_http_info(device, **kwargs) # noqa: E501
else:
(data) = self.save_device_using_post_with_http_info(device, **kwargs) # noqa: E501
return data
def save_device_using_post_with_http_info(self, device, **kwargs): # noqa: E501
"""saveDevice # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)
>>> result = thread.get()
:param async_req bool
:param Device device: device (required)
:param str access_token: accessToken
:param str entity_group_id: entityGroupId
:return: Device
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device', 'access_token', 'entity_group_id'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
params[key] = val
del params['kwargs']
# verify the required parameter 'device' is set
if ('device' not in params or
params['device'] is None):
raise ValueError("Missing the required parameter `device` when calling `save_device_using_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'access_token' in params:
query_params.append(('accessToken', params['access_token'])) # noqa: E501
if 'entity_group_id' in params:
query_params.append(('entityGroupId', params['entity_group_id'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'device' in params:
body_params = params['device']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['X-Authorization'] # noqa: E501
return self.api_client.call_api(
'/api/device{?accessToken,entityGroupId}', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Device', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
normal
|
{
"blob_id": "9b30075183cf9611307afa74aa45979872e7e9d5",
"index": 8132,
"step-1": "<mask token>\n\n\nclass DeviceControllerApi(DeviceControllerApi):\n <mask token>\n <mask token>\n\n def claim_device_using_post(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n else:\n data = self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n return data\n\n def claim_device_using_post_with_http_info(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device_name', 'claim_request', 'sub_customer_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device_name' not in params or params['device_name'] is None:\n raise ValueError(\n 'Missing the required parameter `device_name` when calling `claim_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n if 'device_name' in params:\n path_params['deviceName'] = params['device_name']\n query_params = []\n if 'sub_customer_id' in params:\n query_params.append(('subCustomerId', params['sub_customer_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'claim_request' in params:\n body_params = params['claim_request']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/device/{deviceName}/claim{?subCustomerId}',\n 'POST', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='DeferredResultResponseEntity', auth_settings=\n auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n <mask token>\n\n def get_customer_devices_using_get_with_http_info(self, customer_id,\n page_size, page, **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['customer_id', 'page_size', 'page', 'type',\n 'text_search', 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'customer_id' not in params or params['customer_id'] is None:\n raise ValueError(\n 'Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_customer_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_customer_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n if 'customer_id' in params:\n path_params['customerId'] = params['customer_id']\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_devices_by_entity_group_id_using_get(self, entity_group_id,\n page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n else:\n data = (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n return data\n\n def get_devices_by_entity_group_id_using_get_with_http_info(self,\n entity_group_id, page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['entity_group_id', 'page_size', 'page', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'entity_group_id' not in params or params['entity_group_id'\n ] is None:\n raise ValueError(\n 'Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' in params and params['page_size'] < 1.0:\n raise ValueError(\n 'Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`'\n )\n if 'page' in params and params['page'] < 0.0:\n raise ValueError(\n 'Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`'\n )\n collection_formats = {}\n path_params = {}\n if 'entity_group_id' in params:\n path_params['entityGroupId'] = params['entity_group_id']\n query_params = []\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_tenant_devices_using_get(self, page_size, page, **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n else:\n data = self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n return data\n\n def get_tenant_devices_using_get_with_http_info(self, page_size, page,\n **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_tenant_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n <mask token>\n <mask token>\n\n def save_device_using_post(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.save_device_using_post_with_http_info(device, **kwargs)\n else:\n data = self.save_device_using_post_with_http_info(device, **kwargs)\n return data\n\n def save_device_using_post_with_http_info(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device', 'access_token', 'entity_group_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device' not in params or params['device'] is None:\n raise ValueError(\n 'Missing the required parameter `device` when calling `save_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'access_token' in params:\n query_params.append(('accessToken', params['access_token']))\n if 'entity_group_id' in params:\n query_params.append(('entityGroupId', params['entity_group_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'device' in params:\n body_params = params['device']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/device{?accessToken,entityGroupId}', 'POST', path_params,\n query_params, header_params, body=body_params, post_params=\n form_params, files=local_var_files, response_type='Device',\n auth_settings=auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n",
"step-2": "<mask token>\n\n\nclass DeviceControllerApi(DeviceControllerApi):\n <mask token>\n <mask token>\n\n def claim_device_using_post(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n else:\n data = self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n return data\n\n def claim_device_using_post_with_http_info(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device_name', 'claim_request', 'sub_customer_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device_name' not in params or params['device_name'] is None:\n raise ValueError(\n 'Missing the required parameter `device_name` when calling `claim_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n if 'device_name' in params:\n path_params['deviceName'] = params['device_name']\n query_params = []\n if 'sub_customer_id' in params:\n query_params.append(('subCustomerId', params['sub_customer_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'claim_request' in params:\n body_params = params['claim_request']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/device/{deviceName}/claim{?subCustomerId}',\n 'POST', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='DeferredResultResponseEntity', auth_settings=\n auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_customer_devices_using_get(self, customer_id, page_size, page,\n **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n else:\n data = self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n return data\n\n def get_customer_devices_using_get_with_http_info(self, customer_id,\n page_size, page, **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['customer_id', 'page_size', 'page', 'type',\n 'text_search', 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'customer_id' not in params or params['customer_id'] is None:\n raise ValueError(\n 'Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_customer_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_customer_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n if 'customer_id' in params:\n path_params['customerId'] = params['customer_id']\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_devices_by_entity_group_id_using_get(self, entity_group_id,\n page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n else:\n data = (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n return data\n\n def get_devices_by_entity_group_id_using_get_with_http_info(self,\n entity_group_id, page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['entity_group_id', 'page_size', 'page', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'entity_group_id' not in params or params['entity_group_id'\n ] is None:\n raise ValueError(\n 'Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' in params and params['page_size'] < 1.0:\n raise ValueError(\n 'Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`'\n )\n if 'page' in params and params['page'] < 0.0:\n raise ValueError(\n 'Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`'\n )\n collection_formats = {}\n path_params = {}\n if 'entity_group_id' in params:\n path_params['entityGroupId'] = params['entity_group_id']\n query_params = []\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_tenant_devices_using_get(self, page_size, page, **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n else:\n data = self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n return data\n\n def get_tenant_devices_using_get_with_http_info(self, page_size, page,\n **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_tenant_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n <mask token>\n <mask token>\n\n def save_device_using_post(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.save_device_using_post_with_http_info(device, **kwargs)\n else:\n data = self.save_device_using_post_with_http_info(device, **kwargs)\n return data\n\n def save_device_using_post_with_http_info(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device', 'access_token', 'entity_group_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device' not in params or params['device'] is None:\n raise ValueError(\n 'Missing the required parameter `device` when calling `save_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'access_token' in params:\n query_params.append(('accessToken', params['access_token']))\n if 'entity_group_id' in params:\n query_params.append(('entityGroupId', params['entity_group_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'device' in params:\n body_params = params['device']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/device{?accessToken,entityGroupId}', 'POST', path_params,\n query_params, header_params, body=body_params, post_params=\n form_params, files=local_var_files, response_type='Device',\n auth_settings=auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n",
"step-3": "<mask token>\n\n\nclass DeviceControllerApi(DeviceControllerApi):\n <mask token>\n\n def __init__(self, api_client=None):\n super(DeviceControllerApi, self).__init__(api_client)\n\n def claim_device_using_post(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n else:\n data = self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n return data\n\n def claim_device_using_post_with_http_info(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device_name', 'claim_request', 'sub_customer_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device_name' not in params or params['device_name'] is None:\n raise ValueError(\n 'Missing the required parameter `device_name` when calling `claim_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n if 'device_name' in params:\n path_params['deviceName'] = params['device_name']\n query_params = []\n if 'sub_customer_id' in params:\n query_params.append(('subCustomerId', params['sub_customer_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'claim_request' in params:\n body_params = params['claim_request']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/device/{deviceName}/claim{?subCustomerId}',\n 'POST', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='DeferredResultResponseEntity', auth_settings=\n auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_customer_devices_using_get(self, customer_id, page_size, page,\n **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n else:\n data = self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n return data\n\n def get_customer_devices_using_get_with_http_info(self, customer_id,\n page_size, page, **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['customer_id', 'page_size', 'page', 'type',\n 'text_search', 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'customer_id' not in params or params['customer_id'] is None:\n raise ValueError(\n 'Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_customer_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_customer_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n if 'customer_id' in params:\n path_params['customerId'] = params['customer_id']\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_devices_by_entity_group_id_using_get(self, entity_group_id,\n page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n else:\n data = (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n return data\n\n def get_devices_by_entity_group_id_using_get_with_http_info(self,\n entity_group_id, page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['entity_group_id', 'page_size', 'page', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'entity_group_id' not in params or params['entity_group_id'\n ] is None:\n raise ValueError(\n 'Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' in params and params['page_size'] < 1.0:\n raise ValueError(\n 'Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`'\n )\n if 'page' in params and params['page'] < 0.0:\n raise ValueError(\n 'Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`'\n )\n collection_formats = {}\n path_params = {}\n if 'entity_group_id' in params:\n path_params['entityGroupId'] = params['entity_group_id']\n query_params = []\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_tenant_devices_using_get(self, page_size, page, **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n else:\n data = self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n return data\n\n def get_tenant_devices_using_get_with_http_info(self, page_size, page,\n **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_tenant_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n <mask token>\n\n def get_user_devices_using_get_with_http_info(self, page_size, page, **\n kwargs):\n \"\"\"getUserDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_user_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_user_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_user_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/user/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def save_device_using_post(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.save_device_using_post_with_http_info(device, **kwargs)\n else:\n data = self.save_device_using_post_with_http_info(device, **kwargs)\n return data\n\n def save_device_using_post_with_http_info(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device', 'access_token', 'entity_group_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device' not in params or params['device'] is None:\n raise ValueError(\n 'Missing the required parameter `device` when calling `save_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'access_token' in params:\n query_params.append(('accessToken', params['access_token']))\n if 'entity_group_id' in params:\n query_params.append(('entityGroupId', params['entity_group_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'device' in params:\n body_params = params['device']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/device{?accessToken,entityGroupId}', 'POST', path_params,\n query_params, header_params, body=body_params, post_params=\n form_params, files=local_var_files, response_type='Device',\n auth_settings=auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n",
"step-4": "<mask token>\n\n\nclass DeviceControllerApi(DeviceControllerApi):\n <mask token>\n\n def __init__(self, api_client=None):\n super(DeviceControllerApi, self).__init__(api_client)\n\n def claim_device_using_post(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n else:\n data = self.claim_device_using_post_with_http_info(device_name,\n **kwargs)\n return data\n\n def claim_device_using_post_with_http_info(self, device_name, **kwargs):\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device_name', 'claim_request', 'sub_customer_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device_name' not in params or params['device_name'] is None:\n raise ValueError(\n 'Missing the required parameter `device_name` when calling `claim_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n if 'device_name' in params:\n path_params['deviceName'] = params['device_name']\n query_params = []\n if 'sub_customer_id' in params:\n query_params.append(('subCustomerId', params['sub_customer_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'claim_request' in params:\n body_params = params['claim_request']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/device/{deviceName}/claim{?subCustomerId}',\n 'POST', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='DeferredResultResponseEntity', auth_settings=\n auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_customer_devices_using_get(self, customer_id, page_size, page,\n **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n else:\n data = self.get_customer_devices_using_get_with_http_info(\n customer_id, page_size, page, **kwargs)\n return data\n\n def get_customer_devices_using_get_with_http_info(self, customer_id,\n page_size, page, **kwargs):\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['customer_id', 'page_size', 'page', 'type',\n 'text_search', 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'customer_id' not in params or params['customer_id'] is None:\n raise ValueError(\n 'Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_customer_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_customer_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n if 'customer_id' in params:\n path_params['customerId'] = params['customer_id']\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_devices_by_entity_group_id_using_get(self, entity_group_id,\n page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n else:\n data = (self.\n get_devices_by_entity_group_id_using_get_with_http_info(\n entity_group_id, page_size, page, **kwargs))\n return data\n\n def get_devices_by_entity_group_id_using_get_with_http_info(self,\n entity_group_id, page_size, page, **kwargs):\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['entity_group_id', 'page_size', 'page', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'entity_group_id' not in params or params['entity_group_id'\n ] is None:\n raise ValueError(\n 'Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`'\n )\n if 'page_size' in params and params['page_size'] < 1.0:\n raise ValueError(\n 'Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`'\n )\n if 'page' in params and params['page'] < 0.0:\n raise ValueError(\n 'Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`'\n )\n collection_formats = {}\n path_params = {}\n if 'entity_group_id' in params:\n path_params['entityGroupId'] = params['entity_group_id']\n query_params = []\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_tenant_devices_using_get(self, page_size, page, **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n else:\n data = self.get_tenant_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n return data\n\n def get_tenant_devices_using_get_with_http_info(self, page_size, page,\n **kwargs):\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_tenant_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def get_user_devices_using_get(self, page_size, page, **kwargs):\n \"\"\"getUserDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_user_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_user_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n else:\n data = self.get_user_devices_using_get_with_http_info(page_size,\n page, **kwargs)\n return data\n\n def get_user_devices_using_get_with_http_info(self, page_size, page, **\n kwargs):\n \"\"\"getUserDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_user_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['page_size', 'page', 'type', 'text_search',\n 'sort_property', 'sort_order']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'page_size' not in params or params['page_size'] is None:\n raise ValueError(\n 'Missing the required parameter `page_size` when calling `get_user_devices_using_get`'\n )\n if 'page' not in params or params['page'] is None:\n raise ValueError(\n 'Missing the required parameter `page` when calling `get_user_devices_using_get`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type']))\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search']))\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property']))\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order']))\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size']))\n if 'page' in params:\n query_params.append(('page', params['page']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/user/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}'\n , 'GET', path_params, query_params, header_params, body=\n body_params, post_params=form_params, files=local_var_files,\n response_type='PageDataDevice', auth_settings=auth_settings,\n async_req=params.get('async_req'), _return_http_data_only=\n params.get('_return_http_data_only'), _preload_content=params.\n get('_preload_content', True), _request_timeout=params.get(\n '_request_timeout'), collection_formats=collection_formats)\n\n def save_device_using_post(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.save_device_using_post_with_http_info(device, **kwargs)\n else:\n data = self.save_device_using_post_with_http_info(device, **kwargs)\n return data\n\n def save_device_using_post_with_http_info(self, device, **kwargs):\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n all_params = ['device', 'access_token', 'entity_group_id']\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n params[key] = val\n del params['kwargs']\n if 'device' not in params or params['device'] is None:\n raise ValueError(\n 'Missing the required parameter `device` when calling `save_device_using_post`'\n )\n collection_formats = {}\n path_params = {}\n query_params = []\n if 'access_token' in params:\n query_params.append(('accessToken', params['access_token']))\n if 'entity_group_id' in params:\n query_params.append(('entityGroupId', params['entity_group_id']))\n header_params = {}\n form_params = []\n local_var_files = {}\n body_params = None\n if 'device' in params:\n body_params = params['device']\n header_params['Accept'] = self.api_client.select_header_accept(['*/*'])\n header_params['Content-Type'\n ] = self.api_client.select_header_content_type(['application/json']\n )\n auth_settings = ['X-Authorization']\n return self.api_client.call_api(\n '/api/device{?accessToken,entityGroupId}', 'POST', path_params,\n query_params, header_params, body=body_params, post_params=\n form_params, files=local_var_files, response_type='Device',\n auth_settings=auth_settings, async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n",
"step-5": "# coding: utf-8\n# Copyright 2020. ThingsBoard\n# #\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# #\n# http://www.apache.org/licenses/LICENSE-2.0\n# #\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nfrom __future__ import absolute_import\n\nimport re # noqa: F401\n\n# python 2 and python 3 compatibility library\nimport six\n\nfrom tb_rest_client.api.api_ce import DeviceControllerApi\n\n\nclass DeviceControllerApi(DeviceControllerApi):\n \"\"\"NOTE: This class is auto generated by the swagger code generator program.\n Ref: https://github.com/swagger-api/swagger-codegen\n \"\"\"\n\n def __init__(self, api_client=None):\n super(DeviceControllerApi, self).__init__(api_client)\n\n def claim_device_using_post(self, device_name, **kwargs): # noqa: E501\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.claim_device_using_post_with_http_info(device_name, **kwargs) # noqa: E501\n else:\n (data) = self.claim_device_using_post_with_http_info(device_name, **kwargs) # noqa: E501\n return data\n\n def claim_device_using_post_with_http_info(self, device_name, **kwargs): # noqa: E501\n \"\"\"claimDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.claim_device_using_post_with_http_info(device_name, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str device_name: deviceName (required)\n :param ClaimRequest claim_request: claimRequest\n :param str sub_customer_id: subCustomerId\n :return: DeferredResultResponseEntity\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['device_name', 'claim_request', 'sub_customer_id'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'device_name' is set\n if ('device_name' not in params or\n params['device_name'] is None):\n raise ValueError(\"Missing the required parameter `device_name` when calling `claim_device_using_post`\") # noqa: E501\n\n collection_formats = {}\n\n path_params = {}\n if 'device_name' in params:\n path_params['deviceName'] = params['device_name'] # noqa: E501\n\n query_params = []\n if 'sub_customer_id' in params:\n query_params.append(('subCustomerId', params['sub_customer_id'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n if 'claim_request' in params:\n body_params = params['claim_request']\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/customer/device/{deviceName}/claim{?subCustomerId}', 'POST',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='DeferredResultResponseEntity', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_customer_devices_using_get(self, customer_id, page_size, page, **kwargs): # noqa: E501\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, **kwargs) # noqa: E501\n else:\n (data) = self.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, **kwargs) # noqa: E501\n return data\n\n def get_customer_devices_using_get_with_http_info(self, customer_id, page_size, page, **kwargs): # noqa: E501\n \"\"\"getCustomerDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_customer_devices_using_get_with_http_info(customer_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str customer_id: customerId (required)\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['customer_id', 'page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'customer_id' is set\n if ('customer_id' not in params or\n params['customer_id'] is None):\n raise ValueError(\"Missing the required parameter `customer_id` when calling `get_customer_devices_using_get`\") # noqa: E501\n # verify the required parameter 'page_size' is set\n if ('page_size' not in params or\n params['page_size'] is None):\n raise ValueError(\"Missing the required parameter `page_size` when calling `get_customer_devices_using_get`\") # noqa: E501\n # verify the required parameter 'page' is set\n if ('page' not in params or\n params['page'] is None):\n raise ValueError(\"Missing the required parameter `page` when calling `get_customer_devices_using_get`\") # noqa: E501\n\n collection_formats = {}\n\n path_params = {}\n if 'customer_id' in params:\n path_params['customerId'] = params['customer_id'] # noqa: E501\n\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type'])) # noqa: E501\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search'])) # noqa: E501\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property'])) # noqa: E501\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order'])) # noqa: E501\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size'])) # noqa: E501\n if 'page' in params:\n query_params.append(('page', params['page'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/customer/{customerId}/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='PageDataDevice', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_devices_by_entity_group_id_using_get(self, entity_group_id, page_size, page, **kwargs): # noqa: E501\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, **kwargs) # noqa: E501\n else:\n (data) = self.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, **kwargs) # noqa: E501\n return data\n\n def get_devices_by_entity_group_id_using_get_with_http_info(self, entity_group_id, page_size, page, **kwargs): # noqa: E501\n \"\"\"getDevicesByEntityGroupId # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_devices_by_entity_group_id_using_get_with_http_info(entity_group_id, page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str entity_group_id: entityGroupId (required)\n :param str page_size: Page size (required)\n :param str page: Page (required)\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['entity_group_id', 'page_size', 'page', 'text_search', 'sort_property', 'sort_order'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'entity_group_id' is set\n if ('entity_group_id' not in params or\n params['entity_group_id'] is None):\n raise ValueError(\"Missing the required parameter `entity_group_id` when calling `get_devices_by_entity_group_id_using_get`\") # noqa: E501\n # verify the required parameter 'page_size' is set\n if ('page_size' not in params or\n params['page_size'] is None):\n raise ValueError(\"Missing the required parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`\") # noqa: E501\n # verify the required parameter 'page' is set\n if ('page' not in params or\n params['page'] is None):\n raise ValueError(\"Missing the required parameter `page` when calling `get_devices_by_entity_group_id_using_get`\") # noqa: E501\n\n if 'page_size' in params and params['page_size'] < 1.0: # noqa: E501\n raise ValueError(\"Invalid value for parameter `page_size` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `1.0`\") # noqa: E501\n if 'page' in params and params['page'] < 0.0: # noqa: E501\n raise ValueError(\"Invalid value for parameter `page` when calling `get_devices_by_entity_group_id_using_get`, must be a value greater than or equal to `0.0`\") # noqa: E501\n collection_formats = {}\n\n path_params = {}\n if 'entity_group_id' in params:\n path_params['entityGroupId'] = params['entity_group_id'] # noqa: E501\n\n query_params = []\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search'])) # noqa: E501\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property'])) # noqa: E501\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order'])) # noqa: E501\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size'])) # noqa: E501\n if 'page' in params:\n query_params.append(('page', params['page'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/entityGroup/{entityGroupId}/devices{?textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='PageDataDevice', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_tenant_devices_using_get(self, page_size, page, **kwargs): # noqa: E501\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_tenant_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501\n else:\n (data) = self.get_tenant_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501\n return data\n\n def get_tenant_devices_using_get_with_http_info(self, page_size, page, **kwargs): # noqa: E501\n \"\"\"getTenantDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_tenant_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'page_size' is set\n if ('page_size' not in params or\n params['page_size'] is None):\n raise ValueError(\"Missing the required parameter `page_size` when calling `get_tenant_devices_using_get`\") # noqa: E501\n # verify the required parameter 'page' is set\n if ('page' not in params or\n params['page'] is None):\n raise ValueError(\"Missing the required parameter `page` when calling `get_tenant_devices_using_get`\") # noqa: E501\n\n collection_formats = {}\n\n path_params = {}\n\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type'])) # noqa: E501\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search'])) # noqa: E501\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property'])) # noqa: E501\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order'])) # noqa: E501\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size'])) # noqa: E501\n if 'page' in params:\n query_params.append(('page', params['page'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/tenant/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='PageDataDevice', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def get_user_devices_using_get(self, page_size, page, **kwargs): # noqa: E501\n \"\"\"getUserDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_user_devices_using_get(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.get_user_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501\n else:\n (data) = self.get_user_devices_using_get_with_http_info(page_size, page, **kwargs) # noqa: E501\n return data\n\n def get_user_devices_using_get_with_http_info(self, page_size, page, **kwargs): # noqa: E501\n \"\"\"getUserDevices # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.get_user_devices_using_get_with_http_info(page_size, page, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param str page_size: pageSize (required)\n :param str page: page (required)\n :param str type: type\n :param str text_search: textSearch\n :param str sort_property: sortProperty\n :param str sort_order: sortOrder\n :return: PageDataDevice\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['page_size', 'page', 'type', 'text_search', 'sort_property', 'sort_order'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'page_size' is set\n if ('page_size' not in params or\n params['page_size'] is None):\n raise ValueError(\"Missing the required parameter `page_size` when calling `get_user_devices_using_get`\") # noqa: E501\n # verify the required parameter 'page' is set\n if ('page' not in params or\n params['page'] is None):\n raise ValueError(\"Missing the required parameter `page` when calling `get_user_devices_using_get`\") # noqa: E501\n\n collection_formats = {}\n\n path_params = {}\n\n query_params = []\n if 'type' in params:\n query_params.append(('type', params['type'])) # noqa: E501\n if 'text_search' in params:\n query_params.append(('textSearch', params['text_search'])) # noqa: E501\n if 'sort_property' in params:\n query_params.append(('sortProperty', params['sort_property'])) # noqa: E501\n if 'sort_order' in params:\n query_params.append(('sortOrder', params['sort_order'])) # noqa: E501\n if 'page_size' in params:\n query_params.append(('pageSize', params['page_size'])) # noqa: E501\n if 'page' in params:\n query_params.append(('page', params['page'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/user/devices{?type,textSearch,sortProperty,sortOrder,pageSize,page}', 'GET',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='PageDataDevice', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n\n def save_device_using_post(self, device, **kwargs): # noqa: E501\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n kwargs['_return_http_data_only'] = True\n if kwargs.get('async_req'):\n return self.save_device_using_post_with_http_info(device, **kwargs) # noqa: E501\n else:\n (data) = self.save_device_using_post_with_http_info(device, **kwargs) # noqa: E501\n return data\n\n def save_device_using_post_with_http_info(self, device, **kwargs): # noqa: E501\n \"\"\"saveDevice # noqa: E501\n\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api_pe.save_device_using_post_with_http_info(device, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :param Device device: device (required)\n :param str access_token: accessToken\n :param str entity_group_id: entityGroupId\n :return: Device\n If the method is called asynchronously,\n returns the request thread.\n \"\"\"\n\n all_params = ['device', 'access_token', 'entity_group_id'] # noqa: E501\n all_params.append('async_req')\n all_params.append('_return_http_data_only')\n all_params.append('_preload_content')\n all_params.append('_request_timeout')\n\n params = locals()\n for key, val in six.iteritems(params['kwargs']):\n \n params[key] = val\n del params['kwargs']\n # verify the required parameter 'device' is set\n if ('device' not in params or\n params['device'] is None):\n raise ValueError(\"Missing the required parameter `device` when calling `save_device_using_post`\") # noqa: E501\n\n collection_formats = {}\n\n path_params = {}\n\n query_params = []\n if 'access_token' in params:\n query_params.append(('accessToken', params['access_token'])) # noqa: E501\n if 'entity_group_id' in params:\n query_params.append(('entityGroupId', params['entity_group_id'])) # noqa: E501\n\n header_params = {}\n\n form_params = []\n local_var_files = {}\n\n body_params = None\n if 'device' in params:\n body_params = params['device']\n # HTTP header `Accept`\n header_params['Accept'] = self.api_client.select_header_accept(\n ['*/*']) # noqa: E501\n\n # HTTP header `Content-Type`\n header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501\n ['application/json']) # noqa: E501\n\n # Authentication setting\n auth_settings = ['X-Authorization'] # noqa: E501\n\n return self.api_client.call_api(\n '/api/device{?accessToken,entityGroupId}', 'POST',\n path_params,\n query_params,\n header_params,\n body=body_params,\n post_params=form_params,\n files=local_var_files,\n response_type='Device', # noqa: E501\n auth_settings=auth_settings,\n async_req=params.get('async_req'),\n _return_http_data_only=params.get('_return_http_data_only'),\n _preload_content=params.get('_preload_content', True),\n _request_timeout=params.get('_request_timeout'),\n collection_formats=collection_formats)\n",
"step-ids": [
10,
11,
13,
14,
17
]
}
|
[
10,
11,
13,
14,
17
] |
class Area :
def circle(self):
rad = int(input("Enter the radius:"))
area = (22/7)*(rad**2)
print("Area is :" , area , "cm square")
def square(self):
side = int(input("Enter the length of a side:"))
area = side**2
print("Area is :" , area , "cm square")
def rect(self):
print("Enter length and breadth of rectangle:")
le = int(input())
br = int(input())
area = le * br
print("Area is :" , area , "cm square")
def cube(self):
side = int(input("Enter length of a side:"))
area = 6 * (side**2)
print("Area is :" , area , "cm square")
def cuboid(self):
print("Enter length , breadth and height :")
le = int(input())
br= int(input())
he= int(input())
area = 2*(le*br + br*he + he*le)
print("Area is :" , area , "cm square")
def cylinder(self):
rad = int(input("Enter the radius:"))
he = int(input("Enter the height:"))
area = (22/7)*(rad**2)*(he)
print("Area is :" , area , "cm square")
shape = Area()
shape.circle()
shape.square()
shape.rect()
shape.cube()
shape.cuboid()
shape.cylinder()
|
normal
|
{
"blob_id": "4f36c7e98c54d38aaef9f2ebdafd0c34a157fcd7",
"index": 8268,
"step-1": "class Area:\n <mask token>\n\n def square(self):\n side = int(input('Enter the length of a side:'))\n area = side ** 2\n print('Area is :', area, 'cm square')\n\n def rect(self):\n print('Enter length and breadth of rectangle:')\n le = int(input())\n br = int(input())\n area = le * br\n print('Area is :', area, 'cm square')\n <mask token>\n <mask token>\n\n def cylinder(self):\n rad = int(input('Enter the radius:'))\n he = int(input('Enter the height:'))\n area = 22 / 7 * rad ** 2 * he\n print('Area is :', area, 'cm square')\n\n\n<mask token>\n",
"step-2": "class Area:\n <mask token>\n\n def square(self):\n side = int(input('Enter the length of a side:'))\n area = side ** 2\n print('Area is :', area, 'cm square')\n\n def rect(self):\n print('Enter length and breadth of rectangle:')\n le = int(input())\n br = int(input())\n area = le * br\n print('Area is :', area, 'cm square')\n\n def cube(self):\n side = int(input('Enter length of a side:'))\n area = 6 * side ** 2\n print('Area is :', area, 'cm square')\n <mask token>\n\n def cylinder(self):\n rad = int(input('Enter the radius:'))\n he = int(input('Enter the height:'))\n area = 22 / 7 * rad ** 2 * he\n print('Area is :', area, 'cm square')\n\n\n<mask token>\n",
"step-3": "class Area:\n\n def circle(self):\n rad = int(input('Enter the radius:'))\n area = 22 / 7 * rad ** 2\n print('Area is :', area, 'cm square')\n\n def square(self):\n side = int(input('Enter the length of a side:'))\n area = side ** 2\n print('Area is :', area, 'cm square')\n\n def rect(self):\n print('Enter length and breadth of rectangle:')\n le = int(input())\n br = int(input())\n area = le * br\n print('Area is :', area, 'cm square')\n\n def cube(self):\n side = int(input('Enter length of a side:'))\n area = 6 * side ** 2\n print('Area is :', area, 'cm square')\n <mask token>\n\n def cylinder(self):\n rad = int(input('Enter the radius:'))\n he = int(input('Enter the height:'))\n area = 22 / 7 * rad ** 2 * he\n print('Area is :', area, 'cm square')\n\n\n<mask token>\n",
"step-4": "class Area:\n\n def circle(self):\n rad = int(input('Enter the radius:'))\n area = 22 / 7 * rad ** 2\n print('Area is :', area, 'cm square')\n\n def square(self):\n side = int(input('Enter the length of a side:'))\n area = side ** 2\n print('Area is :', area, 'cm square')\n\n def rect(self):\n print('Enter length and breadth of rectangle:')\n le = int(input())\n br = int(input())\n area = le * br\n print('Area is :', area, 'cm square')\n\n def cube(self):\n side = int(input('Enter length of a side:'))\n area = 6 * side ** 2\n print('Area is :', area, 'cm square')\n\n def cuboid(self):\n print('Enter length , breadth and height :')\n le = int(input())\n br = int(input())\n he = int(input())\n area = 2 * (le * br + br * he + he * le)\n print('Area is :', area, 'cm square')\n\n def cylinder(self):\n rad = int(input('Enter the radius:'))\n he = int(input('Enter the height:'))\n area = 22 / 7 * rad ** 2 * he\n print('Area is :', area, 'cm square')\n\n\n<mask token>\nshape.circle()\nshape.square()\nshape.rect()\nshape.cube()\nshape.cuboid()\nshape.cylinder()\n",
"step-5": "class Area :\n def circle(self):\n rad = int(input(\"Enter the radius:\"))\n area = (22/7)*(rad**2)\n print(\"Area is :\" , area , \"cm square\")\n \n \n def square(self):\n side = int(input(\"Enter the length of a side:\"))\n area = side**2\n print(\"Area is :\" , area , \"cm square\")\n \n def rect(self):\n print(\"Enter length and breadth of rectangle:\")\n le = int(input())\n br = int(input())\n area = le * br\n print(\"Area is :\" , area , \"cm square\")\n \n def cube(self):\n side = int(input(\"Enter length of a side:\"))\n area = 6 * (side**2)\n print(\"Area is :\" , area , \"cm square\")\n \n def cuboid(self):\n print(\"Enter length , breadth and height :\")\n le = int(input())\n br= int(input())\n he= int(input())\n area = 2*(le*br + br*he + he*le)\n print(\"Area is :\" , area , \"cm square\")\n \n def cylinder(self):\n rad = int(input(\"Enter the radius:\"))\n he = int(input(\"Enter the height:\"))\n area = (22/7)*(rad**2)*(he)\n print(\"Area is :\" , area , \"cm square\")\n \n \nshape = Area()\n\nshape.circle()\nshape.square()\nshape.rect()\nshape.cube()\nshape.cuboid()\nshape.cylinder()",
"step-ids": [
4,
5,
6,
8,
10
]
}
|
[
4,
5,
6,
8,
10
] |
import os
import pubmed_parser as pp
nlpPath = "/Users/kapmayn/Desktop/nlp"
articlesFolderPath = nlpPath + "/articles"
abstractsFilePath = nlpPath + "/abstracts.txt"
articlesFileNameList = os.listdir(articlesFolderPath)
articlesFileNameList(reverse = True)
resultFile = open(abstractsFilePath, 'w')
for fileName in articlesFileNameList:
print(fileName)
dictOut = pp.parse_medline_xml(articlesFolderPath + "/" + fileName)
for item in dictOut:
resultFile.write((item['abstract'] + '\n'))
|
normal
|
{
"blob_id": "32f9b5c32acbb6411fe6ab99616d8459acfd7c74",
"index": 719,
"step-1": "<mask token>\n",
"step-2": "<mask token>\narticlesFileNameList(reverse=True)\n<mask token>\nfor fileName in articlesFileNameList:\n print(fileName)\n dictOut = pp.parse_medline_xml(articlesFolderPath + '/' + fileName)\n for item in dictOut:\n resultFile.write(item['abstract'] + '\\n')\n",
"step-3": "<mask token>\nnlpPath = '/Users/kapmayn/Desktop/nlp'\narticlesFolderPath = nlpPath + '/articles'\nabstractsFilePath = nlpPath + '/abstracts.txt'\narticlesFileNameList = os.listdir(articlesFolderPath)\narticlesFileNameList(reverse=True)\nresultFile = open(abstractsFilePath, 'w')\nfor fileName in articlesFileNameList:\n print(fileName)\n dictOut = pp.parse_medline_xml(articlesFolderPath + '/' + fileName)\n for item in dictOut:\n resultFile.write(item['abstract'] + '\\n')\n",
"step-4": "import os\nimport pubmed_parser as pp\nnlpPath = '/Users/kapmayn/Desktop/nlp'\narticlesFolderPath = nlpPath + '/articles'\nabstractsFilePath = nlpPath + '/abstracts.txt'\narticlesFileNameList = os.listdir(articlesFolderPath)\narticlesFileNameList(reverse=True)\nresultFile = open(abstractsFilePath, 'w')\nfor fileName in articlesFileNameList:\n print(fileName)\n dictOut = pp.parse_medline_xml(articlesFolderPath + '/' + fileName)\n for item in dictOut:\n resultFile.write(item['abstract'] + '\\n')\n",
"step-5": "import os\nimport pubmed_parser as pp\n\nnlpPath = \"/Users/kapmayn/Desktop/nlp\"\narticlesFolderPath = nlpPath + \"/articles\"\nabstractsFilePath = nlpPath + \"/abstracts.txt\"\n\narticlesFileNameList = os.listdir(articlesFolderPath)\narticlesFileNameList(reverse = True)\nresultFile = open(abstractsFilePath, 'w')\n\nfor fileName in articlesFileNameList:\n\tprint(fileName)\n\tdictOut = pp.parse_medline_xml(articlesFolderPath + \"/\" + fileName)\n\tfor item in dictOut:\n\t\tresultFile.write((item['abstract'] + '\\n'))",
"step-ids": [
0,
1,
2,
3,
4
]
}
|
[
0,
1,
2,
3,
4
] |
from pymongo import MongoClient
from datetime import datetime
import sys
import requests
import urllib
import json
import xml.etree.ElementTree as ET
import xmltodict
import pandas
from lxml import etree
from bson.json_util import dumps
bornTables = pandas.read_html("http://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8700&ymt=10500&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld4=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,15,&rdm=ceppbtql")
bornTable = bornTables[1]
deadTables = pandas.read_html("http://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8700&ymt=10500&kind=21&type=1&funid=c0120201&cycle=4&outmode=0&compmode=0&outkind=1&fld4=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,14,&rdm=hf6pfAlV")
deadTable = deadTables[1]
res = urllib.urlopen("https://www.dgbas.gov.tw/public/data/open/localstat/009-%A6U%BF%A4%A5%AB%A7O%A5%AD%A7%A1%A8C%A4%E1%A9%D2%B1o%A6%AC%A4J%C1%60%ADp.xml")
sa = res.read()
o = xmltodict.parse(sa)
salary = json.dumps(o)
salary = salary.decode('unicode-escape')
if __name__ == '__main__':
client = MongoClient('localhost',27017)
db = client['CC']
coll = db['test']
data = ''
for i in range(1998,2017):
data += '{"Year":"'+str(i)+'"'
for j in range(1,22):
data += ',"'+bornTable[j][1]+'":"'+bornTable[j][i-1996]+'"'
data += '}'
coll.insert_one(json.loads(data))
data = ''
db = client['CC']
coll = db['dead']
data = ''
for i in range(1998,2017):
data += '{"Year":"'+str(i)+'"'
for j in range(1,22):
data += ',"'+deadTable[j][1]+'":"'+deadTable[j][i-1996]+'"'
data += '}'
coll.insert_one(json.loads(data))
data = ''
db = client['CC']
coll = db['salary']
coll.insert_one(json.loads(salary))
born = '['
many_docs = coll.find()
for doc in many_docs:
temp = doc
temp = dumps(temp)
born += temp.decode('unicode-escape')
born += ']'
print born
# many_docs = coll.find()
# for doc in many_docs:
# salary = doc
#
# from bson.json_util import dumps
#
# salary = dumps(salary)
# salary = salary.decode('unicode-escape')
#
# print salary
|
normal
|
{
"blob_id": "7deaee28674c465694c348c21e87addbcc8ea923",
"index": 8237,
"step-1": "from pymongo import MongoClient\nfrom datetime import datetime\nimport sys\nimport requests\nimport urllib\nimport json\nimport xml.etree.ElementTree as ET\nimport xmltodict\nimport pandas\nfrom lxml import etree\nfrom bson.json_util import dumps\n\nbornTables = pandas.read_html(\"http://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8700&ymt=10500&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld4=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,15,&rdm=ceppbtql\")\n\nbornTable = bornTables[1]\n\ndeadTables = pandas.read_html(\"http://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8700&ymt=10500&kind=21&type=1&funid=c0120201&cycle=4&outmode=0&compmode=0&outkind=1&fld4=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,14,&rdm=hf6pfAlV\")\n\ndeadTable = deadTables[1]\n\nres = urllib.urlopen(\"https://www.dgbas.gov.tw/public/data/open/localstat/009-%A6U%BF%A4%A5%AB%A7O%A5%AD%A7%A1%A8C%A4%E1%A9%D2%B1o%A6%AC%A4J%C1%60%ADp.xml\")\n\nsa = res.read()\no = xmltodict.parse(sa)\nsalary = json.dumps(o)\nsalary = salary.decode('unicode-escape')\n\n\nif __name__ == '__main__':\n\tclient = MongoClient('localhost',27017) \n\tdb = client['CC']\n\tcoll = db['test']\n\n\tdata = ''\n\tfor i in range(1998,2017):\n\t\tdata += '{\"Year\":\"'+str(i)+'\"'\n\t\tfor j in range(1,22):\n\t\t\tdata += ',\"'+bornTable[j][1]+'\":\"'+bornTable[j][i-1996]+'\"'\n\t\tdata += '}'\n\t\tcoll.insert_one(json.loads(data)) \n\t\tdata = ''\n\t\t\n\tdb = client['CC']\n\tcoll = db['dead']\n\t\n\tdata = ''\n\tfor i in range(1998,2017):\n\t\tdata += '{\"Year\":\"'+str(i)+'\"'\n\t\tfor j in range(1,22):\n\t\t\tdata += ',\"'+deadTable[j][1]+'\":\"'+deadTable[j][i-1996]+'\"'\n\t\tdata += '}'\n\t\tcoll.insert_one(json.loads(data))\n\t\tdata = ''\n\t\n\tdb = client['CC']\n\tcoll = db['salary']\n\t\n\tcoll.insert_one(json.loads(salary))\n\n\tborn = '['\n\tmany_docs = coll.find()\n\tfor doc in many_docs:\n\t\ttemp = doc\n\t\ttemp = dumps(temp)\n\t\tborn += temp.decode('unicode-escape')\n\tborn += ']'\n\tprint born\n\n\t\n#\tmany_docs = coll.find()\n#\tfor doc in many_docs:\n#\t\tsalary = doc\n#\t\n#\tfrom bson.json_util import dumps\n#\t\n#\tsalary = dumps(salary)\n#\tsalary = salary.decode('unicode-escape')\n#\t\n#\tprint salary\n\t\t\n\t",
"step-2": null,
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0
]
}
|
[
0
] |
import giraffe.configuration.common_testing_artifactrs as commons
from giraffe.business_logic.ingestion_manger import IngestionManager
from redis import Redis
def test_parse_redis_key(config_helper, ingestion_manager):
im = ingestion_manager
job_name = config_helper.nodes_ingestion_operation
operation = config_helper.nodes_ingestion_operation
labels = config_helper.test_labels
parsed: IngestionManager.key_elements_type = im.parse_redis_key(
key=f'{job_name}{config_helper.key_separator}{operation}{config_helper.key_separator}{",".join(labels)}')
assert parsed.job_name == job_name
assert parsed.operation == operation
assert set(parsed.arguments) == set(labels)
def test_publish_job(config_helper, redis_driver, ingestion_manager, nodes, edges, logger, redis_db):
r: Redis = redis_driver
im: IngestionManager = ingestion_manager
commons.purge_redis_database(redis_db=redis_db, log=logger)
# Populate nodes
im.publish_job(job_name=config_helper.test_job_name,
operation=config_helper.nodes_ingestion_operation,
operation_arguments=','.join(config_helper.test_labels),
items=[str(value) for value in nodes])
# Populate edges
im.publish_job(job_name=config_helper.test_job_name,
operation=config_helper.edges_ingestion_operation,
operation_arguments=f'{config_helper.test_edge_type},{config_helper.test_labels[0]}',
items=[str(value) for value in edges])
keys = r.keys(pattern=f'{config_helper.test_job_name}*')
assert len(keys) == 2
node_keys = r.keys(pattern=f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.nodes_ingestion_operation}{config_helper.key_separator}*')
assert len(node_keys) == 1
edges_keys = r.keys(pattern=f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.edges_ingestion_operation}{config_helper.key_separator}*')
assert len(edges_keys) == 1
nodes_key = node_keys[0]
edges_key = edges_keys[0]
num_stored_nodes = r.scard(name=nodes_key)
assert num_stored_nodes == len(nodes)
num_stored_edges = r.scard(name=edges_key)
assert num_stored_edges == len(edges)
def test_process_job(config_helper, ingestion_manager, redis_db, logger, neo):
commons.purge_redis_database(redis_db=redis_db, log=logger)
commons.purge_neo4j_database(log=logger, neo=neo)
commons.init_redis_test_data(im=ingestion_manager)
im = ingestion_manager
im.process_redis_content(translation_id=config_helper.test_job_name, request_id='unit-testing')
query = f'MATCH (:{config_helper.test_labels[0]}) RETURN COUNT(*) AS count'
count = neo.pull_query(query=query).value()[0]
assert count == config_helper.number_of_test_nodes
query = f'MATCH ()-[:{config_helper.test_edge_type}]->() RETURN COUNT(*) AS count'
count = neo.pull_query(query=query).value()[0]
assert count == config_helper.number_of_test_edges
|
normal
|
{
"blob_id": "13451352e8dcdfe64771f9fc188b13a31b8109f5",
"index": 4555,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef test_parse_redis_key(config_helper, ingestion_manager):\n im = ingestion_manager\n job_name = config_helper.nodes_ingestion_operation\n operation = config_helper.nodes_ingestion_operation\n labels = config_helper.test_labels\n parsed: IngestionManager.key_elements_type = im.parse_redis_key(key=\n f\"{job_name}{config_helper.key_separator}{operation}{config_helper.key_separator}{','.join(labels)}\"\n )\n assert parsed.job_name == job_name\n assert parsed.operation == operation\n assert set(parsed.arguments) == set(labels)\n\n\n<mask token>\n\n\ndef test_process_job(config_helper, ingestion_manager, redis_db, logger, neo):\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n commons.purge_neo4j_database(log=logger, neo=neo)\n commons.init_redis_test_data(im=ingestion_manager)\n im = ingestion_manager\n im.process_redis_content(translation_id=config_helper.test_job_name,\n request_id='unit-testing')\n query = f'MATCH (:{config_helper.test_labels[0]}) RETURN COUNT(*) AS count'\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_nodes\n query = (\n f'MATCH ()-[:{config_helper.test_edge_type}]->() RETURN COUNT(*) AS count'\n )\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_edges\n",
"step-3": "<mask token>\n\n\ndef test_parse_redis_key(config_helper, ingestion_manager):\n im = ingestion_manager\n job_name = config_helper.nodes_ingestion_operation\n operation = config_helper.nodes_ingestion_operation\n labels = config_helper.test_labels\n parsed: IngestionManager.key_elements_type = im.parse_redis_key(key=\n f\"{job_name}{config_helper.key_separator}{operation}{config_helper.key_separator}{','.join(labels)}\"\n )\n assert parsed.job_name == job_name\n assert parsed.operation == operation\n assert set(parsed.arguments) == set(labels)\n\n\ndef test_publish_job(config_helper, redis_driver, ingestion_manager, nodes,\n edges, logger, redis_db):\n r: Redis = redis_driver\n im: IngestionManager = ingestion_manager\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n im.publish_job(job_name=config_helper.test_job_name, operation=\n config_helper.nodes_ingestion_operation, operation_arguments=','.\n join(config_helper.test_labels), items=[str(value) for value in nodes])\n im.publish_job(job_name=config_helper.test_job_name, operation=\n config_helper.edges_ingestion_operation, operation_arguments=\n f'{config_helper.test_edge_type},{config_helper.test_labels[0]}',\n items=[str(value) for value in edges])\n keys = r.keys(pattern=f'{config_helper.test_job_name}*')\n assert len(keys) == 2\n node_keys = r.keys(pattern=\n f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.nodes_ingestion_operation}{config_helper.key_separator}*'\n )\n assert len(node_keys) == 1\n edges_keys = r.keys(pattern=\n f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.edges_ingestion_operation}{config_helper.key_separator}*'\n )\n assert len(edges_keys) == 1\n nodes_key = node_keys[0]\n edges_key = edges_keys[0]\n num_stored_nodes = r.scard(name=nodes_key)\n assert num_stored_nodes == len(nodes)\n num_stored_edges = r.scard(name=edges_key)\n assert num_stored_edges == len(edges)\n\n\ndef test_process_job(config_helper, ingestion_manager, redis_db, logger, neo):\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n commons.purge_neo4j_database(log=logger, neo=neo)\n commons.init_redis_test_data(im=ingestion_manager)\n im = ingestion_manager\n im.process_redis_content(translation_id=config_helper.test_job_name,\n request_id='unit-testing')\n query = f'MATCH (:{config_helper.test_labels[0]}) RETURN COUNT(*) AS count'\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_nodes\n query = (\n f'MATCH ()-[:{config_helper.test_edge_type}]->() RETURN COUNT(*) AS count'\n )\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_edges\n",
"step-4": "import giraffe.configuration.common_testing_artifactrs as commons\nfrom giraffe.business_logic.ingestion_manger import IngestionManager\nfrom redis import Redis\n\n\ndef test_parse_redis_key(config_helper, ingestion_manager):\n im = ingestion_manager\n job_name = config_helper.nodes_ingestion_operation\n operation = config_helper.nodes_ingestion_operation\n labels = config_helper.test_labels\n parsed: IngestionManager.key_elements_type = im.parse_redis_key(key=\n f\"{job_name}{config_helper.key_separator}{operation}{config_helper.key_separator}{','.join(labels)}\"\n )\n assert parsed.job_name == job_name\n assert parsed.operation == operation\n assert set(parsed.arguments) == set(labels)\n\n\ndef test_publish_job(config_helper, redis_driver, ingestion_manager, nodes,\n edges, logger, redis_db):\n r: Redis = redis_driver\n im: IngestionManager = ingestion_manager\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n im.publish_job(job_name=config_helper.test_job_name, operation=\n config_helper.nodes_ingestion_operation, operation_arguments=','.\n join(config_helper.test_labels), items=[str(value) for value in nodes])\n im.publish_job(job_name=config_helper.test_job_name, operation=\n config_helper.edges_ingestion_operation, operation_arguments=\n f'{config_helper.test_edge_type},{config_helper.test_labels[0]}',\n items=[str(value) for value in edges])\n keys = r.keys(pattern=f'{config_helper.test_job_name}*')\n assert len(keys) == 2\n node_keys = r.keys(pattern=\n f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.nodes_ingestion_operation}{config_helper.key_separator}*'\n )\n assert len(node_keys) == 1\n edges_keys = r.keys(pattern=\n f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.edges_ingestion_operation}{config_helper.key_separator}*'\n )\n assert len(edges_keys) == 1\n nodes_key = node_keys[0]\n edges_key = edges_keys[0]\n num_stored_nodes = r.scard(name=nodes_key)\n assert num_stored_nodes == len(nodes)\n num_stored_edges = r.scard(name=edges_key)\n assert num_stored_edges == len(edges)\n\n\ndef test_process_job(config_helper, ingestion_manager, redis_db, logger, neo):\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n commons.purge_neo4j_database(log=logger, neo=neo)\n commons.init_redis_test_data(im=ingestion_manager)\n im = ingestion_manager\n im.process_redis_content(translation_id=config_helper.test_job_name,\n request_id='unit-testing')\n query = f'MATCH (:{config_helper.test_labels[0]}) RETURN COUNT(*) AS count'\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_nodes\n query = (\n f'MATCH ()-[:{config_helper.test_edge_type}]->() RETURN COUNT(*) AS count'\n )\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_edges\n",
"step-5": "import giraffe.configuration.common_testing_artifactrs as commons\nfrom giraffe.business_logic.ingestion_manger import IngestionManager\nfrom redis import Redis\n\n\ndef test_parse_redis_key(config_helper, ingestion_manager):\n im = ingestion_manager\n job_name = config_helper.nodes_ingestion_operation\n operation = config_helper.nodes_ingestion_operation\n labels = config_helper.test_labels\n parsed: IngestionManager.key_elements_type = im.parse_redis_key(\n key=f'{job_name}{config_helper.key_separator}{operation}{config_helper.key_separator}{\",\".join(labels)}')\n assert parsed.job_name == job_name\n assert parsed.operation == operation\n assert set(parsed.arguments) == set(labels)\n\n\ndef test_publish_job(config_helper, redis_driver, ingestion_manager, nodes, edges, logger, redis_db):\n r: Redis = redis_driver\n im: IngestionManager = ingestion_manager\n\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n\n # Populate nodes\n im.publish_job(job_name=config_helper.test_job_name,\n operation=config_helper.nodes_ingestion_operation,\n operation_arguments=','.join(config_helper.test_labels),\n items=[str(value) for value in nodes])\n\n # Populate edges\n im.publish_job(job_name=config_helper.test_job_name,\n operation=config_helper.edges_ingestion_operation,\n operation_arguments=f'{config_helper.test_edge_type},{config_helper.test_labels[0]}',\n items=[str(value) for value in edges])\n\n keys = r.keys(pattern=f'{config_helper.test_job_name}*')\n assert len(keys) == 2\n node_keys = r.keys(pattern=f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.nodes_ingestion_operation}{config_helper.key_separator}*')\n assert len(node_keys) == 1\n edges_keys = r.keys(pattern=f'{config_helper.test_job_name}{config_helper.key_separator}{config_helper.edges_ingestion_operation}{config_helper.key_separator}*')\n assert len(edges_keys) == 1\n\n nodes_key = node_keys[0]\n edges_key = edges_keys[0]\n\n num_stored_nodes = r.scard(name=nodes_key)\n assert num_stored_nodes == len(nodes)\n num_stored_edges = r.scard(name=edges_key)\n assert num_stored_edges == len(edges)\n\n\ndef test_process_job(config_helper, ingestion_manager, redis_db, logger, neo):\n commons.purge_redis_database(redis_db=redis_db, log=logger)\n commons.purge_neo4j_database(log=logger, neo=neo)\n commons.init_redis_test_data(im=ingestion_manager)\n im = ingestion_manager\n im.process_redis_content(translation_id=config_helper.test_job_name, request_id='unit-testing')\n query = f'MATCH (:{config_helper.test_labels[0]}) RETURN COUNT(*) AS count'\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_nodes\n query = f'MATCH ()-[:{config_helper.test_edge_type}]->() RETURN COUNT(*) AS count'\n count = neo.pull_query(query=query).value()[0]\n assert count == config_helper.number_of_test_edges\n",
"step-ids": [
0,
2,
3,
4,
5
]
}
|
[
0,
2,
3,
4,
5
] |
"'''\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 WavyCloud\n\nPermission is hereby granted, free (...TRUNCATED) |
normal
| {"blob_id":"1947bd280234189ed35277c449cd708a204ea7a4","index":6651,"step-1":"<mask token>\n\n\ndef c(...TRUNCATED) |
[
11,
12,
16,
19,
20
] |
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom tp_global import *\nfrom cgibase import cgibase\(...TRUNCATED) |
normal
| {"blob_id":"5282e9a9e87fd7fd6053f816048f371fbe190046","index":5650,"step-1":"<mask token>\n\n\nclass(...TRUNCATED) |
[
6,
9,
10,
11,
13
] |
"\nimport sys\nimport datetime\n\ntraining = False if (sys.argv[1]=='0') else True\n\ndef read_file((...TRUNCATED) |
normal
| {"blob_id":"dd4892c5a0b675d1c97fb91a5ca8115801a2bbca","index":9034,"step-1":"\nimport sys\nimport da(...TRUNCATED) |
[
0
] |
"from . import views\nfrom django.urls import path, re_path\n\napp_name = \"blogs\"\n\nurlpatterns =(...TRUNCATED) |
normal
| {"blob_id":"d73491d6673abdabad85176c5f75a191995c806d","index":1260,"step-1":"<mask token>\n","step-2(...TRUNCATED) |
[
0,
1,
2,
3
] |
"processed_lines = []\nfor line in open('9.in'):\n if line:\n processing_pattern = False\n(...TRUNCATED) |
normal
| {"blob_id":"3605f46da25eb98767ca8d7248beaa07572d3171","index":644,"step-1":"<mask token>\n","step-2"(...TRUNCATED) |
[
0,
1,
2
] |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 2