create static method

StarSubscription create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "starSubscription",
  3. String special_return_type = "starSubscription",
  4. String? id,
  5. num? chat_id,
  6. num? expiration_date,
  7. bool? is_canceled,
  8. bool? is_expiring,
  9. StarSubscriptionPricing? pricing,
  10. StarSubscriptionType? type,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static StarSubscription create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "starSubscription",
  String special_return_type = "starSubscription",
  String? id,
  num? chat_id,
  num? expiration_date,
  bool? is_canceled,
  bool? is_expiring,
  StarSubscriptionPricing? pricing,
  StarSubscriptionType? type,
}) {
  // StarSubscription starSubscription = StarSubscription({
  final Map starSubscription_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "chat_id": chat_id,
    "expiration_date": expiration_date,
    "is_canceled": is_canceled,
    "is_expiring": is_expiring,
    "pricing": (pricing != null) ? pricing.toJson() : null,
    "type": (type != null) ? type.toJson() : null,
  };

  starSubscription_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (starSubscription_data_create_json.containsKey(key) == false) {
        starSubscription_data_create_json[key] = value;
      }
    });
  }
  return StarSubscription(starSubscription_data_create_json);
}