toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json[r'object'] = this.object;
  json[r'id'] = this.id;
  json[r'instance_id'] = this.instanceId;
  json[r'status'] = this.status;
  if (this.credit != null) {
    json[r'credit'] = this.credit;
  } else {
    json[r'credit'] = null;
  }
  json[r'plan_id'] = this.planId;
  if (this.priceId != null) {
    json[r'price_id'] = this.priceId;
  } else {
    json[r'price_id'] = null;
  }
  if (this.plan != null) {
    json[r'plan'] = this.plan;
  } else {
    json[r'plan'] = null;
  }
  json[r'plan_period'] = this.planPeriod;
  json[r'payment_source_id'] = this.paymentSourceId;
  if (this.paymentSource != null) {
    json[r'payment_source'] = this.paymentSource;
  } else {
    json[r'payment_source'] = null;
  }
  if (this.lifetimePaid != null) {
    json[r'lifetime_paid'] = this.lifetimePaid;
  } else {
    json[r'lifetime_paid'] = null;
  }
  if (this.amount != null) {
    json[r'amount'] = this.amount;
  } else {
    json[r'amount'] = null;
  }
  if (this.nextInvoice != null) {
    json[r'next_invoice'] = this.nextInvoice;
  } else {
    json[r'next_invoice'] = null;
  }
  if (this.nextPayment != null) {
    json[r'next_payment'] = this.nextPayment;
  } else {
    json[r'next_payment'] = null;
  }
  json[r'payer_id'] = this.payerId;
  if (this.payer != null) {
    json[r'payer'] = this.payer;
  } else {
    json[r'payer'] = null;
  }
  json[r'is_free_trial'] = this.isFreeTrial;
  if (this.periodStart != null) {
    json[r'period_start'] = this.periodStart;
  } else {
    json[r'period_start'] = null;
  }
  if (this.periodEnd != null) {
    json[r'period_end'] = this.periodEnd;
  } else {
    json[r'period_end'] = null;
  }
  json[r'proration_date'] = this.prorationDate;
  if (this.canceledAt != null) {
    json[r'canceled_at'] = this.canceledAt;
  } else {
    json[r'canceled_at'] = null;
  }
  if (this.pastDueAt != null) {
    json[r'past_due_at'] = this.pastDueAt;
  } else {
    json[r'past_due_at'] = null;
  }
  if (this.endedAt != null) {
    json[r'ended_at'] = this.endedAt;
  } else {
    json[r'ended_at'] = null;
  }
  json[r'created_at'] = this.createdAt;
  json[r'updated_at'] = this.updatedAt;
  return json;
}