From 80eb7d4880c7f06a4fd40c324655aa8ec97223e4 Mon Sep 17 00:00:00 2001 From: DJ Steinmetz Date: Wed, 4 Dec 2024 17:11:57 -0500 Subject: [PATCH] updates for latest api version Return type change on Inventory Records ListEntriesAsync --- src/OrderCloud.SDK/Generated/ErrorCodes.cs | 9 ++ src/OrderCloud.SDK/Generated/Models.cs | 147 +++++++++++++++++- src/OrderCloud.SDK/Generated/Resources.cs | 72 ++++++--- .../Generated/WebhookPayloads.cs | 46 ++++++ src/OrderCloud.SDK/OrderCloud.SDK.csproj | 3 +- 5 files changed, 257 insertions(+), 20 deletions(-) diff --git a/src/OrderCloud.SDK/Generated/ErrorCodes.cs b/src/OrderCloud.SDK/Generated/ErrorCodes.cs index d3eae85..95f23d4 100644 --- a/src/OrderCloud.SDK/Generated/ErrorCodes.cs +++ b/src/OrderCloud.SDK/Generated/ErrorCodes.cs @@ -94,6 +94,8 @@ public static class Auth public const string ClientIDAndEmailRequired = "Auth.ClientIDAndEmailRequired"; /// The provided token has been revoked. Please re-authenticate. public const string TokenRevoked = "Auth.TokenRevoked"; + /// Features in beta are subject to change and are not available in production. + public const string BetaForbiddenProduction = "Auth.BetaForbiddenProduction"; } public static class BillingAddress { @@ -257,6 +259,13 @@ public static class InventoryConfiguration /// Product.Inventory.VariantLevelTracking must be false in order to create InventoryRecords at the product level, and true in order to create InventoryRecords at the variant level. public const string InvalidVariantLevelTracking = "InventoryConfiguration.InvalidVariantLevelTracking"; } + public static class InventoryIntegration + { + /// Inventory integration returned the error. + public const string IntegrationErrorReturned = "InventoryIntegration.IntegrationErrorReturned"; + /// DeliveryConfigID is required for InventoryIntegration. + public const string DeliveryConfigIDRequired = "InventoryIntegration.DeliveryConfigIDRequired"; + } public static class InventoryRecord { /// Cannot delete an InventoryRecord referenced on a line item from an open order, or an order pending approval. diff --git a/src/OrderCloud.SDK/Generated/Models.cs b/src/OrderCloud.SDK/Generated/Models.cs index 76e7ad6..a0e06ab 100644 --- a/src/OrderCloud.SDK/Generated/Models.cs +++ b/src/OrderCloud.SDK/Generated/Models.cs @@ -1073,7 +1073,7 @@ public class Inventory : OrderCloudModel { /// If true, inventory will be tracked and enforced. public bool Enabled { get => GetProp("Enabled"); set => SetProp("Enabled", value); } - /// For reference only, does not influence any OrderCloud behavior at this time. + /// Notification point of the inventory. public int? NotificationPoint { get => GetProp("NotificationPoint"); set => SetProp("NotificationPoint", value); } /// If true, QuantityAvailable will be determined at the Variant level. public bool VariantLevelTracking { get => GetProp("VariantLevelTracking"); set => SetProp("VariantLevelTracking", value); } @@ -1085,6 +1085,14 @@ public class Inventory : OrderCloudModel [ApiReadOnly] public DateTimeOffset? LastUpdated { get => GetProp("LastUpdated"); set => SetProp("LastUpdated", value); } } + public class InventoryIntegration : OrderCloudModel + { + /// ID of the delivery config. Required. + [Required] + public string DeliveryConfigID { get => GetProp("DeliveryConfigID"); set => SetProp("DeliveryConfigID", value); } + /// Notification point only of the inventory integration. + public bool NotificationPointOnly { get => GetProp("NotificationPointOnly"); set => SetProp("NotificationPointOnly", value); } + } public class InventoryRecord : OrderCloudModel { /// ID of the inventory record. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 1. @@ -2320,6 +2328,79 @@ public class ProductCollection : ProductCollection /// Container for extended (custom) properties of the product collection. public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); } } + public class ProductCollectionBuyerProduct : OrderCloudModel + { + /// List order of the product collection buyer product. + public int? ListOrder { get => GetProp("ListOrder"); set => SetProp("ListOrder", value); } + /// Date added of the product collection buyer product. + public DateTimeOffset? DateAdded { get => GetProp("DateAdded"); set => SetProp("DateAdded", value); } + /// Price schedule of the product collection buyer product. + [ApiReadOnly] + public PriceSchedule PriceSchedule { get => GetProp("PriceSchedule"); set => SetProp("PriceSchedule", value); } + /// ID of the product collection buyer product. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 3. + public string ID { get => GetProp("ID"); set => SetProp("ID", value); } + /// ID of the parent product. If not null, IsParent should be false + public string ParentID { get => GetProp("ParentID"); set => SetProp("ParentID", value); } + /// If true, ParentID must be null, as a parent product cannot have a parent itself. + public bool IsParent { get => GetProp("IsParent"); set => SetProp("IsParent", value); } + /// If true, IsParent must be false, as a parent product cannot be a bundle. + [ApiReadOnly] + public bool IsBundle { get => GetProp("IsBundle"); set => SetProp("IsBundle", value); } + /// Name of the product collection buyer product. Required. Max length 100 characters. Searchable: priority level 3. Sortable: priority level 2. + [Required] + public string Name { get => GetProp("Name"); set => SetProp("Name", value); } + /// Description of the product collection buyer product. Max length 2000 characters. Searchable: priority level 4. + public string Description { get => GetProp("Description"); set => SetProp("Description", value); } + /// For reference only, does not influence any OrderCloud behavior. Used to indicate an amount per Quantity. + public int? QuantityMultiplier { get => GetProp("QuantityMultiplier", 1); set => SetProp("QuantityMultiplier", value); } + /// Ship weight of the product collection buyer product. + public decimal? ShipWeight { get => GetProp("ShipWeight"); set => SetProp("ShipWeight", value); } + /// Ship height of the product collection buyer product. + public decimal? ShipHeight { get => GetProp("ShipHeight"); set => SetProp("ShipHeight", value); } + /// Ship width of the product collection buyer product. + public decimal? ShipWidth { get => GetProp("ShipWidth"); set => SetProp("ShipWidth", value); } + /// Ship length of the product collection buyer product. + public decimal? ShipLength { get => GetProp("ShipLength"); set => SetProp("ShipLength", value); } + /// If false, product is not visible or purchasable from the Shopper perspective. + public bool Active { get => GetProp("Active"); set => SetProp("Active", value); } + /// Count of Specs assigned to the product. + [ApiReadOnly] + public int SpecCount { get => GetProp("SpecCount"); set => SetProp("SpecCount", value); } + /// Count of Variants generated from the product/spec combinations. + [ApiReadOnly] + public int VariantCount { get => GetProp("VariantCount"); set => SetProp("VariantCount", value); } + /// Marketplace Owner or Supplier AddressID where the product will be shipped from. Can be used to calculate shipping costs. + public string ShipFromAddressID { get => GetProp("ShipFromAddressID"); set => SetProp("ShipFromAddressID", value); } + /// Inventory of the product collection buyer product. + public Inventory Inventory { get => GetProp("Inventory"); set => SetProp("Inventory", value); } + /// If this property has a value and a SupplierID isn't explicitly passed when creating a LineItem, this SupplierID will be used. + public string DefaultSupplierID { get => GetProp("DefaultSupplierID"); set => SetProp("DefaultSupplierID", value); } + /// If true, all suppliers are eligible to opt into selling this product. + public bool AllSuppliersCanSell { get => GetProp("AllSuppliersCanSell"); set => SetProp("AllSuppliersCanSell", value); } + /// Returnable of the product collection buyer product. + public bool Returnable { get => GetProp("Returnable"); set => SetProp("Returnable", value); } + /// Container for extended (custom) properties of the product collection buyer product. + public dynamic xp { get => GetProp("xp", new ExpandoObject()); set => SetProp("xp", value); } + } + /// Specific type of the xp property. If not using a custom type, specify dynamic. + /// Specific type of the PriceSchedule property. If not using a custom type, specify PriceSchedule. + public class ProductCollectionBuyerProduct : ProductCollectionBuyerProduct + where TPriceSchedule : PriceSchedule + { + /// Container for extended (custom) properties of the product collection buyer product. + public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); } + /// Price schedule of the product collection buyer product. + [ApiReadOnly] + public new TPriceSchedule PriceSchedule { get => GetProp("PriceSchedule"); set => SetProp("PriceSchedule", value); } + } + public class ProductCollectionEntry : OrderCloudModel + { + /// ID of the product. Required. + [Required] + public string ProductID { get => GetProp("ProductID"); set => SetProp("ProductID", value); } + /// List order of the product collection entry. + public int? ListOrder { get => GetProp("ListOrder"); set => SetProp("ListOrder", value); } + } public class ProductCollectionInvitation : OrderCloudModel { /// ID of the product collection invitation. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 2. @@ -2344,6 +2425,69 @@ public class ProductCollectionInvitation : ProductCollectionInvitation /// Container for extended (custom) properties of the product collection invitation. public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); } } + public class ProductCollectionProduct : OrderCloudModel + { + /// List order of the product collection product. + public int? ListOrder { get => GetProp("ListOrder"); set => SetProp("ListOrder", value); } + /// Date added of the product collection product. + public DateTimeOffset? DateAdded { get => GetProp("DateAdded"); set => SetProp("DateAdded", value); } + /// ID of the organization that owns the Product. Only the Marketplace Owner can override the OwnerID on create. + public string OwnerID { get => GetProp("OwnerID"); set => SetProp("OwnerID", value); } + /// When provided, no explicit PriceSchedule assignment is required. When a PriceSchedule assignment exists, it will override any default provided. + public string DefaultPriceScheduleID { get => GetProp("DefaultPriceScheduleID"); set => SetProp("DefaultPriceScheduleID", value); } + /// If true, when this product is ordered by a Buyer, it will automatically be added to a new Order from the Marketplace Owner to the Default Supplier and submitted. Requires a valid DefaultSupplierID. + public bool AutoForward { get => GetProp("AutoForward"); set => SetProp("AutoForward", value); } + /// ID of the product collection product. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 3. + public string ID { get => GetProp("ID"); set => SetProp("ID", value); } + /// ID of the parent product. If not null, IsParent should be false + public string ParentID { get => GetProp("ParentID"); set => SetProp("ParentID", value); } + /// If true, ParentID must be null, as a parent product cannot have a parent itself. + public bool IsParent { get => GetProp("IsParent"); set => SetProp("IsParent", value); } + /// If true, IsParent must be false, as a parent product cannot be a bundle. + [ApiReadOnly] + public bool IsBundle { get => GetProp("IsBundle"); set => SetProp("IsBundle", value); } + /// Name of the product collection product. Required. Max length 100 characters. Searchable: priority level 3. Sortable: priority level 2. + [Required] + public string Name { get => GetProp("Name"); set => SetProp("Name", value); } + /// Description of the product collection product. Max length 2000 characters. Searchable: priority level 4. + public string Description { get => GetProp("Description"); set => SetProp("Description", value); } + /// For reference only, does not influence any OrderCloud behavior. Used to indicate an amount per Quantity. + public int? QuantityMultiplier { get => GetProp("QuantityMultiplier", 1); set => SetProp("QuantityMultiplier", value); } + /// Ship weight of the product collection product. + public decimal? ShipWeight { get => GetProp("ShipWeight"); set => SetProp("ShipWeight", value); } + /// Ship height of the product collection product. + public decimal? ShipHeight { get => GetProp("ShipHeight"); set => SetProp("ShipHeight", value); } + /// Ship width of the product collection product. + public decimal? ShipWidth { get => GetProp("ShipWidth"); set => SetProp("ShipWidth", value); } + /// Ship length of the product collection product. + public decimal? ShipLength { get => GetProp("ShipLength"); set => SetProp("ShipLength", value); } + /// If false, product is not visible or purchasable from the Shopper perspective. + public bool Active { get => GetProp("Active"); set => SetProp("Active", value); } + /// Count of Specs assigned to the product. + [ApiReadOnly] + public int SpecCount { get => GetProp("SpecCount"); set => SetProp("SpecCount", value); } + /// Count of Variants generated from the product/spec combinations. + [ApiReadOnly] + public int VariantCount { get => GetProp("VariantCount"); set => SetProp("VariantCount", value); } + /// Marketplace Owner or Supplier AddressID where the product will be shipped from. Can be used to calculate shipping costs. + public string ShipFromAddressID { get => GetProp("ShipFromAddressID"); set => SetProp("ShipFromAddressID", value); } + /// Inventory of the product collection product. + public Inventory Inventory { get => GetProp("Inventory"); set => SetProp("Inventory", value); } + /// If this property has a value and a SupplierID isn't explicitly passed when creating a LineItem, this SupplierID will be used. + public string DefaultSupplierID { get => GetProp("DefaultSupplierID"); set => SetProp("DefaultSupplierID", value); } + /// If true, all suppliers are eligible to opt into selling this product. + public bool AllSuppliersCanSell { get => GetProp("AllSuppliersCanSell"); set => SetProp("AllSuppliersCanSell", value); } + /// Returnable of the product collection product. + public bool Returnable { get => GetProp("Returnable"); set => SetProp("Returnable", value); } + /// Container for extended (custom) properties of the product collection product. + public dynamic xp { get => GetProp("xp", new ExpandoObject()); set => SetProp("xp", value); } + } + /// Specific type of the xp property. If not using a custom type, use the non-generic ProductCollectionProduct class instead. + public class ProductCollectionProduct : ProductCollectionProduct + { + /// Container for extended (custom) properties of the product collection product. + public new Txp xp { get => GetProp("xp"); set => SetProp("xp", value); } + } public class ProductFacet : OrderCloudModel { /// ID of the product facet. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable: priority level 2. @@ -3273,6 +3417,7 @@ public class PartialImpersonationConfig : ImpersonationConfig, IPartial { } public class PartialIncrementor : Incrementor, IPartial { } public class PartialIntegrationEvent : IntegrationEvent, IPartial { } public class PartialInventory : Inventory, IPartial { } + public class PartialInventoryIntegration : InventoryIntegration, IPartial { } public class PartialInventoryRecord : InventoryRecord, IPartial { } /// Specific type of the xp property. If not using a custom type, specify dynamic. /// Specific type of the Address property. If not using a custom type, specify Address. diff --git a/src/OrderCloud.SDK/Generated/Resources.cs b/src/OrderCloud.SDK/Generated/Resources.cs index fa5a7b1..d3a3506 100644 --- a/src/OrderCloud.SDK/Generated/Resources.cs +++ b/src/OrderCloud.SDK/Generated/Resources.cs @@ -29,6 +29,7 @@ public partial interface IOrderCloudClient IImpersonationConfigsResource ImpersonationConfigs { get; } IIncrementorsResource Incrementors { get; } IIntegrationEventsResource IntegrationEvents { get; } + IInventoryIntegrationsResource InventoryIntegrations { get; } IInventoryRecordsResource InventoryRecords { get; } ILineItemsResource LineItems { get; } ILocalesResource Locales { get; } @@ -2012,6 +2013,24 @@ public interface IIntegrationEventsResource Task CalculateAsync(OrderDirection direction, string orderID, string accessToken = null) where TOrderWorksheet : OrderWorksheet; } + public interface IInventoryIntegrationsResource + { + /// Get a single inventory integration. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task GetAsync(string accessToken = null); + /// Delete an inventory integration. + /// Optional. Use to provide an existing token instead of authenticating implicitly. + Task DeleteAsync(string accessToken = null); + /// Create or update an inventory 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(InventoryIntegration inventoryIntegration, string accessToken = null); + /// Partially update an inventory 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(PartialInventoryIntegration partialInventoryIntegration, string accessToken = null); + } + public interface IInventoryRecordsResource { /// Get a single inventory record. @@ -3270,7 +3289,7 @@ public interface IMeResource /// Number of results to return per page. Default: 20, max: 100. /// An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null); + Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null); /// Get a list of product collection entries visible to this user. Only available to Buyer Users. /// ID of the product collection. /// Word or phrase to search for. @@ -3281,22 +3300,27 @@ public interface IMeResource /// Number of results to return per page. Default: 20, max: 100. /// An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TBuyerProduct : BuyerProduct; + Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProductCollectionBuyerProduct : ProductCollectionBuyerProduct; /// Get a list of product collection entries visible to this user. Only available to Buyer Users. /// ID of the product collection. /// A lambda or function for specifying various list options fluently. /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null); + Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null); /// Get a list of product collection entries visible to this user. Only available to Buyer Users. /// ID of the product collection. /// A lambda or function for specifying various list options fluently. /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) where TBuyerProduct : BuyerProduct; + Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) where TProductCollectionBuyerProduct : ProductCollectionBuyerProduct; /// Create a new product collection entry. Only available to Buyer Users. /// ID of the product collection. /// ID of the product. /// Optional. Use to provide an existing token instead of authenticating implicitly. Task CreateProductCollectionEntryAsync(string productCollectionID, string productID, string accessToken = null); + /// Create or update a product collection entry. Only available to Buyer Users. + /// ID of the product collection. + /// 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 SaveProductCollectionEntryAsync(string productCollectionID, ProductCollectionEntry productCollectionEntry, string accessToken = null); /// Delete a product collection entry. Only available to Buyer Users. /// ID of the product collection. /// ID of the product. @@ -4631,7 +4655,7 @@ public interface IProductCollectionsResource /// Number of results to return per page. Default: 20, max: 100. /// An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null); + Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null); /// Get a list of product collection entries. /// ID of the buyer. /// ID of the product collection. @@ -4643,19 +4667,19 @@ public interface IProductCollectionsResource /// Number of results to return per page. Default: 20, max: 100. /// An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProduct : Product; + Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProductCollectionProduct : ProductCollectionProduct; /// Get a list of product collection entries. /// ID of the buyer. /// ID of the product collection. /// A lambda or function for specifying various list options fluently. /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null); + Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null); /// Get a list of product collection entries. /// ID of the buyer. /// ID of the product collection. /// A lambda or function for specifying various list options fluently. /// Optional. Use to provide an existing token instead of authenticating implicitly. - Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) where TProduct : Product; + Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) where TProductCollectionProduct : ProductCollectionProduct; } public interface IProductFacetsResource @@ -5464,12 +5488,12 @@ public interface ISpecsResource /// 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 SaveProductAssignmentAsync(SpecProductAssignment specProductAssignment, string accessToken = null); - /// Create a new spec option. A Spec can have multiple Options-- for example, if the spec is called 'Color', the options might be 'Blue', 'Red', and 'Green'. + /// Create a new spec option. A Spec can have multiple Options-- for example, if the spec is called 'Color', the options might be 'Blue', 'Red', and 'Green'. /// ID of the spec. /// 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 CreateOptionAsync(string specID, SpecOption specOption, string accessToken = null); - /// Create a new spec option. A Spec can have multiple Options-- for example, if the spec is called 'Color', the options might be 'Blue', 'Red', and 'Green'. + /// Create a new spec option. A Spec can have multiple Options-- for example, if the spec is called 'Color', the options might be 'Blue', 'Red', and 'Green'. /// ID of the spec. /// 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. @@ -6584,6 +6608,7 @@ private void InitResources() { ImpersonationConfigs = new ImpersonationConfigsResource(this); Incrementors = new IncrementorsResource(this); IntegrationEvents = new IntegrationEventsResource(this); + InventoryIntegrations = new InventoryIntegrationsResource(this); InventoryRecords = new InventoryRecordsResource(this); LineItems = new LineItemsResource(this); Locales = new LocalesResource(this); @@ -6642,6 +6667,7 @@ private void InitResources() { public IImpersonationConfigsResource ImpersonationConfigs { get; private set; } public IIncrementorsResource Incrementors { get; private set; } public IIntegrationEventsResource IntegrationEvents { get; private set; } + public IInventoryIntegrationsResource InventoryIntegrations { get; private set; } public IInventoryRecordsResource InventoryRecords { get; private set; } public ILineItemsResource LineItems { get; private set; } public ILocalesResource Locales { get; private set; } @@ -7145,6 +7171,15 @@ internal IntegrationEventsResource(OrderCloudClient client) : base(client) { } public Task CalculateAsync(OrderDirection direction, string orderID, string accessToken = null) where TOrderWorksheet : OrderWorksheet => Request("v1", "orders", direction, orderID, "calculate").WithOAuthBearerToken(accessToken).PostAsync(null).ReceiveJson(); } + public class InventoryIntegrationsResource : OrderCloudResource, IInventoryIntegrationsResource + { + internal InventoryIntegrationsResource(OrderCloudClient client) : base(client) { } + public Task GetAsync(string accessToken = null) => Request("v1", "integrations", "inventory").WithOAuthBearerToken(accessToken).GetJsonAsync(); + public Task DeleteAsync(string accessToken = null) => Request("v1", "integrations", "inventory").WithOAuthBearerToken(accessToken).DeleteAsync(); + public Task SaveAsync(InventoryIntegration inventoryIntegration, string accessToken = null) => Request("v1", "integrations", "inventory").WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(inventoryIntegration)).ReceiveJson(); + public Task PatchAsync(PartialInventoryIntegration partialInventoryIntegration, string accessToken = null) => Request("v1", "integrations", "inventory").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialInventoryIntegration)).ReceiveJson(); + } + public class InventoryRecordsResource : OrderCloudResource, IInventoryRecordsResource { internal InventoryRecordsResource(OrderCloudClient client) : base(client) { } @@ -7350,11 +7385,12 @@ internal MeResource(OrderCloudClient client) : base(client) { } public Task SaveProductCollectionAsync(string productCollectionID, ProductCollection productCollection, string accessToken = null) => SaveProductCollectionAsync(productCollectionID, productCollection, accessToken); public Task SaveProductCollectionAsync(string productCollectionID, ProductCollection productCollection, string accessToken = null) where TProductCollection : ProductCollection => Request("v1", "me", "productcollections", productCollectionID).WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(productCollection)).ReceiveJson(); public Task DeleteProductCollectionAsync(string productCollectionID, string accessToken = null) => Request("v1", "me", "productcollections", productCollectionID).WithOAuthBearerToken(accessToken).DeleteAsync(); - public Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) => ListProductCollectionEntriesAsync(productCollectionID, search, searchOn, searchType, sortBy, page, pageSize, filters, accessToken); - public Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TBuyerProduct : BuyerProduct => Request("v1", "me", "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetQueryParams(new { search, searchOn, searchType, sortBy, page, pageSize }).SetQueryParams(filters).GetJsonAsync>(); - public Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) => ListProductCollectionEntriesAsync(productCollectionID, buildListOpts, accessToken); - public Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) where TBuyerProduct : BuyerProduct => Request("v1", "me", "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetListOptions(buildListOpts).GetJsonAsync>(); + public Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) => ListProductCollectionEntriesAsync(productCollectionID, search, searchOn, searchType, sortBy, page, pageSize, filters, accessToken); + public Task> ListProductCollectionEntriesAsync(string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProductCollectionBuyerProduct : ProductCollectionBuyerProduct => Request("v1", "me", "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetQueryParams(new { search, searchOn, searchType, sortBy, page, pageSize }).SetQueryParams(filters).GetJsonAsync>(); + public Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) => ListProductCollectionEntriesAsync(productCollectionID, buildListOpts, accessToken); + public Task> ListProductCollectionEntriesAsync(string productCollectionID, Action> buildListOpts, string accessToken = null) where TProductCollectionBuyerProduct : ProductCollectionBuyerProduct => Request("v1", "me", "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetListOptions(buildListOpts).GetJsonAsync>(); public Task CreateProductCollectionEntryAsync(string productCollectionID, string productID, string accessToken = null) => Request("v1", "me", "productcollections", productCollectionID, productID).WithOAuthBearerToken(accessToken).PutAsync(null); + public Task SaveProductCollectionEntryAsync(string productCollectionID, ProductCollectionEntry productCollectionEntry, string accessToken = null) => Request("v1", "me", "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).PostJsonAsync(ValidateModel(productCollectionEntry)); public Task DeleteProductCollectionEntryAsync(string productCollectionID, string productID, string accessToken = null) => Request("v1", "me", "productcollections", productCollectionID, productID).WithOAuthBearerToken(accessToken).DeleteAsync(); public Task CreateProductCollectionInvitationAsync(string productCollectionID, ProductCollectionInvitation productCollectionInvitation, string accessToken = null) => CreateProductCollectionInvitationAsync(productCollectionID, productCollectionInvitation, accessToken); public Task CreateProductCollectionInvitationAsync(string productCollectionID, ProductCollectionInvitation productCollectionInvitation, string accessToken = null) where TProductCollectionInvitation : ProductCollectionInvitation => Request("v1", "me", "productcollections", productCollectionID, "invitations").WithOAuthBearerToken(accessToken).PostJsonAsync(ValidateModel(productCollectionInvitation)).ReceiveJson(); @@ -7608,10 +7644,10 @@ internal ProductCollectionsResource(OrderCloudClient client) : base(client) { } public Task> ListAsync(string buyerID, string search = null, string searchOn = null, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProductCollection : ProductCollection => Request("v1", "buyers", buyerID, "productcollections").WithOAuthBearerToken(accessToken).SetQueryParams(new { search, searchOn, sortBy, page, pageSize }).SetQueryParams(filters).GetJsonAsync>(); public Task> ListAsync(string buyerID, Action> buildListOpts, string accessToken = null) => ListAsync(buyerID, buildListOpts, accessToken); public Task> ListAsync(string buyerID, Action> buildListOpts, string accessToken = null) where TProductCollection : ProductCollection => Request("v1", "buyers", buyerID, "productcollections").WithOAuthBearerToken(accessToken).SetListOptions(buildListOpts).GetJsonAsync>(); - public Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) => ListEntriesAsync(buyerID, productCollectionID, search, searchOn, searchType, sortBy, page, pageSize, filters, accessToken); - public Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProduct : Product => Request("v1", "buyers", buyerID, "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetQueryParams(new { search, searchOn, searchType, sortBy, page, pageSize }).SetQueryParams(filters).GetJsonAsync>(); - public Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) => ListEntriesAsync(buyerID, productCollectionID, buildListOpts, accessToken); - public Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) where TProduct : Product => Request("v1", "buyers", buyerID, "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetListOptions(buildListOpts).GetJsonAsync>(); + public Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) => ListEntriesAsync(buyerID, productCollectionID, search, searchOn, searchType, sortBy, page, pageSize, filters, accessToken); + public Task> ListEntriesAsync(string buyerID, string productCollectionID, string search = null, string searchOn = null, SearchType searchType = SearchType.AnyTerm, string sortBy = null, int page = 1, int pageSize = 20, object filters = null, string accessToken = null) where TProductCollectionProduct : ProductCollectionProduct => Request("v1", "buyers", buyerID, "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetQueryParams(new { search, searchOn, searchType, sortBy, page, pageSize }).SetQueryParams(filters).GetJsonAsync>(); + public Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) => ListEntriesAsync(buyerID, productCollectionID, buildListOpts, accessToken); + public Task> ListEntriesAsync(string buyerID, string productCollectionID, Action> buildListOpts, string accessToken = null) where TProductCollectionProduct : ProductCollectionProduct => Request("v1", "buyers", buyerID, "productcollections", productCollectionID, "products").WithOAuthBearerToken(accessToken).SetListOptions(buildListOpts).GetJsonAsync>(); } public class ProductFacetsResource : OrderCloudResource, IProductFacetsResource diff --git a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs index 6d2e5ac..addf047 100644 --- a/src/OrderCloud.SDK/Generated/WebhookPayloads.cs +++ b/src/OrderCloud.SDK/Generated/WebhookPayloads.cs @@ -2064,6 +2064,37 @@ public class CalculateRouteParams public string OrderID { get; set; } } } + public static class InventoryIntegrations + { + /// Webhook payload sent by OrderCloud on DELETE v1/integrations/inventory. + [SentOn("DELETE", "v1/integrations/inventory")] + public class Delete : WebhookPayload { } + /// Webhook payload sent by OrderCloud on DELETE v1/integrations/inventory. + /// Specific type of the ConfigData. If not using a custom type, use the non-generic payload type instead. + [SentOn("DELETE", "v1/integrations/inventory")] + public class Delete : WebhookPayload + { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/inventory. + [SentOn("PUT", "v1/integrations/inventory")] + public class Save : WebhookPayload { } + /// Webhook payload sent by OrderCloud on PUT v1/integrations/inventory. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the InventoryIntegration. If not using a custom type, specify InventoryIntegration. + [SentOn("PUT", "v1/integrations/inventory")] + public class Save : WebhookPayload + where TInventoryIntegration : InventoryIntegration + { } + /// Webhook payload sent by OrderCloud on PATCH v1/integrations/inventory. + [SentOn("PATCH", "v1/integrations/inventory")] + public class Patch : WebhookPayload { } + /// Webhook payload sent by OrderCloud on PATCH v1/integrations/inventory. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the InventoryIntegration. If not using a custom type, specify InventoryIntegration. + [SentOn("PATCH", "v1/integrations/inventory")] + public class Patch : WebhookPayload + where TInventoryIntegration : InventoryIntegration + { } + } public static class InventoryRecords { /// Webhook payload sent by OrderCloud on POST v1/products/{productID}/inventoryrecords. @@ -2663,6 +2694,21 @@ public class CreateProductCollectionEntryRouteParams public string ProductCollectionID { get; set; } public string ProductID { get; set; } } + /// Webhook payload sent by OrderCloud on POST v1/me/productcollections/{productCollectionID}/products. + [SentOn("POST", "v1/me/productcollections/{productCollectionID}/products")] + public class SaveProductCollectionEntry : WebhookPayload { } + /// Webhook payload sent by OrderCloud on POST v1/me/productcollections/{productCollectionID}/products. + /// Specific type of the ConfigData. If not using a custom type, specify dynamic. + /// Specific type of the ProductCollectionEntry. If not using a custom type, specify ProductCollectionEntry. + [SentOn("POST", "v1/me/productcollections/{productCollectionID}/products")] + public class SaveProductCollectionEntry : WebhookPayload + where TProductCollectionEntry : ProductCollectionEntry + { } + /// Type used to represent route parameter name/value pairs for v1/me/productcollections/{productCollectionID}/products. + public class SaveProductCollectionEntryRouteParams + { + public string ProductCollectionID { get; set; } + } /// Webhook payload sent by OrderCloud on DELETE v1/me/productcollections/{productCollectionID}/{productID}. [SentOn("DELETE", "v1/me/productcollections/{productCollectionID}/{productID}")] public class DeleteProductCollectionEntry : WebhookPayload { } diff --git a/src/OrderCloud.SDK/OrderCloud.SDK.csproj b/src/OrderCloud.SDK/OrderCloud.SDK.csproj index 1d3ad75..83b6237 100644 --- a/src/OrderCloud.SDK/OrderCloud.SDK.csproj +++ b/src/OrderCloud.SDK/OrderCloud.SDK.csproj @@ -4,7 +4,7 @@ netstandard2.0;net461 True - 0.16.1 + 0.17.0 OrderCloud.SDK OrderCloud SDK Todd Menier @@ -30,6 +30,7 @@ +