toJson method

Map<String, Object> toJson()

Converts a IngressRule instance to JSON data.

Implementation

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

  final tempHost = host;
  final tempHttp = http;

  if (tempHost != null) {
    jsonData['host'] = tempHost;
  }

  if (tempHttp != null) {
    jsonData['http'] = tempHttp.toJson();
  }

  return jsonData;
}