toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final destinationDomain = this.destinationDomain;
  final destinationIpV4 = this.destinationIpV4;
  final destinationIpV6 = this.destinationIpV6;
  final destinationPort = this.destinationPort;
  final direction = this.direction;
  final openPortRange = this.openPortRange;
  final protocol = this.protocol;
  final sourceDomain = this.sourceDomain;
  final sourceIpV4 = this.sourceIpV4;
  final sourceIpV6 = this.sourceIpV6;
  final sourceMac = this.sourceMac;
  final sourcePort = this.sourcePort;
  return {
    if (destinationDomain != null) 'DestinationDomain': destinationDomain,
    if (destinationIpV4 != null) 'DestinationIpV4': destinationIpV4,
    if (destinationIpV6 != null) 'DestinationIpV6': destinationIpV6,
    if (destinationPort != null) 'DestinationPort': destinationPort,
    if (direction != null) 'Direction': direction.toValue(),
    if (openPortRange != null) 'OpenPortRange': openPortRange,
    if (protocol != null) 'Protocol': protocol,
    if (sourceDomain != null) 'SourceDomain': sourceDomain,
    if (sourceIpV4 != null) 'SourceIpV4': sourceIpV4,
    if (sourceIpV6 != null) 'SourceIpV6': sourceIpV6,
    if (sourceMac != null) 'SourceMac': sourceMac,
    if (sourcePort != null) 'SourcePort': sourcePort,
  };
}