copyWith method

PremiumGiftCodeInfo copyWith({
  1. MessageSender? creatorId()?,
  2. int? creationDate,
  3. bool? isFromGiveaway,
  4. int? giveawayMessageId,
  5. int? monthCount,
  6. int? userId,
  7. int? useDate,
  8. dynamic extra,
  9. int? clientId,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

PremiumGiftCodeInfo copyWith({
  MessageSender? Function()? creatorId,
  int? creationDate,
  bool? isFromGiveaway,
  int? giveawayMessageId,
  int? monthCount,
  int? userId,
  int? useDate,
  dynamic extra,
  int? clientId,
}) =>
    PremiumGiftCodeInfo(
      creatorId: creatorId != null ? creatorId() : this.creatorId,
      creationDate: creationDate ?? this.creationDate,
      isFromGiveaway: isFromGiveaway ?? this.isFromGiveaway,
      giveawayMessageId: giveawayMessageId ?? this.giveawayMessageId,
      monthCount: monthCount ?? this.monthCount,
      userId: userId ?? this.userId,
      useDate: useDate ?? this.useDate,
      extra: extra ?? this.extra,
      clientId: clientId ?? this.clientId,
    );