/// <summary> /// Initializes a new instance of the <see cref="NewCampaign" /> class. /// </summary> /// <param name="name">A friendly name for this campaign. (required).</param> /// <param name="description">A detailed description of the campaign..</param> /// <param name="startTime">Datetime when the campaign will become active..</param> /// <param name="endTime">Datetime when the campaign will become in-active..</param> /// <param name="attributes">Arbitrary properties associated with this campaign.</param> /// <param name="state">A disabled or archived campaign is not evaluated for rules or coupons. (required) (default to StateEnum.Enabled).</param> /// <param name="activeRulesetId">ID of Ruleset this campaign applies on customer session evaluation..</param> /// <param name="tags">A list of tags for the campaign. (required).</param> /// <param name="features">A list of features for the campaign. (required).</param> /// <param name="couponSettings">couponSettings.</param> /// <param name="referralSettings">referralSettings.</param> /// <param name="limits">The set of limits that will operate for this campaign (required).</param> /// <param name="campaignGroups">The IDs of the campaign groups that own this entity..</param> public NewCampaign(string name = default(string), string description = default(string), DateTime startTime = default(DateTime), DateTime endTime = default(DateTime), Object attributes = default(Object), StateEnum state = StateEnum.Enabled, int activeRulesetId = default(int), List <string> tags = default(List <string>), List <FeaturesEnum> features = default(List <FeaturesEnum>), CodeGeneratorSettings couponSettings = default(CodeGeneratorSettings), CodeGeneratorSettings referralSettings = default(CodeGeneratorSettings), List <LimitConfig> limits = default(List <LimitConfig>), List <int> campaignGroups = default(List <int>)) { // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for NewCampaign and cannot be null"); } else { this.Name = name; } // to ensure "state" is required (not null) if (state == null) { throw new InvalidDataException("state is a required property for NewCampaign and cannot be null"); } else { this.State = state; } // to ensure "tags" is required (not null) if (tags == null) { throw new InvalidDataException("tags is a required property for NewCampaign and cannot be null"); } else { this.Tags = tags; } // to ensure "features" is required (not null) if (features == null) { throw new InvalidDataException("features is a required property for NewCampaign and cannot be null"); } else { this.Features = features; } // to ensure "limits" is required (not null) if (limits == null) { throw new InvalidDataException("limits is a required property for NewCampaign and cannot be null"); } else { this.Limits = limits; } this.Description = description; this.StartTime = startTime; this.EndTime = endTime; this.Attributes = attributes; this.ActiveRulesetId = activeRulesetId; this.CouponSettings = couponSettings; this.ReferralSettings = referralSettings; this.CampaignGroups = campaignGroups; }
/// <summary> /// Initializes a new instance of the <see cref="Campaign" /> class. /// </summary> /// <param name="id">Unique ID for this entity. (required).</param> /// <param name="created">The exact moment this entity was created. (required).</param> /// <param name="applicationId">The ID of the application that owns this entity. (required).</param> /// <param name="userId">The ID of the account that owns this entity. (required).</param> /// <param name="name">A friendly name for this campaign. (required).</param> /// <param name="description">A detailed description of the campaign. (required).</param> /// <param name="startTime">Datetime when the campaign will become active..</param> /// <param name="endTime">Datetime when the campaign will become in-active..</param> /// <param name="attributes">Arbitrary properties associated with this campaign.</param> /// <param name="state">A disabled or archived campaign is not evaluated for rules or coupons. (required) (default to StateEnum.Enabled).</param> /// <param name="activeRulesetId">ID of Ruleset this campaign applies on customer session evaluation..</param> /// <param name="tags">A list of tags for the campaign. (required).</param> /// <param name="features">A list of features for the campaign. (required).</param> /// <param name="couponSettings">couponSettings.</param> /// <param name="referralSettings">referralSettings.</param> /// <param name="limits">The set of limits that will operate for this campaign (required).</param> /// <param name="campaignGroups">The IDs of the campaign groups that own this entity..</param> /// <param name="couponRedemptionCount">Number of coupons redeemed in the campaign..</param> /// <param name="referralRedemptionCount">Number of referral codes redeemed in the campaign..</param> /// <param name="discountCount">Total amount of discounts redeemed in the campaign..</param> /// <param name="discountEffectCount">Total number of times discounts were redeemed in this campaign..</param> /// <param name="couponCreationCount">Total number of coupons created by rules in this campaign..</param> /// <param name="lastActivity">Timestamp of the most recent event received by this campaign..</param> /// <param name="updated">Timestamp of the most recent update to the campaign or any of its elements..</param> /// <param name="createdBy">Name of the user who created this campaign if available..</param> /// <param name="updatedBy">Name of the user who last updated this campaign if available..</param> public Campaign(int id = default(int), DateTime created = default(DateTime), int applicationId = default(int), int userId = default(int), string name = default(string), string description = default(string), DateTime startTime = default(DateTime), DateTime endTime = default(DateTime), Object attributes = default(Object), StateEnum state = StateEnum.Enabled, int activeRulesetId = default(int), List <string> tags = default(List <string>), List <FeaturesEnum> features = default(List <FeaturesEnum>), CodeGeneratorSettings couponSettings = default(CodeGeneratorSettings), CodeGeneratorSettings referralSettings = default(CodeGeneratorSettings), List <LimitConfig> limits = default(List <LimitConfig>), List <int> campaignGroups = default(List <int>), int couponRedemptionCount = default(int), int referralRedemptionCount = default(int), int discountCount = default(int), int discountEffectCount = default(int), int couponCreationCount = default(int), DateTime lastActivity = default(DateTime), DateTime updated = default(DateTime), string createdBy = default(string), string updatedBy = default(string)) { // to ensure "id" is required (not null) if (id == null) { throw new InvalidDataException("id is a required property for Campaign and cannot be null"); } else { this.Id = id; } // to ensure "created" is required (not null) if (created == null) { throw new InvalidDataException("created is a required property for Campaign and cannot be null"); } else { this.Created = created; } // to ensure "applicationId" is required (not null) if (applicationId == null) { throw new InvalidDataException("applicationId is a required property for Campaign and cannot be null"); } else { this.ApplicationId = applicationId; } // to ensure "userId" is required (not null) if (userId == null) { throw new InvalidDataException("userId is a required property for Campaign and cannot be null"); } else { this.UserId = userId; } // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for Campaign and cannot be null"); } else { this.Name = name; } // to ensure "description" is required (not null) if (description == null) { throw new InvalidDataException("description is a required property for Campaign and cannot be null"); } else { this.Description = description; } // to ensure "state" is required (not null) if (state == null) { throw new InvalidDataException("state is a required property for Campaign and cannot be null"); } else { this.State = state; } // to ensure "tags" is required (not null) if (tags == null) { throw new InvalidDataException("tags is a required property for Campaign and cannot be null"); } else { this.Tags = tags; } // to ensure "features" is required (not null) if (features == null) { throw new InvalidDataException("features is a required property for Campaign and cannot be null"); } else { this.Features = features; } // to ensure "limits" is required (not null) if (limits == null) { throw new InvalidDataException("limits is a required property for Campaign and cannot be null"); } else { this.Limits = limits; } this.StartTime = startTime; this.EndTime = endTime; this.Attributes = attributes; this.ActiveRulesetId = activeRulesetId; this.CouponSettings = couponSettings; this.ReferralSettings = referralSettings; this.CampaignGroups = campaignGroups; this.CouponRedemptionCount = couponRedemptionCount; this.ReferralRedemptionCount = referralRedemptionCount; this.DiscountCount = discountCount; this.DiscountEffectCount = discountEffectCount; this.CouponCreationCount = couponCreationCount; this.LastActivity = lastActivity; this.Updated = updated; this.CreatedBy = createdBy; this.UpdatedBy = updatedBy; }