ConfigurationSubscriptionCancel.fromJson constructor

ConfigurationSubscriptionCancel.fromJson(
  1. Object? json
)

Implementation

factory ConfigurationSubscriptionCancel.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return ConfigurationSubscriptionCancel(
    cancellationReason: map['cancellation_reason'] == null
        ? null
        : ConfigurationCancellationReason.fromJson(
            map['cancellation_reason']),
    enabled: (map['enabled'] as bool),
    mode: map['mode'] == null
        ? null
        : PortalSubscriptionCancelMode.fromJson(map['mode']),
    prorationBehavior: map['proration_behavior'] == null
        ? null
        : PortalSubscriptionCancelProrationBehavior.fromJson(
            map['proration_behavior']),
  );
}