# mycoreapi.api.DeviceApi ## Load the API package ```dart import 'package:mycoreapi/api.dart'; ``` All URIs are relative to *http://localhost:25049* Method | HTTP request | Description ------------- | ------------- | ------------- [**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/device | Create a device [**deviceCreateDevicesFromProvider**](DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{userId}/fromProvider/{providerId} | Create devices from provider [**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device [**deviceDeleteAllForUser**](DeviceApi.md#devicedeleteallforuser) | **DELETE** /api/device/user/{userId} | Delete all device for a specified user [**deviceDeleteDevicesFromProvider**](DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider [**deviceGetAll**](DeviceApi.md#devicegetall) | **GET** /api/device/{userId} | Get all devices summary [**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info [**deviceGetDevicesByType**](DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{userId}/type/{type} | Get list of devices from a type [**deviceGetDevicesFromProvider**](DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{userId}/fromProvider/{providerId} | Get devices from provider [**deviceGetDevicesFromZigbee2Mqtt**](DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices [**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device # **deviceCreate** > DeviceDetailDTO deviceCreate(deviceDetailDTO) Create a device ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to create try { final result = api_instance.deviceCreate(deviceDetailDTO); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceCreate: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| Device to create | ### Return type [**DeviceDetailDTO**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceCreateDevicesFromProvider** > List deviceCreateDevicesFromProvider(userId, providerId) Create devices from provider ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | User Id final providerId = providerId_example; // String | Id of Provider try { final result = api_instance.deviceCreateDevicesFromProvider(userId, providerId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| User Id | **providerId** | **String**| Id of Provider | ### Return type [**List**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceDelete** > String deviceDelete(deviceId) Delete a device ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | Id of device to delete try { final result = api_instance.deviceDelete(deviceId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceDelete: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deviceId** | **String**| Id of device to delete | ### Return type **String** ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceDeleteAllForUser** > String deviceDeleteAllForUser(userId) Delete all device for a specified user ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | Id of user try { final result = api_instance.deviceDeleteAllForUser(userId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceDeleteAllForUser: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| Id of user | ### Return type **String** ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceDeleteDevicesFromProvider** > String deviceDeleteDevicesFromProvider(userId, providerId) Delete devices from provider ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | User Id final providerId = providerId_example; // String | Id of Provider try { final result = api_instance.deviceDeleteDevicesFromProvider(userId, providerId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| User Id | **providerId** | **String**| Id of Provider | ### Return type **String** ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGetAll** > List deviceGetAll(userId) Get all devices summary ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | Id of user try { final result = api_instance.deviceGetAll(userId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGetAll: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| Id of user | ### Return type [**List**](DeviceSummaryDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGetDetail** > DeviceDetailDTO deviceGetDetail(deviceId) Get a specific device info ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | id of device try { final result = api_instance.deviceGetDetail(deviceId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGetDetail: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deviceId** | **String**| id of device | ### Return type [**DeviceDetailDTO**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGetDevicesByType** > List deviceGetDevicesByType(userId, type) Get list of devices from a type ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | user Id final type = ; // DeviceType | device type try { final result = api_instance.deviceGetDevicesByType(userId, type); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| user Id | **type** | [**DeviceType**](.md)| device type | ### Return type [**List**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGetDevicesFromProvider** > List deviceGetDevicesFromProvider(userId, providerId) Get devices from provider ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | User Id final providerId = providerId_example; // String | Id of Provider try { final result = api_instance.deviceGetDevicesFromProvider(userId, providerId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| User Id | **providerId** | **String**| Id of Provider | ### Return type [**List**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceGetDevicesFromZigbee2Mqtt** > List deviceGetDevicesFromZigbee2Mqtt(userId) Get all zigbee2Mqtt devices ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final userId = userId_example; // String | User Id try { final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(userId); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **userId** | **String**| User Id | ### Return type [**List**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **deviceUpdate** > DeviceDetailDTO deviceUpdate(deviceId, deviceDetailDTO) Update a device ### Example ```dart import 'package:mycoreapi/api.dart'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; final api_instance = DeviceApi(); final deviceId = deviceId_example; // String | final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update try { final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO); print(result); } catch (e) { print('Exception when calling DeviceApi->deviceUpdate: $e\n'); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **deviceId** | **String**| | **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| Device to update | ### Return type [**DeviceDetailDTO**](DeviceDetailDTO.md) ### Authorization [bearer](../README.md#bearer) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)