webhookEnvironmentValuesFromJson function
WebhookEnvironmentValues
webhookEnvironmentValuesFromJson(
- Object? webhookEnvironmentValues, [
- WebhookEnvironmentValues? defaultValue
Implementation
enums.WebhookEnvironmentValues webhookEnvironmentValuesFromJson(
Object? webhookEnvironmentValues, [
enums.WebhookEnvironmentValues? defaultValue,
]) {
if (webhookEnvironmentValues is String) {
return enums.$WebhookEnvironmentValuesMap.entries
.firstWhere(
(element) =>
element.value.toLowerCase() ==
webhookEnvironmentValues.toLowerCase(),
orElse: () => const MapEntry(
enums.WebhookEnvironmentValues.swaggerGeneratedUnknown, ''))
.key;
}
final parsedResult = defaultValue == null
? null
: enums.$WebhookEnvironmentValuesMap.entries
.firstWhereOrNull((element) => element.value == defaultValue)
?.key;
return parsedResult ??
defaultValue ??
enums.WebhookEnvironmentValues.swaggerGeneratedUnknown;
}