removeNodeMapping method

Future<void> removeNodeMapping(
  1. String nodeId
)

Removes a user node mapping.

Will throw an exception when there is a failure containing a description of the failure.

Implementation

Future<void> removeNodeMapping(String nodeId) async {
  final uri = _urlBase.getPath(_nodeMapping);

  final body = await JsonIsolate().encodeJson({
    'node_id': nodeId,
    'operation': 'remove',
  });

  final resp = await put(
    uri,
    body: body,
    headers: {
      URLBase.authHeader: accessToken,
    },
  );
  final Map<String, dynamic> bodyResp =
      await JsonIsolate().decodeJson(resp.body);
  if (resp.statusCode != 200) {
    throw bodyResp['description'];
  }
}