toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.id != null) {
json[r'id'] = this.id;
} else {
json[r'id'] = null;
}
if (this.code != null) {
json[r'code'] = this.code;
} else {
json[r'code'] = null;
}
if (this.discountType != null) {
json[r'discount_type'] = this.discountType;
} else {
json[r'discount_type'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
json[r'description'] = null;
}
if (this.lessonDiscount != null) {
json[r'lesson_discount'] = this.lessonDiscount;
} else {
json[r'lesson_discount'] = null;
}
if (this.applyStudent != null) {
json[r'apply_student'] = this.applyStudent;
} else {
json[r'apply_student'] = null;
}
if (this.applyTutor != null) {
json[r'apply_tutor'] = this.applyTutor;
} else {
json[r'apply_tutor'] = null;
}
if (this.startAt != null) {
json[r'start_at'] = this.startAt!.toUtc().toIso8601String();
} else {
json[r'start_at'] = null;
}
if (this.endAt != null) {
json[r'end_at'] = this.endAt!.toUtc().toIso8601String();
} else {
json[r'end_at'] = null;
}
if (this.originalUnitPriceInCents != null) {
json[r'original_unit_price_in_cents'] = this.originalUnitPriceInCents;
} else {
json[r'original_unit_price_in_cents'] = null;
}
if (this.presentUnitPriceInCents != null) {
json[r'present_unit_price_in_cents'] = this.presentUnitPriceInCents;
} else {
json[r'present_unit_price_in_cents'] = null;
}
if (this.originalAmountInCents != null) {
json[r'original_amount_in_cents'] = this.originalAmountInCents;
} else {
json[r'original_amount_in_cents'] = null;
}
if (this.presentAmountInCents != null) {
json[r'present_amount_in_cents'] = this.presentAmountInCents;
} else {
json[r'present_amount_in_cents'] = null;
}
if (this.eligibleMinBookingNumber != null) {
json[r'eligible_min_booking_number'] = this.eligibleMinBookingNumber;
} else {
json[r'eligible_min_booking_number'] = null;
}
return json;
}