Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Got an unexpected keyword argument 'type' to method get_customer_device_infos_using_get #165

Open
soelgary opened this issue Sep 5, 2024 · 0 comments

Comments

@soelgary
Copy link

soelgary commented Sep 5, 2024

Hey folks,

I found a bug when trying to list all the devices for my customer. The get_customer_device_infos is passing the type kwarg to get_customer_device_infos_using_get. But get_customer_device_infos_using_get doesn't support type.

Heres a working example:

url = "https://thingsboard.cloud"
username = "..."
password = "..."
customer_id = "..."

with RestClientPE(url) as rest_client:
    rest_client.login(username, password)
    devices = rest_client.get_customer_device_infos(
        customer_id=customer_id,
        page_size=100,
        page=0,
    )

Full stack trace:

Traceback (most recent call last):
  File "/Users/garysoeller/dev/src3/mason-web/manage.py", line 22, in <module>
    main()
  File "/Users/garysoeller/dev/src3/mason-web/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/garysoeller/dev/src3/mason-web/core/management/commands/tb.py", line 16, in handle
    devices = rest_client.get_customer_device_infos(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/tb_rest_client/rest_client_pe.py", line 1621, in get_customer_device_infos
    return self.device_controller.get_customer_device_infos_using_get(customer_id=customer_id, page_size=page_size,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/tb_rest_client/api/api_pe/device_controller_api.py", line 817, in get_customer_device_infos_using_get
    (data) = self.get_customer_device_infos_using_get_with_http_info(customer_id, page_size, page, **kwargs)  # noqa: E501
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/garysoeller/Library/Caches/pypoetry/virtualenvs/mason-web-tvi22vCl-py3.12/lib/python3.12/site-packages/tb_rest_client/api/api_pe/device_controller_api.py", line 853, in get_customer_device_infos_using_get_with_http_info
    raise TypeError(
TypeError: Got an unexpected keyword argument 'type' to method get_customer_device_infos_using_get

I'm using version 3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant