toJson method

Map<String, Object> toJson()

Converts a GRPCAction instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempPort = port;
  final tempService = service;

  jsonData['port'] = tempPort;

  if (tempService != null) {
    jsonData['service'] = tempService;
  }

  return jsonData;
}