Promotion constructor

Promotion({
  1. RowVersion? rowVersion,
  2. PromotionId? id,
  3. PromotionRuleId? ruleId,
  4. String? title,
  5. StringValue? description,
  6. bool? deleted,
  7. Iterable<PromotionProduct>? products,
  8. AccountId? appliesToAccountId,
  9. Timestamp? startsAt,
  10. Timestamp? endsAt,
  11. PromotionConfiguration? configuration,
  12. StoredImage? image,
  13. Timestamp? createdTime,
  14. Timestamp? updatedTime,
  15. Promotion_ProductMatch? match,
})

Implementation

factory Promotion({
  $0.RowVersion? rowVersion,
  $1.PromotionId? id,
  $1.PromotionRuleId? ruleId,
  $core.String? title,
  $2.StringValue? description,
  $core.bool? deleted,
  $core.Iterable<PromotionProduct>? products,
  $1.AccountId? appliesToAccountId,
  $3.Timestamp? startsAt,
  $3.Timestamp? endsAt,
  PromotionConfiguration? configuration,
  $4.StoredImage? image,
  $3.Timestamp? createdTime,
  $3.Timestamp? updatedTime,
  Promotion_ProductMatch? match,
}) {
  final result = create();
  if (rowVersion != null) result.rowVersion = rowVersion;
  if (id != null) result.id = id;
  if (ruleId != null) result.ruleId = ruleId;
  if (title != null) result.title = title;
  if (description != null) result.description = description;
  if (deleted != null) result.deleted = deleted;
  if (products != null) result.products.addAll(products);
  if (appliesToAccountId != null)
    result.appliesToAccountId = appliesToAccountId;
  if (startsAt != null) result.startsAt = startsAt;
  if (endsAt != null) result.endsAt = endsAt;
  if (configuration != null) result.configuration = configuration;
  if (image != null) result.image = image;
  if (createdTime != null) result.createdTime = createdTime;
  if (updatedTime != null) result.updatedTime = updatedTime;
  if (match != null) result.match = match;
  return result;
}