SubscriptionModel.fromMap constructor

SubscriptionModel.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory SubscriptionModel.fromMap(Map<String, dynamic> map) {
  return SubscriptionModel(
    id: map['id'],
    suspended: map['suspended'],
    planIdentifier: map['plan_identifier'],
    priceCents: map['price_cents'],
    currency: map['currency'],
    features: SubscriptionFeatures.fromMap(map['features']),
    expiresAt: map['expires_at'],
    createdAt: map['created_at'],
    updatedAt: map['updated_at'],
    customerName: map['customer_name'],
    customerEmail: map['customer_email'],
    cycledAt: map['cycled_at'],
    creditsMin: map['credits_min'],
    creditsCycle: map['credits_cycle'],
    customerId: map['customer_id'],
    planName: map['plan_name'],
    customerRef: map['customer_ref'],
    planRef: map['plan_ref'],
    active: map['active'],
    inTrial: map['in_trial'],
    credits: map['credits'],
    creditsBased: map['credits_based'],
    recentInvoices: map['recent_invoices'],
    subitems: List<SubscriptionSubitem>.from(map['subitems']?.map((x) => SubscriptionSubitem.fromMap(x))),
    logs: List<SubscriptionLog>.from(map['logs']?.map((x) => SubscriptionLog.fromMap(x))),
    customVariables: List<CustomVariables>.from(map['custom_variables']?.map((x) => CustomVariables.fromMap(x))),
  );
}