SubscriptionScheduleDefaultSettings.fromJson constructor

SubscriptionScheduleDefaultSettings.fromJson(
  1. Object? json
)

Implementation

factory SubscriptionScheduleDefaultSettings.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SubscriptionScheduleDefaultSettings(
    applicationFeePercent: map['application_fee_percent'] == null
        ? null
        : (map['application_fee_percent'] as num).toDouble(),
    automaticTax: map['automatic_tax'] == null
        ? null
        : SessionAutomaticTax.fromJson(map['automatic_tax']),
    billingCycleAnchor: map['billing_cycle_anchor'] == null
        ? null
        : SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor
            .fromJson(map['billing_cycle_anchor']),
    billingThresholds: map['billing_thresholds'] == null
        ? null
        : SubscriptionScheduleBillingThresholds.fromJson(
            map['billing_thresholds']),
    collectionMethod: map['collection_method'] == null
        ? null
        : InvoiceCollectionMethod.fromJson(map['collection_method']),
    defaultPaymentMethod: map['default_payment_method'] == null
        ? null
        : (map['default_payment_method'] as String),
    description:
        map['description'] == null ? null : (map['description'] as String),
    invoiceSettings: map['invoice_settings'] == null
        ? null
        : SubscriptionScheduleInvoiceSettings.fromJson(
            map['invoice_settings']),
    onBehalfOf:
        map['on_behalf_of'] == null ? null : (map['on_behalf_of'] as String),
    transferData: map['transfer_data'] == null
        ? null
        : SessionTransferData.fromJson(map['transfer_data']),
  );
}