create static method

MessagePremiumGiftCode create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "messagePremiumGiftCode",
  3. String special_return_type = "messageContent",
  4. MessageSender? creator_id,
  5. FormattedText? text,
  6. bool? is_from_giveaway,
  7. bool? is_unclaimed,
  8. String? currency,
  9. num? amount,
  10. String? cryptocurrency,
  11. num? cryptocurrency_amount,
  12. num? month_count,
  13. Sticker? sticker,
  14. String? code,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static MessagePremiumGiftCode create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "messagePremiumGiftCode",
  String special_return_type = "messageContent",
  MessageSender? creator_id,
  FormattedText? text,
  bool? is_from_giveaway,
  bool? is_unclaimed,
  String? currency,
  num? amount,
  String? cryptocurrency,
  num? cryptocurrency_amount,
  num? month_count,
  Sticker? sticker,
  String? code,
}) {
  // MessagePremiumGiftCode messagePremiumGiftCode = MessagePremiumGiftCode({
  final Map messagePremiumGiftCode_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "creator_id": (creator_id != null) ? creator_id.toJson() : null,
    "text": (text != null) ? text.toJson() : null,
    "is_from_giveaway": is_from_giveaway,
    "is_unclaimed": is_unclaimed,
    "currency": currency,
    "amount": amount,
    "cryptocurrency": cryptocurrency,
    "cryptocurrency_amount": cryptocurrency_amount,
    "month_count": month_count,
    "sticker": (sticker != null) ? sticker.toJson() : null,
    "code": code,
  };

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

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