toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "authenticationMethod": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => authenticationMethod?.toNativeValue(),
      EnumMethod.value => authenticationMethod?.toValue(),
      EnumMethod.name => authenticationMethod?.name(),
    },
    "distinguishedNames": distinguishedNames
        ?.map((e) => e.toMap(enumMethod: enumMethod))
        .toList(),
    "host": host,
    "port": port,
    "protocol": protocol,
    "proxyType": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => proxyType?.toNativeValue(),
      EnumMethod.value => proxyType?.toValue(),
      EnumMethod.name => proxyType?.name(),
    },
    "realm": realm,
    "receivesCredentialSecurely": receivesCredentialSecurely,
    "sslCertificate": sslCertificate?.toMap(enumMethod: enumMethod),
    "sslError": sslError?.toMap(enumMethod: enumMethod),
  };
}