/// <summary> /// Initializes a new instance of the <see cref="OnDemandPromotion" /> class. /// </summary> /// <param name="accessType">The type of access that the promotion grants. Option descriptions: * `default` - The promotion grants discounts on existing product offerings. * `vip` - The promotion grants free access to On Demand content before it is released or to access types that aren't part of the existing product offerings. (required).</param> /// <param name="discountType">The type of discount that the promotion provides. Option descriptions: * `dollars` - The promotion discounts a fixed amount from the full purchase price. * `free` - The promotion discounts the full purchase price. When **access_type** is `vip`, **discount_type** is always `free`. * `percent` - The promotion discounts a percentage of the full purchase price. (required).</param> /// <param name="download">Whether the promotion grants download access to On Demand content. (required).</param> /// <param name="label">The prefix string for batch codes, or the null value for single codes. (required).</param> /// <param name="metadata">metadata (required).</param> /// <param name="percentOff">When **discount_type** is `percent`, the percentage amount that is deducted from the product price. (required).</param> /// <param name="productType">The type of product to which the promotion can be applied. Only the `buy` and `rent` options are available when **access_type** is `vip`. Option descriptions: * `any` - The promotion can be applied to any product. * `buy` - The promotion can be applied to a buyable single video. * `buy_episode` - The promotion can be applied to a buyable single episode. * `rent` - The promotion can be applied to a rentable single video. * `rent_episode` - The promotion can be applied to a rentable single episode. * `subscribe` - The promotion can be applied to a subscription. (required).</param> /// <param name="streamPeriod">The amount of time that the user has access to the On Demand content after redeeming a promo code. Option descriptions: * `1_week` - Access lasts for one week. * `1_year` - Access lasts for one year. * `24_hour` - Access lasts for 24 hours. * `30_days` - Access lasts for 30 days. * `3_month` - Access lasts for three months. * `48_hour` - Access lasts for 48 hours. * `6_month` - Access lasts for six months. * `72_hour` - Access lasts for 72 hours. (required).</param> /// <param name="total">When **type** is `single`, the total number of times that the promotion can be used. When **type** is `batch` or `batch_prefix`, the total number of promo codes that have been generated. (required).</param> /// <param name="type">The way in which the promotion generates promo codes. Option descriptions: * `batch` - The promotion provides a unique promo code for each user. * `batch_prefix` - Like `batch`, except that all codes have a similar prefix string. This option is deprecated, yet it may still appear for some users. * `single` - The promotion provides a single promo code for all users. (required).</param> /// <param name="uri">The promotion's canonical relative URI. (required).</param> public OnDemandPromotion(AccessTypeEnum accessType = default(AccessTypeEnum), DiscountTypeEnum discountType = default(DiscountTypeEnum), bool download = default(bool), string label = default(string), OnDemandPromotionMetadata metadata = default(OnDemandPromotionMetadata), decimal percentOff = default(decimal), ProductTypeEnum productType = default(ProductTypeEnum), StreamPeriodEnum streamPeriod = default(StreamPeriodEnum), decimal total = default(decimal), TypeEnum type = default(TypeEnum), string uri = default(string)) { this.AccessType = accessType; this.DiscountType = discountType; this.Download = download; // to ensure "label" is required (not null) this.Label = label ?? throw new ArgumentNullException("label is a required property for OnDemandPromotion and cannot be null"); // to ensure "metadata" is required (not null) this.Metadata = metadata ?? throw new ArgumentNullException("metadata is a required property for OnDemandPromotion and cannot be null"); this.PercentOff = percentOff; this.ProductType = productType; this.StreamPeriod = streamPeriod; this.Total = total; this.Type = type; // to ensure "uri" is required (not null) this.Uri = uri ?? throw new ArgumentNullException("uri is a required property for OnDemandPromotion and cannot be null"); }
/// <summary> /// Initializes a new instance of the <see cref="InlineObject33" /> class. /// </summary> /// <param name="accessType">The promotion access type, which is a purchase option that isn't available in the On Demand container. Use the **download** and **stream_period** fields to define additional characteristics for the `vip` type. Option descriptions: * `default` - The promotion grants a discount on the existing purchase options for an On Demand container. * `vip` - The promotion grants free access to On Demand content before it's released. .</param> /// <param name="code">The promotion code. This field is ignored for batch promotions..</param> /// <param name="discountType">The type of discount offered by the promo code. When `access_type` is `vip`, the value of this field must be `free`. Option descriptions: * `free` - This option reduces the price to zero. * `percent` - This option reduces the price by the percentage defined in the **percent_off** field. .</param> /// <param name="download">Whether the promotion grants download access to On Demand content. This is necessary only when not previously defined in the On Demand container or when **access_type** is `vip` or **product_type** is `buy`. (required).</param> /// <param name="endTime">The end of the promotion period. If this field has no value, the promotion never expires..</param> /// <param name="label">For batch promotions, the description of the promotion. This field is ignored for single promotions..</param> /// <param name="percentOff">The percentage of the discount. This field is applicable only when **discount_type** is `percent`..</param> /// <param name="productType">The type of transaction to which the promotion applies. When **access_type** is `default`, the default value is `any`. When **access_type** is `vip`, the default value is `rent`. Also, when **access_type** is `vip`, the only valid product types are `buy` and `rent`..</param> /// <param name="startTime">The start of the promotion period. If this field has no value, the start time defaults to the time that the promotion was created..</param> /// <param name="streamPeriod">The amount of time that a user has access to On Demand content upon redeeming a promo code. This field is necessary only when not defined in the On Demand container or when creating promotions where **access_type** is `vip` or **product_type** is `rent`. (required).</param> /// <param name="total">When **type** is `batch`, the number of promotions to generate. When **type** is `single`, the number of uses of the promotion. (required).</param> /// <param name="type">The type of the promotion. When **access_type** is `vip`, the value for this field must be `batch`. Option descriptions: * `batch` - This option generates many random promo codes with one use each. * `single` - This option generates one promo code that can be used many times. (required).</param> public InlineObject33(AccessTypeEnum?accessType = default(AccessTypeEnum?), string code = default(string), DiscountTypeEnum?discountType = default(DiscountTypeEnum?), bool download = default(bool), string endTime = default(string), string label = default(string), decimal percentOff = default(decimal), ProductTypeEnum?productType = default(ProductTypeEnum?), string startTime = default(string), StreamPeriodEnum streamPeriod = default(StreamPeriodEnum), decimal total = default(decimal), TypeEnum type = default(TypeEnum)) { this.Download = download; this.StreamPeriod = streamPeriod; this.Total = total; this.Type = type; this.AccessType = accessType; this.Code = code; this.DiscountType = discountType; this.EndTime = endTime; this.Label = label; this.PercentOff = percentOff; this.ProductType = productType; this.StartTime = startTime; }