removeAction method

Future<MdmEmpty> removeAction(
  1. String apiKey, {
  2. required String deviceId,
  3. required RemoveActionRequestDtoActionNameEnum actionName,
})

Implementation

Future<MdmEmpty> removeAction(
  String apiKey, {
  required String deviceId,
  required RemoveActionRequestDtoActionNameEnum actionName,
}) async {
  final String url =
      '$channel/devices/$deviceId/actions/${actionName.stringValue}';

  final response = await http.get(
    Uri.parse(url),
    headers: {
      'Authorization': 'Zoho-oauthtoken $apiKey',
      'Content-Type': 'application/json;charset=UTF-8',
    },
  );

  if (!response.statusCode.isSuccessful) {
    throw MdmEngineException(
      method: response.request?.method,
      url: url,
      statusCode: response.statusCode,
      error: response.body,
    );
  }

  return MdmEmpty();
}