Skip to content

Commit

Permalink
Merge pull request #136 from ordercloud-api/dev
Browse files Browse the repository at this point in the history
updates for latest api version
  • Loading branch information
erincdustin authored Dec 19, 2024
2 parents f76e473 + aded8b8 commit a9500f0
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/OrderCloud.SDK/Generated/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ public class ExtendedLineItem : OrderCloudModel
{
/// <summary>ID of the order.</summary>
public string OrderID { get => GetProp<string>("OrderID"); set => SetProp<string>("OrderID", value); }
/// <summary>Returned only when include=Order (or include=Order.???) is provided in the query string.</summary>
/// <summary>Currently unused.</summary>
public Order Order { get => GetProp<Order>("Order"); set => SetProp<Order>("Order", value); }
/// <summary>ID of the extended line item. Can only contain characters Aa-Zz, 0-9, -, and _. Searchable: priority level 1. Sortable.</summary>
public string ID { get => GetProp<string>("ID"); set => SetProp<string>("ID", value); }
Expand Down Expand Up @@ -879,7 +879,7 @@ public class ExtendedLineItem<Txp, TOrder, TProduct, TVariant, TShippingAddress,
{
/// <summary>Container for extended (custom) properties of the extended line item.</summary>
public new Txp xp { get => GetProp<Txp>("xp"); set => SetProp<Txp>("xp", value); }
/// <summary>Returned only when include=Order (or include=Order.???) is provided in the query string.</summary>
/// <summary>Currently unused.</summary>
public new TOrder Order { get => GetProp<TOrder>("Order"); set => SetProp<TOrder>("Order", value); }
/// <summary>Product of the extended line item.</summary>
[ApiReadOnly]
Expand Down Expand Up @@ -1824,6 +1824,8 @@ public class OrderPromotion : OrderCloudModel
public bool AutoApply { get => GetProp<bool>("AutoApply", false); set => SetProp<bool>("AutoApply", value); }
/// <summary>Active of the order promotion. Sortable.</summary>
public bool Active { get => GetProp<bool>("Active", true); set => SetProp<bool>("Active", value); }
/// <summary>Use integration of the order promotion.</summary>
public bool UseIntegration { get => GetProp<bool>("UseIntegration"); set => SetProp<bool>("UseIntegration", value); }
/// <summary>Used to control the order in which promotions are applied when calling the auto apply endpoint.</summary>
public int? Priority { get => GetProp<int?>("Priority"); set => SetProp<int?>("Priority", value); }
/// <summary>Container for extended (custom) properties of the order promotion.</summary>
Expand Down Expand Up @@ -2612,6 +2614,8 @@ public class Promotion : OrderCloudModel
public bool AutoApply { get => GetProp<bool>("AutoApply", false); set => SetProp<bool>("AutoApply", value); }
/// <summary>Active of the promotion. Sortable.</summary>
public bool Active { get => GetProp<bool>("Active", true); set => SetProp<bool>("Active", value); }
/// <summary>Use integration of the promotion.</summary>
public bool UseIntegration { get => GetProp<bool>("UseIntegration"); set => SetProp<bool>("UseIntegration", value); }
/// <summary>Used to control the order in which promotions are applied when calling the auto apply endpoint.</summary>
public int? Priority { get => GetProp<int?>("Priority"); set => SetProp<int?>("Priority", value); }
/// <summary>Container for extended (custom) properties of the promotion.</summary>
Expand All @@ -2634,6 +2638,14 @@ public class PromotionAssignment : OrderCloudModel
/// <summary>ID of the user group. Sortable: priority level 4.</summary>
public string UserGroupID { get => GetProp<string>("UserGroupID"); set => SetProp<string>("UserGroupID", value); }
}
public class PromotionIntegration : OrderCloudModel
{
/// <summary>Security feature that allows your middleware to verify the digital signature in the request header to ensure you only accept trusted data.</summary>
[Required]
public string HashKey { get => GetProp<string>("HashKey"); set => SetProp<string>("HashKey", value); }
/// <summary>Url of the promotion integration.</summary>
public string Url { get => GetProp<string>("Url"); set => SetProp<string>("Url", value); }
}
public class PromotionOverride : OrderCloudModel
{
/// <summary>ID of the promotion.</summary>
Expand Down Expand Up @@ -3512,6 +3524,7 @@ public class PartialPromotion : Promotion, IPartial { }
/// <typeparam name="Txp">Specific type of the xp property. If not using a custom type, use the non-generic PartialPromotion class instead.</typeparam>
public class PartialPromotion<Txp> : PartialPromotion
{ }
public class PartialPromotionIntegration : PromotionIntegration, IPartial { }
public class PartialSearchIngestion : SearchIngestion, IPartial { }
public class PartialSecurityProfile : SecurityProfile, IPartial { }
public class PartialSellerApprovalRule : SellerApprovalRule, IPartial { }
Expand Down
30 changes: 30 additions & 0 deletions src/OrderCloud.SDK/Generated/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -5022,6 +5023,24 @@ public interface IProductSyncsResource
Task<ProductSyncConfig> PatchAsync(PartialProductSyncConfig partialProductSyncConfig, string accessToken = null);
}

public interface IPromotionIntegrationsResource
{
/// <summary>Get a single promotion integration.</summary>
/// <param name="accessToken">Optional. Use to provide an existing token instead of authenticating implicitly.</param>
Task<PromotionIntegration> GetAsync(string accessToken = null);
/// <summary>Delete a promotion integration.</summary>
/// <param name="accessToken">Optional. Use to provide an existing token instead of authenticating implicitly.</param>
Task DeleteAsync(string accessToken = null);
/// <summary>Create or update a promotion integration. If an object with the same ID already exists, it will be overwritten.</summary>
/// <param name="promotionIntegration">The object that will be serialized to JSON and sent in the request body.</param>
/// <param name="accessToken">Optional. Use to provide an existing token instead of authenticating implicitly.</param>
Task<PromotionIntegration> SaveAsync(PromotionIntegration promotionIntegration, string accessToken = null);
/// <summary>Partially update a promotion integration.</summary>
/// <param name="partialPromotionIntegration">The object that will be partially serialized to JSON and sent in the request body.</param>
/// <param name="accessToken">Optional. Use to provide an existing token instead of authenticating implicitly.</param>
Task<PromotionIntegration> PatchAsync(PartialPromotionIntegration partialPromotionIntegration, string accessToken = null);
}

public interface IPromotionsResource
{
/// <summary>Get a single promotion.</summary>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -7720,6 +7741,15 @@ internal ProductSyncsResource(OrderCloudClient client) : base(client) { }
public Task<ProductSyncConfig> PatchAsync(PartialProductSyncConfig partialProductSyncConfig, string accessToken = null) => Request("v1", "integrations", "productsync").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialProductSyncConfig)).ReceiveJson<ProductSyncConfig>();
}

