Skip to content

Devices

class _incydr_sdk.devices.client.DevicesV1(parent)

Client for /v1/devices endpoints.

Usage example:

>>> import incydr
>>> client = incydr.Client(**kwargs)
>>> client.devices.v1.get_page()
get_device(self, device_id)

Get a single device.

Parameters:

  • device_id: str (required) - The unique ID for the device.

Returns: A Device object representing the device.

get_page(self, active=None, blocked=None, page_num=1, page_size=None, sort_dir=, sort_key=)

Get a page of devices.

Filter results by passing the appropriate parameters:

Parameters:

  • active: bool | None - When true, return only active devices. When false, return only inactive devices. Defaults to returning both.
  • blocked: bool | None - When true, return only blocked devices. When false, return only unblocked devices. Defaults to returning both.
  • page_num: int - Page number for results, starting at 1.
  • page_size: int - Max number of results to return per page.
  • sort_dir: SortDirection - 'asc' or 'desc'. The direction in which to sort the response based on the corresponding key. Defaults to 'asc'.
  • sort_key: SortKeys - One or more values on which the response will be sorted. Defaults to device name.

Returns: A 'DevicesPage' object.

iter_all(self, active=None, blocked=None, page_size=None, sort_dir=, sort_key=)

Iterate over all devices.

Accepts the same parameters as .get_page() excepting page_num.

Returns: A generator yielding individual Device objects.