Map<String, Object?> encode() => { 'ip_protocol': ipProtocol.toTfJson(), if (ports != null) 'ports': ports!.toTfJson(), };