public class PromotionIntegrationsResource : OrderCloudResource, IPromotionIntegrationsResource
{
internal PromotionIntegrationsResource(OrderCloudClient client) : base(client) { }
public Task<PromotionIntegration> GetAsync(string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).GetJsonAsync<PromotionIntegration>();
public Task DeleteAsync(string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).DeleteAsync();
public Task<PromotionIntegration> SaveAsync(PromotionIntegration promotionIntegration, string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).PutJsonAsync(ValidateModel(promotionIntegration)).ReceiveJson<PromotionIntegration>();
public Task<PromotionIntegration> PatchAsync(PartialPromotionIntegration partialPromotionIntegration, string accessToken = null) => Request("v1", "integrations", "promotion").WithOAuthBearerToken(accessToken).PatchJsonAsync(ValidateModel(partialPromotionIntegration)).ReceiveJson<PromotionIntegration>();
}

public class PromotionsResource : OrderCloudResource, IPromotionsResource
{
internal PromotionsResource(OrderCloudClient client) : base(client) { }
Expand Down
31 changes: 31 additions & 0 deletions src/OrderCloud.SDK/Generated/WebhookPayloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4048,6 +4048,37 @@ public class Patch<TConfigData, TProductSyncConfig> : WebhookPayload<TProductSyn
where TProductSyncConfig : ProductSyncConfig
{ }
}
public static class PromotionIntegrations
{
/// <summary>Webhook payload sent by OrderCloud on DELETE v1/integrations/promotion.</summary>
[SentOn("DELETE", "v1/integrations/promotion")]
public class Delete : WebhookPayload<object, object, object, dynamic> { }
/// <summary>Webhook payload sent by OrderCloud on DELETE v1/integrations/promotion.</summary>
/// <typeparam name="TConfigData">Specific type of the ConfigData. If not using a custom type, use the non-generic payload type instead.</typeparam>
[SentOn("DELETE", "v1/integrations/promotion")]
public class Delete<TConfigData> : WebhookPayload<object, object, object, TConfigData>
{ }
/// <summary>Webhook payload sent by OrderCloud on PUT v1/integrations/promotion.</summary>
[SentOn("PUT", "v1/integrations/promotion")]
public class Save : WebhookPayload<PromotionIntegration, PromotionIntegration, object, dynamic> { }
/// <summary>Webhook payload sent by OrderCloud on PUT v1/integrations/promotion.</summary>
/// <typeparam name="TConfigData">Specific type of the ConfigData. If not using a custom type, specify dynamic.</typeparam>
/// <typeparam name="TPromotionIntegration">Specific type of the PromotionIntegration. If not using a custom type, specify PromotionIntegration.</typeparam>
[SentOn("PUT", "v1/integrations/promotion")]
public class Save<TConfigData, TPromotionIntegration> : WebhookPayload<TPromotionIntegration, TPromotionIntegration, object, TConfigData>
where TPromotionIntegration : PromotionIntegration
{ }
/// <summary>Webhook payload sent by OrderCloud on PATCH v1/integrations/promotion.</summary>
[SentOn("PATCH", "v1/integrations/promotion")]
public class Patch : WebhookPayload<PromotionIntegration, PromotionIntegration, object, dynamic> { }
/// <summary>Webhook payload sent by OrderCloud on PATCH v1/integrations/promotion.</summary>
/// <typeparam name="TConfigData">Specific type of the ConfigData. If not using a custom type, specify dynamic.</typeparam>
/// <typeparam name="TPromotionIntegration">Specific type of the PromotionIntegration. If not using a custom type, specify PromotionIntegration.</typeparam>
[SentOn("PATCH", "v1/integrations/promotion")]
public class Patch<TConfigData, TPromotionIntegration> : WebhookPayload<TPromotionIntegration, TPromotionIntegration, object, TConfigData>
where TPromotionIntegration : PromotionIntegration
{ }
}
public static class Promotions
{
/// <summary>Webhook payload sent by OrderCloud on POST v1/promotions.</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/OrderCloud.SDK/OrderCloud.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- https://docs.microsoft.com/en-us/dotnet/core/tools/csproj -->
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>0.17.0</Version>
<Version>0.17.1</Version>
<PackageId>OrderCloud.SDK</PackageId>
<Title>OrderCloud SDK</Title>
<Authors>Todd Menier</Authors>
Expand Down

0 comments on commit a9500f0

Please sign in to comment.