WebhookEndpointUpdateOptions.fromJson constructor

WebhookEndpointUpdateOptions.fromJson(
  1. Object? json
)

Implementation

factory WebhookEndpointUpdateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return WebhookEndpointUpdateOptions(
    description:
        map['description'] == null ? null : (map['description'] as String),
    disabled: map['disabled'] == null ? null : (map['disabled'] as bool),
    enabledEvents: map['enabled_events'] == null
        ? null
        : (map['enabled_events'] as List<Object?>)
            .map((el) => WebhookEndpointEnabledEventsItem.fromJson(el))
            .toList(),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    url: map['url'] == null ? null : (map['url'] as String),
  );
}