fromMap static method

ServerTrustAuthResponse? fromMap(
  1. Map<String, dynamic>? map, {
  2. EnumMethod? enumMethod,
})

Gets a possible ServerTrustAuthResponse instance from a Map value.

Implementation

static ServerTrustAuthResponse? fromMap(
  Map<String, dynamic>? map, {
  EnumMethod? enumMethod,
}) {
  if (map == null) {
    return null;
  }
  final instance = ServerTrustAuthResponse();
  instance.action = switch (enumMethod ?? EnumMethod.nativeValue) {
    EnumMethod.nativeValue => ServerTrustAuthResponseAction.fromNativeValue(
      map['action'],
    ),
    EnumMethod.value => ServerTrustAuthResponseAction.fromValue(
      map['action'],
    ),
    EnumMethod.name => ServerTrustAuthResponseAction.byName(map['action']),
  };
  return instance;
}