toJson method

Map<String, Object> toJson()

Converts a IngressServiceBackend instance to JSON data.

Implementation

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

  final tempName = name;
  final tempPort = port;

  jsonData['name'] = tempName;

  if (tempPort != null) {
    jsonData['port'] = tempPort.toJson();
  }

  return jsonData;
}