From 1180d4af7685a73b44d6b3604bce76aa00062018 Mon Sep 17 00:00:00 2001 From: Joshua Harms Date: Thu, 22 Jun 2023 17:40:31 -0500 Subject: [PATCH] Add missing property documentation --- ShopifySharp/Entities/PriceRule.cs | 101 +++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/ShopifySharp/Entities/PriceRule.cs b/ShopifySharp/Entities/PriceRule.cs index cf2f674a..991b65ed 100644 --- a/ShopifySharp/Entities/PriceRule.cs +++ b/ShopifySharp/Entities/PriceRule.cs @@ -66,6 +66,11 @@ public class PriceRule : ShopifyObject [JsonProperty("customer_selection")] public string CustomerSelection { get; set; } + /** + * The number of times the discount can be allocated on the cart - if eligible. For example a Buy 1 hat Get 1 hat + * for free discount can be applied 3 times on a cart having more than 6 hats, where maximum of 3 hats get + * discounted - if the allocation_limit is 3. Empty (null) allocation_limit means unlimited number of allocations. + */ [JsonProperty("allocation_limit")] public int? AllocationLimit { get; set; } @@ -155,21 +160,117 @@ public class PriceRule : ShopifyObject [JsonProperty("prerequisite_saved_search_ids", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] public IEnumerable PrerequisiteSavedSearchIds { get; set; } + /// + /// A list of customer segment IDs. For the price rule to be applicable, the customer must be in the group of + /// customers matching a customer segment. If this is populated, then + /// must be empty. + /// [JsonProperty("customer_segment_prerequisite_ids", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] public IEnumerable CustomerSegmentPrerequisiteIds { get; set; } + /// + /// The prerequisite purchase for a Buy X Get Y discount. + /// [JsonProperty("prerequisite_to_entitlement_purchase", DefaultValueHandling = DefaultValueHandling.Ignore)] public PrerequisiteToEntitlementPurchase PrerequisiteToEntitlementPurchase { get; set; } + /// + /// List of product ids that will be a prerequisites for a Buy X Get Y type discount. According to Shopify, + /// this can only be used when the following conditions are true: + /// + /// + /// is set to "line_item", + /// + /// + /// is set to "entitled", + /// + /// + /// is set to "each" and + /// + /// + /// is defined. + /// + /// + /// Caution: according to Shopify, if a product variant is included in , + /// then this can't include the ID of the product associated with that variant. + /// [JsonProperty("prerequisite_product_ids", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] public IEnumerable PrerequisiteProductIds { get; set; } + /// + /// List of variant ids that will be a prerequisites for a Buy X Get Y type discount. According to Shopify, + /// this can only be used when the following conditions are true: + /// + /// + /// is set to "line_item", + /// + /// + /// is set to "entitled", + /// + /// + /// is set to "each" and + /// + /// + /// is defined. + /// + /// + /// Caution: according to Shopify, if a product is included in , then this + /// can't include the ID of any variants associated with that product. + /// [JsonProperty("prerequisite_variant_ids", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] public IEnumerable PrerequisiteVariantIds { get; set; } + /// + /// List of collection ids that will be a prerequisites for a Buy X Get Y discount. According to Shopify, + /// this can only be used when the following conditions are true: + /// + /// + /// is set to "line_item", + /// + /// + /// is set to "entitled", + /// + /// + /// is set to "each" and + /// + /// + /// is defined. + /// + /// + /// Caution: according to Shopify, this cannot be used in combination with either + /// or . + /// [JsonProperty("prerequisite_collection_ids", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] public IEnumerable PrerequisiteCollectionIds { get; set; } + /// + /// Buy/Get ratio for a Buy X Get Y discount. + /// defines the necessary 'buy' quantity and + /// defines the offered 'get' quantity. According to Shopify, this can only be used when the following conditions + /// are true: + /// + /// + /// + /// is set to "percentage", + /// + /// + /// is set to "line_item", + /// + /// + /// is set to "entitled", + /// + /// + /// is set to "each", + /// + /// + /// or or are defined and + /// + /// + /// or or are defined. + /// + /// + /// Caution: according to Shopify, this cannot be used in combination with or or . + /// [JsonProperty("prerequisite_to_entitlement_quantity_ratio", DefaultValueHandling = DefaultValueHandling.Ignore)] public PrerequisiteToEntitlementQuantityRatio PrerequisiteToEntitlementQuantityRatio { get; set; } }