BillingPortalConfigurationUpdateOptionsFeaturesSubscriptionCancel.fromJson constructor

BillingPortalConfigurationUpdateOptionsFeaturesSubscriptionCancel.fromJson(
  1. Object? json
)

Implementation

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