toJson method

Map<String, Object> toJson()

Converts a IngressBackend instance to JSON data.

Implementation

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

  final tempResource = resource;
  final tempService = service;

  if (tempResource != null) {
    jsonData['resource'] = tempResource.toJson();
  }

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

  return jsonData;
}