From 72c143abb3ec98ea9a3e53ce49875e6edbc588a8 Mon Sep 17 00:00:00 2001 From: DJ Steinmetz Date: Thu, 5 Sep 2024 09:54:34 -0400 Subject: [PATCH] updates for latest api version --- src/OrderCloud.SDK/Generated/ErrorCodes.cs | 8 +++++++- src/OrderCloud.SDK/Generated/Models.cs | 8 ++++++-- src/OrderCloud.SDK/Generated/Resources.cs | 13 +++++++++++++ .../Generated/WebhookPayloads.cs | 18 ++++++++++++++++++ src/OrderCloud.SDK/OrderCloud.SDK.csproj | 2 +- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/OrderCloud.SDK/Generated/ErrorCodes.cs b/src/OrderCloud.SDK/Generated/ErrorCodes.cs index bc0be49..fd9867b 100644 --- a/src/OrderCloud.SDK/Generated/ErrorCodes.cs +++ b/src/OrderCloud.SDK/Generated/ErrorCodes.cs @@ -145,6 +145,8 @@ public static class Category public const string InvalidDepth = "Category.InvalidDepth"; /// Buyer not specified. public const string NoBuyer = "Category.NoBuyer"; + /// Cannot assign a child product to a category in a catalog different from parent one. + public const string CannotAssignChildProduct = "Category.CannotAssignChildProduct"; } public static class CreditCard { @@ -606,7 +608,11 @@ public static class Promotion public const string NotActive = "Promotion.NotActive"; /// LineItemLevel must be true in order to use ItemLimitPerOrder. public const string CannotSetItemLimitPerOrder = "Promotion.CannotSetItemLimitPerOrder"; - /// LineItemLevel must be true and ItemLimitPerOrder must have a value in order to use ItemSortBy. + /// LineItemLevel must be true in order to use QuantityLimitPerOrder. + public const string CannotSetQuantityLimitPerOrder = "Promotion.CannotSetQuantityLimitPerOrder"; + /// QuantityLimitPerOrder is not supported in conjuction with ItemLimitPerOrder. + public const string CannotSetQuantityAndItemLimitPerOrder = "Promotion.CannotSetQuantityAndItemLimitPerOrder"; + /// LineItemLevel must be true and ItemLimitPerOrder or QuantityLimitPerOrder must have a value in order to use ItemSortBy. public const string CannotSetItemSortBy = "Promotion.CannotSetItemSortBy"; } public static class Registration diff --git a/src/OrderCloud.SDK/Generated/Models.cs b/src/OrderCloud.SDK/Generated/Models.cs index 25b72c1..3255d25 100644 --- a/src/OrderCloud.SDK/Generated/Models.cs +++ b/src/OrderCloud.SDK/Generated/Models.cs @@ -1752,7 +1752,9 @@ public class OrderPromotion : OrderCloudModel /// The number of times this promotion has been applied to an order. [ApiReadOnly] public int RedemptionCount { get => GetProp("RedemptionCount"); set => SetProp("RedemptionCount", value); } - /// Can only be used when LineItemLevel is true. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. + /// Can only be used when LineItemLevel is true and ItemLimitPerOrder does not have a value. When defined the ValueExpression will be the discount applied to each qualifying quantity of eligible items. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. + public int? QuantityLimitPerOrder { get => GetProp("QuantityLimitPerOrder"); set => SetProp("QuantityLimitPerOrder", value); } + /// Can only be used when LineItemLevel is true and QuantityLimitPerOrder does not have a value. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. public int? ItemLimitPerOrder { get => GetProp("ItemLimitPerOrder"); set => SetProp("ItemLimitPerOrder", value); } /// Comma delimited list of properties to sort by. Can only be used when ItemLimitPerOrder is true. Used to determine the order in which the promotion is applied to the specified limit of items. Use ! to reverse sort order on a property. public string ItemSortBy { get => GetProp("ItemSortBy"); set => SetProp("ItemSortBy", value); } @@ -2403,7 +2405,9 @@ public class Promotion : OrderCloudModel /// The number of times this promotion has been applied to an order. [ApiReadOnly] public int RedemptionCount { get => GetProp("RedemptionCount"); set => SetProp("RedemptionCount", value); } - /// Can only be used when LineItemLevel is true. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. + /// Can only be used when LineItemLevel is true and ItemLimitPerOrder does not have a value. When defined the ValueExpression will be the discount applied to each qualifying quantity of eligible items. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. + public int? QuantityLimitPerOrder { get => GetProp("QuantityLimitPerOrder"); set => SetProp("QuantityLimitPerOrder", value); } + /// Can only be used when LineItemLevel is true and QuantityLimitPerOrder does not have a value. Limits the number of items the promotion will apply to when eligible. When no ItemSortBy is defined, items will be sorted by DateAdded ascending. public int? ItemLimitPerOrder { get => GetProp("ItemLimitPerOrder"); set => SetProp("ItemLimitPerOrder", value); } /// Comma delimited list of properties to sort by. Can only be used when ItemLimitPerOrder is true. Used to determine the order in which the promotion is applied to the specified limit of items. Use ! to reverse sort order on a property. public string ItemSortBy { get => GetProp("ItemSortBy"); set => SetProp("ItemSortBy", value); } diff --git a/src/OrderCloud.SDK/Generated/Resources.cs b/src/OrderCloud.SDK/Generated/Resources.cs index fd8ec4a..36af83e 100644 --- a/src/OrderCloud.SDK/Generated/Resources.cs +++ b/src/OrderCloud.SDK/Generated/Resources.cs @@ -1738,6 +1738,16 @@ public interface IEntitySyncsResource /// 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 SaveAdminUsersEntitySyncConfigAsync(EntitySyncConfig entitySyncConfig, string accessToken = null); + /// Get the entity sync delivery configuration for InventoryRecords Get the entity sync delivery configuration for InventoryRecords + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task GetInventoryRecordEntitySyncConfigAsync(string accessToken = null); + /// Delete the entity sync delivery configuration for InventoryRecords Delete the entity sync delivery configuration for InventoryRecords + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task DeleteInventoryRecordEntitySyncConfigAsync(string accessToken = null); + /// Create or update the entity sync delivery configuration for InventoryRecords Create or update the entity sync delivery configuration for InventoryRecords + /// 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 SaveInventoryRecordEntitySyncConfigAsync(EntitySyncConfig entitySyncConfig, string accessToken = null); } public interface IErrorConfigsResource @@ -6967,6 +6977,9 @@ internal EntitySyncsResource(OrderCloudClient client) : base(client) { } public Task GetAdminUsersEntitySyncConfigAsync(string accessToken = null) => Request("v1", "integrations", "entitysync", "adminusers").WithOAuthBearerToken(accessToken).GetJsonAsync(); public Task DeleteAdminUsersEntitySyncConfigAsync(string accessToken = null) => Request("v1", "integrations", "entitysync", "adminusers").WithOAuthBearerToken(accessToken).DeleteAsync(); public Task SaveAdminUsersEntitySyncConfigAsync(EntitySyncConfig entitySyncConfig, string accessToken = null) => Request("v1", "integrations", "entitysync", "adminusers").WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(entitySyncConfig)).ReceiveJson(); + public Task GetInventoryRecordEntitySyncConfigAsync(string accessToken = null) => Request("v1", "integrations", "entitysync", "products", "inventoryrecords").WithOAuthBearerToken(accessToken).GetJsonAsync(); + public Task DeleteInventoryRecordEntitySyncConfigAsync(string accessToken = null) => Request("v1", "integrations", "entitysync", "products", "inventoryrecords").WithOAuthBearerToken(accessToken).DeleteAsync(); + public Task SaveInventoryRecordEntitySyncConfigAsync(EntitySyncConfig entitySyncConfig, string accessToken = null) => Request("v1", "integrations", "entitysync", "products", "inventoryrecords").WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(entitySyncConfig)).ReceiveJson(); } public class ErrorConfigsResource : OrderCloudResource, IErrorConfigsResource diff --git a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs index 79bea69..d57082d 100644 --- a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs +++ b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs @@ -1643,6 +1643,24 @@ public class SaveAdminUsersEntitySyncConfig : WebhookPayload : WebhookPayload where TEntitySyncConfig : EntitySyncConfig { } + /// Webhook payload sent by OrderCloud on DELETE v1/integrations/entitysync/products/inventoryrecords. + [SentOn("DELETE", "v1/integrations/entitysync/products/inventoryrecords")] + public class DeleteInventoryRecordEntitySyncConfig : WebhookPayload { } + /// Webhook payload sent by OrderCloud on DELETE v1/integrations/entitysync/products/inventoryrecords. + /// Specific type of the ConfigData. If not using a custom type, use the non-generic payload type instead. + [SentOn("DELETE", "v1/integrations/entitysync/products/inventoryrecords")] + public class DeleteInventoryRecordEntitySyncConfig : WebhookPayload + { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/entitysync/products/inventoryrecords. + [SentOn("PUT", "v1/integrations/entitysync/products/inventoryrecords")] + public class SaveInventoryRecordEntitySyncConfig : WebhookPayload { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/entitysync/products/inventoryrecords. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the EntitySyncConfig. If not using a custom type, specify EntitySyncConfig. + [SentOn("PUT", "v1/integrations/entitysync/products/inventoryrecords")] + public class SaveInventoryRecordEntitySyncConfig : WebhookPayload + where TEntitySyncConfig : EntitySyncConfig + { } } public static class ErrorConfigs { diff --git a/src/OrderCloud.SDK/OrderCloud.SDK.csproj b/src/OrderCloud.SDK/OrderCloud.SDK.csproj index 5ace7cd..2bb9c28 100644 --- a/src/OrderCloud.SDK/OrderCloud.SDK.csproj +++ b/src/OrderCloud.SDK/OrderCloud.SDK.csproj @@ -4,7 +4,7 @@ netstandard2.0;net461 True - 0.14.1 + 0.14.2 OrderCloud.SDK OrderCloud SDK Todd Menier