Example #1
0
 /// <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:  * &#x60;default&#x60; - The promotion grants discounts on existing product offerings.  * &#x60;vip&#x60; - The promotion grants free access to On Demand content before it is released or to access types that aren&#39;t part of the existing product offerings.  (required).</param>
 /// <param name="discountType">The type of discount that the promotion provides.  Option descriptions:  * &#x60;dollars&#x60; - The promotion discounts a fixed amount from the full purchase price.  * &#x60;free&#x60; - The promotion discounts the full purchase price. When **access_type** is &#x60;vip&#x60;, **discount_type** is always &#x60;free&#x60;.  * &#x60;percent&#x60; - 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 &#x60;percent&#x60;, 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 &#x60;buy&#x60; and &#x60;rent&#x60; options are available when **access_type** is &#x60;vip&#x60;.  Option descriptions:  * &#x60;any&#x60; - The promotion can be applied to any product.  * &#x60;buy&#x60; - The promotion can be applied to a buyable single video.  * &#x60;buy_episode&#x60; - The promotion can be applied to a buyable single episode.  * &#x60;rent&#x60; - The promotion can be applied to a rentable single video.  * &#x60;rent_episode&#x60; - The promotion can be applied to a rentable single episode.  * &#x60;subscribe&#x60; - 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:  * &#x60;1_week&#x60; - Access lasts for one week.  * &#x60;1_year&#x60; - Access lasts for one year.  * &#x60;24_hour&#x60; - Access lasts for 24 hours.  * &#x60;30_days&#x60; - Access lasts for 30 days.  * &#x60;3_month&#x60; - Access lasts for three months.  * &#x60;48_hour&#x60; - Access lasts for 48 hours.  * &#x60;6_month&#x60; - Access lasts for six months.  * &#x60;72_hour&#x60; - Access lasts for 72 hours.  (required).</param>
 /// <param name="total">When **type** is &#x60;single&#x60;, the total number of times that the promotion can be used. When **type** is &#x60;batch&#x60; or &#x60;batch_prefix&#x60;, 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:  * &#x60;batch&#x60; - The promotion provides a unique promo code for each user.  * &#x60;batch_prefix&#x60; - Like &#x60;batch&#x60;, except that all codes have a similar prefix string. This option is deprecated, yet it may still appear for some users.  * &#x60;single&#x60; - The promotion provides a single promo code for all users.  (required).</param>
 /// <param name="uri">The promotion&#39;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");
 }
Example #2
0
 /// <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&#39;t available in the On Demand container. Use the **download** and **stream_period** fields to define additional characteristics for the &#x60;vip&#x60; type.  Option descriptions:  * &#x60;default&#x60; - The promotion grants a discount on the existing purchase options for an On Demand container.  * &#x60;vip&#x60; - The promotion grants free access to On Demand content before it&#39;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 &#x60;access_type&#x60; is &#x60;vip&#x60;, the value of this field must be &#x60;free&#x60;.  Option descriptions:  * &#x60;free&#x60; - This option reduces the price to zero.  * &#x60;percent&#x60; - 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 &#x60;vip&#x60; or **product_type** is &#x60;buy&#x60;. (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 &#x60;percent&#x60;..</param>
 /// <param name="productType">The type of transaction to which the promotion applies. When **access_type** is &#x60;default&#x60;, the default value is &#x60;any&#x60;. When **access_type** is &#x60;vip&#x60;, the default value is &#x60;rent&#x60;. Also, when **access_type** is &#x60;vip&#x60;, the only valid product types are &#x60;buy&#x60; and &#x60;rent&#x60;..</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 &#x60;vip&#x60; or **product_type** is &#x60;rent&#x60;. (required).</param>
 /// <param name="total">When **type** is &#x60;batch&#x60;, the number of promotions to generate. When **type** is &#x60;single&#x60;, the number of uses of the promotion. (required).</param>
 /// <param name="type">The type of the promotion. When **access_type** is &#x60;vip&#x60;, the value for this field must be &#x60;batch&#x60;.  Option descriptions:  * &#x60;batch&#x60; - This option generates many random promo codes with one use each.  * &#x60;single&#x60; - 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;
 }