SubscriptionSchedulesResourceDefaultSettings.fromJson constructor

SubscriptionSchedulesResourceDefaultSettings.fromJson(
  1. Object? json
)

Implementation

factory SubscriptionSchedulesResourceDefaultSettings.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SubscriptionSchedulesResourceDefaultSettings(
    applicationFeePercent: map['application_fee_percent'] == null
        ? null
        : (map['application_fee_percent'] as num).toDouble(),
    automaticTax: map['automatic_tax'] == null
        ? null
        : SubscriptionSchedulesResourceDefaultSettingsAutomaticTax.fromJson(
            map['automatic_tax']),
    billingCycleAnchor:
        SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor
            .fromJson(map['billing_cycle_anchor']),
    billingThresholds: map['billing_thresholds'] == null
        ? null
        : SubscriptionBillingThresholds.fromJson(map['billing_thresholds']),
    collectionMethod: map['collection_method'] == null
        ? null
        : SubscriptionSchedulePhaseConfigurationCollectionMethod.fromJson(
            map['collection_method']),
    defaultPaymentMethod: map['default_payment_method'] == null
        ? null
        : PaymentMethodOrId.fromJson(map['default_payment_method']),
    description:
        map['description'] == null ? null : (map['description'] as String),
    invoiceSettings: InvoiceSettingSubscriptionScheduleSetting.fromJson(
        map['invoice_settings']),
    onBehalfOf: map['on_behalf_of'] == null
        ? null
        : AccountOrId.fromJson(map['on_behalf_of']),
    transferData: map['transfer_data'] == null
        ? null
        : SubscriptionTransferData.fromJson(map['transfer_data']),
  );
}