From aded8b86bcb6a939ec33346822dd1447686cf6e4 Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 19 Dec 2024 14:46:58 -0800 Subject: [PATCH] updates for latest api version --- src/OrderCloud.SDK/Generated/Models.cs | 17 ++++++++-- src/OrderCloud.SDK/Generated/Resources.cs | 30 ++++++++++++++++++ .../Generated/WebhookPayloads.cs | 31 +++++++++++++++++++ src/OrderCloud.SDK/OrderCloud.SDK.csproj | 2 +- 4 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/OrderCloud.SDK/Generated/Models.cs b/src/OrderCloud.SDK/Generated/Models.cs index a0e06ab..58067c3 100644 --- a/src/OrderCloud.SDK/Generated/Models.cs +++ b/src/OrderCloud.SDK/Generated/Models.cs @@ -785,7 +785,7 @@ public class ExtendedLineItem : OrderCloudModel { /// ID of the order. public string OrderID { get => GetProp("OrderID"); set => SetProp("OrderID", value); } - /// Returned only when include=Order (or include=Order.???) is provided in the query string. + /// Currently unused. public Order Order { get => GetProp("Order"); set => SetProp("Order", value); } /// ID of the extended line item. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable. public string ID { get => GetProp("ID"); set => SetProp("ID", value); } @@ -879,7 +879,7 @@ public class ExtendedLineItemContainer for extended (custom) properties of the extended line item. public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); } - /// Returned only when include=Order (or include=Order.???) is provided in the query string. + /// Currently unused. public new TOrder Order { get => GetProp("Order"); set => SetProp("Order", value); } /// Product of the extended line item. [ApiReadOnly] @@ -1824,6 +1824,8 @@ public class OrderPromotion : OrderCloudModel public bool AutoApply { get => GetProp("AutoApply", false); set => SetProp("AutoApply", value); } /// Active of the order promotion. Sortable. public bool Active { get => GetProp("Active", true); set => SetProp("Active", value); } + /// Use integration of the order promotion. + public bool UseIntegration { get => GetProp("UseIntegration"); set => SetProp("UseIntegration", value); } /// Used to control the order in which promotions are applied when calling the auto apply endpoint. public int? Priority { get => GetProp("Priority"); set => SetProp("Priority", value); } /// Container for extended (custom) properties of the order promotion. @@ -2612,6 +2614,8 @@ public class Promotion : OrderCloudModel public bool AutoApply { get => GetProp("AutoApply", false); set => SetProp("AutoApply", value); } /// Active of the promotion. Sortable. public bool Active { get => GetProp("Active", true); set => SetProp("Active", value); } + /// Use integration of the promotion. + public bool UseIntegration { get => GetProp("UseIntegration"); set => SetProp("UseIntegration", value); } /// Used to control the order in which promotions are applied when calling the auto apply endpoint. public int? Priority { get => GetProp("Priority"); set => SetProp("Priority", value); } /// Container for extended (custom) properties of the promotion. @@ -2634,6 +2638,14 @@ public class PromotionAssignment : OrderCloudModel /// ID of the user group. Sortable: priority level 4. public string UserGroupID { get => GetProp("UserGroupID"); set => SetProp("UserGroupID", value); } } + public class PromotionIntegration : OrderCloudModel + { + /// Security feature that allows your middleware to verify the digital signature in the request header to ensure you only accept trusted data. + [Required] + public string HashKey { get => GetProp("HashKey"); set => SetProp("HashKey", value); } + /// Url of the promotion integration. + public string Url { get => GetProp("Url"); set => SetProp("Url", value); } + } public class PromotionOverride : OrderCloudModel { /// ID of the promotion. @@ -3512,6 +3524,7 @@ public class PartialPromotion : Promotion, IPartial { } /// Specific type of the xp property. If not using a custom type, use the non-generic PartialPromotion class instead. public class PartialPromotion : PartialPromotion { } + public class PartialPromotionIntegration : PromotionIntegration, IPartial { } public class PartialSearchIngestion : SearchIngestion, IPartial { } public class PartialSecurityProfile : SecurityProfile, IPartial { } public class PartialSellerApprovalRule : SellerApprovalRule, IPartial { } diff --git a/src/OrderCloud.SDK/Generated/Resources.cs b/src/OrderCloud.SDK/Generated/Resources.cs index d3a3506..4550a23 100644 --- a/src/OrderCloud.SDK/Generated/Resources.cs +++ b/src/OrderCloud.SDK/Generated/Resources.cs @@ -45,6 +45,7 @@ public partial interface IOrderCloudClient IProductFacetsResource ProductFacets { get; } IProductsResource Products { get; } IProductSyncsResource ProductSyncs { get; } + IPromotionIntegrationsResource PromotionIntegrations { get; } IPromotionsResource Promotions { get; } ISecurityProfilesResource SecurityProfiles { get; } ISellerApprovalRulesResource SellerApprovalRules { get; } @@ -5022,6 +5023,24 @@ public interface IProductSyncsResource Task PatchAsync(PartialProductSyncConfig partialProductSyncConfig, string accessToken = null); } + public interface IPromotionIntegrationsResource + { + /// Get a single promotion integration. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task GetAsync(string accessToken = null); + /// Delete a promotion integration. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task DeleteAsync(string accessToken = null); + /// Create or update a promotion integration. If an object with the same ID already exists, it will be overwritten. + /// The object that will be serialized to JSON and sent in the request body. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task SaveAsync(PromotionIntegration promotionIntegration, string accessToken = null); + /// Partially update a promotion integration. + /// The object that will be partially serialized to JSON and sent in the request body. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task PatchAsync(PartialPromotionIntegration partialPromotionIntegration, string accessToken = null); + } + public interface IPromotionsResource { /// Get a single promotion. @@ -6624,6 +6643,7 @@ private void InitResources() { ProductFacets = new ProductFacetsResource(this); Products = new ProductsResource(this); ProductSyncs = new ProductSyncsResource(this); + PromotionIntegrations = new PromotionIntegrationsResource(this); Promotions = new PromotionsResource(this); SecurityProfiles = new SecurityProfilesResource(this); SellerApprovalRules = new SellerApprovalRulesResource(this); @@ -6683,6 +6703,7 @@ private void InitResources() { public IProductFacetsResource ProductFacets { get; private set; } public IProductsResource Products { get; private set; } public IProductSyncsResource ProductSyncs { get; private set; } + public IPromotionIntegrationsResource PromotionIntegrations { get; private set; } public IPromotionsResource Promotions { get; private set; } public ISecurityProfilesResource SecurityProfiles { get; private set; } public ISellerApprovalRulesResource SellerApprovalRules { get; private set; } @@ -7720,6 +7741,15 @@ internal ProductSyncsResource(OrderCloudClient client) : base(client) { } public Task PatchAsync(PartialProductSyncConfig partialProductSyncConfig, string accessToken = null) => Request("v1", "integrations", "productsync").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialProductSyncConfig)).ReceiveJson(); } + public class PromotionIntegrationsResource : OrderCloudResource, IPromotionIntegrationsResource + { + internal PromotionIntegrationsResource(OrderCloudClient client) : base(client) { } + public Task GetAsync(string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).GetJsonAsync(); + public Task DeleteAsync(string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).DeleteAsync(); + public Task SaveAsync(PromotionIntegration promotionIntegration, string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(promotionIntegration)).ReceiveJson(); + public Task PatchAsync(PartialPromotionIntegration partialPromotionIntegration, string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialPromotionIntegration)).ReceiveJson(); + } + public class PromotionsResource : OrderCloudResource, IPromotionsResource { internal PromotionsResource(OrderCloudClient client) : base(client) { } diff --git a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs index addf047..40433c1 100644 --- a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs +++ b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs @@ -4048,6 +4048,37 @@ public class Patch : WebhookPayloadWebhook payload sent by OrderCloud on DELETE v1/integrations/promotion. + [SentOn("DELETE", "v1/integrations/promotion")] + public class Delete : WebhookPayload { } + /// Webhook payload sent by OrderCloud on DELETE v1/integrations/promotion. + /// Specific type of the ConfigData. If not using a custom type, use the non-generic payload type instead. + [SentOn("DELETE", "v1/integrations/promotion")] + public class Delete : WebhookPayload + { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/promotion. + [SentOn("PUT", "v1/integrations/promotion")] + public class Save : WebhookPayload { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/promotion. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the PromotionIntegration. If not using a custom type, specify PromotionIntegration. + [SentOn("PUT", "v1/integrations/promotion")] + public class Save : WebhookPayload + where TPromotionIntegration : PromotionIntegration + { } + /// Webhook payload sent by OrderCloud on PATCH v1/integrations/promotion. + [SentOn("PATCH", "v1/integrations/promotion")] + public class Patch : WebhookPayload { } + /// Webhook payload sent by OrderCloud on PATCH v1/integrations/promotion. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the PromotionIntegration. If not using a custom type, specify PromotionIntegration. + [SentOn("PATCH", "v1/integrations/promotion")] + public class Patch : WebhookPayload + where TPromotionIntegration : PromotionIntegration + { } + } public static class Promotions { /// Webhook payload sent by OrderCloud on POST v1/promotions. diff --git a/src/OrderCloud.SDK/OrderCloud.SDK.csproj b/src/OrderCloud.SDK/OrderCloud.SDK.csproj index 83b6237..7954d6a 100644 --- a/src/OrderCloud.SDK/OrderCloud.SDK.csproj +++ b/src/OrderCloud.SDK/OrderCloud.SDK.csproj @@ -4,7 +4,7 @@ netstandard2.0;net461 True - 0.17.0 + 0.17.1 OrderCloud.SDK OrderCloud SDK Todd Menier