/// <summary> /// Initializes a new instance of the <see cref="NewApplication" /> class. /// </summary> /// <param name="name">The name of this application. (required).</param> /// <param name="description">A longer description of the application..</param> /// <param name="timezone">A string containing an IANA timezone descriptor. (required).</param> /// <param name="currency">A string describing a default currency for new customer sessions. (required).</param> /// <param name="caseSensitivity">A string indicating how should campaigns in this application deal with case sensitivity on coupon codes..</param> /// <param name="attributes">Arbitrary properties associated with this campaign.</param> /// <param name="limits">Default limits for campaigns created in this application.</param> /// <param name="campaignPriority">Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive). If no value is provided, this is set to \"universal\".</param> /// <param name="exclusiveCampaignsStrategy">The strategy used when choosing exclusive campaigns for evaluation, can be one of (listOrder, lowestDiscount, highestDiscount). If no value is provided, this is set to \"listOrder\".</param> /// <param name="enableCascadingDiscounts">Flag indicating if discounts should cascade for this application.</param> /// <param name="enableFlattenedCartItems">Flag indicating if cart items of quantity larger than one should be separated into different items of quantity one.</param> /// <param name="attributesSettings">attributesSettings.</param> /// <param name="sandbox">Flag indicating if this is a live or sandbox application.</param> /// <param name="key">Hex key for HMAC-signing API calls as coming from this application (16 hex digits).</param> public NewApplication(string name = default(string), string description = default(string), string timezone = default(string), string currency = default(string), CaseSensitivityEnum?caseSensitivity = default(CaseSensitivityEnum?), Object attributes = default(Object), List <LimitConfig> limits = default(List <LimitConfig>), CampaignPriorityEnum?campaignPriority = default(CampaignPriorityEnum?), ExclusiveCampaignsStrategyEnum?exclusiveCampaignsStrategy = default(ExclusiveCampaignsStrategyEnum?), bool enableCascadingDiscounts = default(bool), bool enableFlattenedCartItems = default(bool), AttributesSettings attributesSettings = default(AttributesSettings), bool sandbox = default(bool), string key = default(string)) { // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for NewApplication and cannot be null"); } else { this.Name = name; } // to ensure "timezone" is required (not null) if (timezone == null) { throw new InvalidDataException("timezone is a required property for NewApplication and cannot be null"); } else { this.Timezone = timezone; } // to ensure "currency" is required (not null) if (currency == null) { throw new InvalidDataException("currency is a required property for NewApplication and cannot be null"); } else { this.Currency = currency; } this.Description = description; this.CaseSensitivity = caseSensitivity; this.Attributes = attributes; this.Limits = limits; this.CampaignPriority = campaignPriority; this.ExclusiveCampaignsStrategy = exclusiveCampaignsStrategy; this.EnableCascadingDiscounts = enableCascadingDiscounts; this.EnableFlattenedCartItems = enableFlattenedCartItems; this.AttributesSettings = attributesSettings; this.Sandbox = sandbox; this.Key = key; }
/// <summary> /// Initializes a new instance of the <see cref="Application" /> 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="modified">The exact moment this entity was last modified. (required).</param> /// <param name="accountId">The ID of the account that owns this entity. (required).</param> /// <param name="name">The name of this application. (required).</param> /// <param name="description">A longer description of the application..</param> /// <param name="timezone">A string containing an IANA timezone descriptor. (required).</param> /// <param name="currency">A string describing a default currency for new customer sessions. (required).</param> /// <param name="caseSensitivity">A string indicating how should campaigns in this application deal with case sensitivity on coupon codes..</param> /// <param name="attributes">Arbitrary properties associated with this campaign.</param> /// <param name="limits">Default limits for campaigns created in this application.</param> /// <param name="campaignPriority">Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive). If no value is provided, this is set to \"universal\".</param> /// <param name="exclusiveCampaignsStrategy">The strategy used when choosing exclusive campaigns for evaluation, can be one of (listOrder, lowestDiscount, highestDiscount). If no value is provided, this is set to \"listOrder\".</param> /// <param name="enableCascadingDiscounts">Flag indicating if discounts should cascade for this application.</param> /// <param name="enableFlattenedCartItems">Flag indicating if cart items of quantity larger than one should be separated into different items of quantity one.</param> /// <param name="attributesSettings">attributesSettings.</param> /// <param name="sandbox">Flag indicating if this is a live or sandbox application.</param> /// <param name="loyaltyPrograms">An array containing all the loyalty programs to which this application is subscribed (required).</param> public Application(int id = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), int accountId = default(int), string name = default(string), string description = default(string), string timezone = default(string), string currency = default(string), CaseSensitivityEnum?caseSensitivity = default(CaseSensitivityEnum?), Object attributes = default(Object), List <LimitConfig> limits = default(List <LimitConfig>), CampaignPriorityEnum?campaignPriority = default(CampaignPriorityEnum?), ExclusiveCampaignsStrategyEnum?exclusiveCampaignsStrategy = default(ExclusiveCampaignsStrategyEnum?), bool enableCascadingDiscounts = default(bool), bool enableFlattenedCartItems = default(bool), AttributesSettings attributesSettings = default(AttributesSettings), bool sandbox = default(bool), List <LoyaltyProgram> loyaltyPrograms = default(List <LoyaltyProgram>)) { // to ensure "id" is required (not null) if (id == null) { throw new InvalidDataException("id is a required property for Application 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 Application and cannot be null"); } else { this.Created = created; } // to ensure "modified" is required (not null) if (modified == null) { throw new InvalidDataException("modified is a required property for Application and cannot be null"); } else { this.Modified = modified; } // to ensure "accountId" is required (not null) if (accountId == null) { throw new InvalidDataException("accountId is a required property for Application and cannot be null"); } else { this.AccountId = accountId; } // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for Application and cannot be null"); } else { this.Name = name; } // to ensure "timezone" is required (not null) if (timezone == null) { throw new InvalidDataException("timezone is a required property for Application and cannot be null"); } else { this.Timezone = timezone; } // to ensure "currency" is required (not null) if (currency == null) { throw new InvalidDataException("currency is a required property for Application and cannot be null"); } else { this.Currency = currency; } // to ensure "loyaltyPrograms" is required (not null) if (loyaltyPrograms == null) { throw new InvalidDataException("loyaltyPrograms is a required property for Application and cannot be null"); } else { this.LoyaltyPrograms = loyaltyPrograms; } this.Description = description; this.CaseSensitivity = caseSensitivity; this.Attributes = attributes; this.Limits = limits; this.CampaignPriority = campaignPriority; this.ExclusiveCampaignsStrategy = exclusiveCampaignsStrategy; this.EnableCascadingDiscounts = enableCascadingDiscounts; this.EnableFlattenedCartItems = enableFlattenedCartItems; this.AttributesSettings = attributesSettings; this.Sandbox = sandbox; }