diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index 6ec03a50..c549703e 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -10,6 +10,8 @@ Naming Policies: ### APIs +Notes: The following catalog is consistent with the catalog structure of [TikTokShop Partner Center API Reference](https://partner.tiktokshop.com/docv2/page/6507ead7b99d5302be949ba9?external_id=6507ead7b99d5302be949ba9). +
[View Details] @@ -63,11 +65,27 @@ Naming Policies: - Orders - Get Order List: `OrderSearchOrders` - Get Order Detail: `OrderBatchGetOrderDetail` +- Fulfillment + - *Pending ...* +- Return and Refund + - *Pending ...* - Logistics - Get Warehouse Delivery Options: `LogisticsGetWarehouseDeliveryOptions` - Get Warehouse List: `LogisticsGetWarehouses` - Get Shipping Providers: `LogisticsGetDeliveryOptionShippingProviders` - Get Global Seller Warehouse: `LogisticsGetGlobalWarehouses` +- Promotion + - Create Activity: `PromotionCreateActivity` + - Update Activity Product: `PromotionUpdateActivityProducts` + - Remove Activity Product: `PromotionDeleteActivityProducts` + - Search Activities: `PromotionSearchActivities` + - Get Activity: `PromotionGetActivityDetail` + - Update Activity: `PromotionUpdateActivity` + - Deactivate Activity: `PromotionDeactivateActivity` +- Finance + - *Pending ...* +- Customer Service + - *Pending ...* - Supply Chain - Confirm Package Shipment: `SupplyChainSyncPackages` diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs new file mode 100644 index 00000000..b491d747 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs @@ -0,0 +1,165 @@ +using System; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Flurl.Http; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop +{ + public static class TikTokShopClientExecutePromotionExtensions + { + /// + /// 异步调用 [POST] /promotion/{version}/activities 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionCreateActivityAsync(this TikTokShopClient client, Models.PromotionCreateActivityRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", request.ApiVersion, "activities"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /promotion/{version}/activities/search 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionSearchActivitiesAsync(this TikTokShopClient client, Models.PromotionSearchActivitiesRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", request.ApiVersion, "activities", "search"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /promotion/{version}/activities/{activity_id} 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionGetActivityDetailAsync(this TikTokShopClient client, Models.PromotionGetActivityDetailRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Get, "promotion", request.ApiVersion, "activities", request.ActivityId); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [PUT] /promotion/{version}/activities/{activity_id} 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionUpdateActivityAsync(this TikTokShopClient client, Models.PromotionUpdateActivityRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Put, "promotion", request.ApiVersion, "activities", request.ActivityId); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /promotion/{version}/activities/{activity_id}/deactivate 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionDeactivateActivityAsync(this TikTokShopClient client, Models.PromotionDeactivateActivityRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", request.ApiVersion, "activities", request.ActivityId, "deactivate"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [PUT] /promotion/{version}/activities/{activity_id}/products 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionUpdateActivityProductsAsync(this TikTokShopClient client, Models.PromotionUpdateActivityProductsRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Put, "promotion", request.ApiVersion, "activities", request.ActivityId, "products"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [DELETE] /promotion/{version}/activities/{activity_id}/products 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecutePromotionDeleteActivityProductsAsync(this TikTokShopClient client, Models.PromotionDeleteActivityProductsRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Delete, "promotion", request.ApiVersion, "activities", request.ActivityId, "products"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Global/ProductGetGlobalProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Global/ProductGetGlobalProductDetailResponse.cs index 6046cbc0..d7463feb 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Global/ProductGetGlobalProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Global/ProductGetGlobalProductDetailResponse.cs @@ -173,7 +173,7 @@ public class IdentifierCode : ProductGetProductDetailResponse.Types.Data.Types.S [Newtonsoft.Json.JsonProperty("sku_unit_count")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("sku_unit_count")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal? UnitCount { get; set; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs index b53fa811..bb3ea152 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs @@ -411,7 +411,7 @@ public class ReplicateSource [Newtonsoft.Json.JsonProperty("sku_unit_count")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("sku_unit_count")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal? UnitCount { get; set; } /// @@ -430,7 +430,7 @@ public class PackageDimension [Newtonsoft.Json.JsonProperty("length")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("length")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal Length { get; set; } /// @@ -439,7 +439,7 @@ public class PackageDimension [Newtonsoft.Json.JsonProperty("width")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("width")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal Width { get; set; } /// @@ -448,7 +448,7 @@ public class PackageDimension [Newtonsoft.Json.JsonProperty("height")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("height")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal Height { get; set; } /// @@ -467,7 +467,7 @@ public class PackageWeight [Newtonsoft.Json.JsonProperty("value")] [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] [System.Text.Json.Serialization.JsonPropertyName("value")] - [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] public decimal Value { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityRequest.cs new file mode 100644 index 00000000..14119230 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityRequest.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities 接口的请求。 + /// + public class PromotionCreateActivityRequest : TikTokShopRequest + { + /// + /// 获取或设置活动类型。 + /// + [Newtonsoft.Json.JsonProperty("activity_type")] + [System.Text.Json.Serialization.JsonPropertyName("activity_type")] + public string ActivityType { get; set; } = string.Empty; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = string.Empty; + + /// + /// 获取或设置商品类型。 + /// + [Newtonsoft.Json.JsonProperty("product_level")] + [System.Text.Json.Serialization.JsonPropertyName("product_level")] + public string ProductLevel { get; set; } = string.Empty; + + /// + /// 获取或设置活动开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("begin_time")] + [System.Text.Json.Serialization.JsonPropertyName("begin_time")] + public long BeginTimestamp { get; set; } + + /// + /// 获取或设置活动结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("end_time")] + [System.Text.Json.Serialization.JsonPropertyName("end_time")] + public long EndTimestamp { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs new file mode 100644 index 00000000..bad1dcaa --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities 接口的响应。 + /// + public class PromotionCreateActivityResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityRequest.cs new file mode 100644 index 00000000..b2350e4b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities/{activity_id}/deactivate 接口的请求。 + /// + public class PromotionDeactivateActivityRequest : TikTokShopRequest + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ActivityId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs new file mode 100644 index 00000000..75951421 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities/{activity_id}/deactivate 接口的响应。 + /// + public class PromotionDeactivateActivityResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = default!; + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsRequest.cs new file mode 100644 index 00000000..5cf9bcd7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsRequest.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [DELETE] /promotion/{version}/activities/{activity_id}/products 接口的请求。 + /// + public class PromotionDeleteActivityProductsRequest : TikTokShopRequest + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ActivityId { get; set; } = string.Empty; + + /// + /// 获取或设置商品 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("product_ids")] + [System.Text.Json.Serialization.JsonPropertyName("product_ids")] + public IList? ProductIdList { get; set; } + + /// + /// 获取或设置 SKU ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("sku_ids")] + [System.Text.Json.Serialization.JsonPropertyName("sku_ids")] + public IList? SKUIdList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsResponse.cs new file mode 100644 index 00000000..bdc4b0fa --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeleteActivityProductsResponse.cs @@ -0,0 +1,36 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [DELETE] /promotion/{version}/activities/{activity_id}/products 接口的响应。 + /// + public class PromotionDeleteActivityProductsResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailRequest.cs new file mode 100644 index 00000000..c891738f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /promotion/{version}/activities/{activity_id} 接口的请求。 + /// + public class PromotionGetActivityDetailRequest : TikTokShopRequest + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ActivityId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs new file mode 100644 index 00000000..c6774132 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs @@ -0,0 +1,139 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /promotion/{version}/activities/{activity_id} 接口的响应。 + /// + public class PromotionGetActivityDetailResponse : TikTokShopResponse + { + public static class Types + { + public class Data : PromotionSearchActivitiesResponse.Types.Data.Types.Activity + { + public static class Types + { + public class Product + { + public static class Types + { + public class Price + { + /// + /// 获取或设置币种。 + /// + [Newtonsoft.Json.JsonProperty("currency")] + [System.Text.Json.Serialization.JsonPropertyName("currency")] + public string Currency { get; set; } = default!; + + /// + /// 获取或设置价格。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public decimal Amount { get; set; } + } + + public class SKU + { + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string SKUId { get; set; } = default!; + + /// + /// 获取或设置数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_limit")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_limit")] + public int QuantityLimit { get; set; } + + /// + /// 获取或设置单个用户数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_per_user")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_per_user")] + public int QuantityPerUser { get; set; } + + /// + /// 获取或设置活动折扣(单位:百分数)。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + public int? Discount { get; set; } + + /// + /// 获取或设置活动价信息。 + /// + [Newtonsoft.Json.JsonProperty("activity_price")] + [System.Text.Json.Serialization.JsonPropertyName("activity_price")] + public Types.Price? Price { get; set; } + } + } + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ProductId { get; set; } = default!; + + /// + /// 获取或设置数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_limit")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_limit")] + public int QuantityLimit { get; set; } + + /// + /// 获取或设置单个用户数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_per_user")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_per_user")] + public int QuantityPerUser { get; set; } + + /// + /// 获取或设置活动折扣(单位:百分数)。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + public int? Discount { get; set; } + + /// + /// 获取或设置活动价信息。 + /// + [Newtonsoft.Json.JsonProperty("activity_price")] + [System.Text.Json.Serialization.JsonPropertyName("activity_price")] + public Types.Price? Price { get; set; } + + /// + /// 获取或设置 SKU 列表。 + /// + [Newtonsoft.Json.JsonProperty("skus")] + [System.Text.Json.Serialization.JsonPropertyName("skus")] + public Types.SKU[] SKUList { get; set; } = default!; + } + } + + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public override string ActivityId { get; set; } = default!; + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("products")] + [System.Text.Json.Serialization.JsonPropertyName("products")] + public Types.Product[] ProductList { get; set; } = default!; + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesRequest.cs new file mode 100644 index 00000000..90f09882 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesRequest.cs @@ -0,0 +1,37 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities/search 接口的请求。 + /// + public class PromotionSearchActivitiesRequest : TikTokShopRequest + { + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("activity_title")] + [System.Text.Json.Serialization.JsonPropertyName("activity_title")] + public string? ActivityTitle { get; set; } + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string? ActivityStatus { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// 默认值:10 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int PageSize { get; set; } = 10; + + /// + /// 获取或设置分页令牌。 + /// + [Newtonsoft.Json.JsonProperty("page_token")] + [System.Text.Json.Serialization.JsonPropertyName("page_token")] + public string? PageToken { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs new file mode 100644 index 00000000..80a45c84 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs @@ -0,0 +1,105 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /promotion/{version}/activities/search 接口的响应。 + /// + public class PromotionSearchActivitiesResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Activity + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public virtual string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = default!; + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + public long CreateTimestamp { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置活动类型。 + /// + [Newtonsoft.Json.JsonProperty("activity_type")] + [System.Text.Json.Serialization.JsonPropertyName("activity_type")] + public string ActivityType { get; set; } = default!; + + /// + /// 获取或设置商品类型。 + /// + [Newtonsoft.Json.JsonProperty("product_level")] + [System.Text.Json.Serialization.JsonPropertyName("product_level")] + public string ProductLevel { get; set; } = default!; + + /// + /// 获取或设置活动开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("begin_time")] + [System.Text.Json.Serialization.JsonPropertyName("begin_time")] + public long BeginTimestamp { get; set; } + + /// + /// 获取或设置活动结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("end_time")] + [System.Text.Json.Serialization.JsonPropertyName("end_time")] + public long EndTimestamp { get; set; } + } + } + + /// + /// 获取或设置活动列表。 + /// + [Newtonsoft.Json.JsonProperty("activities")] + [System.Text.Json.Serialization.JsonPropertyName("activities")] + public Types.Activity[] ActivityList { get; set; } = default!; + + /// + /// 获取或设置总数量。 + /// + [Newtonsoft.Json.JsonProperty("total_count")] + [System.Text.Json.Serialization.JsonPropertyName("total_count")] + public int TotalCount { get; set; } + + /// + /// 获取或设置下一页分页令牌。 + /// + [Newtonsoft.Json.JsonProperty("next_page_token")] + [System.Text.Json.Serialization.JsonPropertyName("next_page_token")] + public string? NextPageToken { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsRequest.cs new file mode 100644 index 00000000..b65f2507 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsRequest.cs @@ -0,0 +1,118 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [PUT] /promotion/{version}/activities/{activity_id}/products 接口的请求。 + /// + public class PromotionUpdateActivityProductsRequest : TikTokShopRequest + { + public static class Types + { + public class Product + { + public static class Types + { + public class SKU + { + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string SKUId { get; set; } = default!; + + /// + /// 获取或设置数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_limit")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_limit")] + public int QuantityLimit { get; set; } + + /// + /// 获取或设置单个用户数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_per_user")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_per_user")] + public int QuantityPerUser { get; set; } + + /// + /// 获取或设置活动折扣(单位:百分数)。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + public int? Discount { get; set; } + + /// + /// 获取或设置活动价。 + /// + [Newtonsoft.Json.JsonProperty("activity_price_amount")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("activity_price_amount")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + public decimal? PriceAmount { get; set; } + } + } + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ProductId { get; set; } = string.Empty; + + /// + /// 获取或设置数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_limit")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_limit")] + public int QuantityLimit { get; set; } + + /// + /// 获取或设置单个用户数量限制。 + /// + [Newtonsoft.Json.JsonProperty("quantity_per_user")] + [System.Text.Json.Serialization.JsonPropertyName("quantity_per_user")] + public int QuantityPerUser { get; set; } + + /// + /// 获取或设置活动折扣(单位:百分数)。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + public int? Discount { get; set; } + + /// + /// 获取或设置活动价。 + /// + [Newtonsoft.Json.JsonProperty("activity_price_amount")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("activity_price_amount")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)] + public decimal? PriceAmount { get; set; } + + /// + /// 获取或设置 SKU 列表。 + /// + [Newtonsoft.Json.JsonProperty("skus")] + [System.Text.Json.Serialization.JsonPropertyName("skus")] + public IList SKUList { get; set; } = new List(); + } + } + + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + public string ActivityId { get; set; } = string.Empty; + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("products")] + [System.Text.Json.Serialization.JsonPropertyName("products")] + public IList ProductList { get; set; } = new List(); + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsResponse.cs new file mode 100644 index 00000000..0a1b403f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityProductsResponse.cs @@ -0,0 +1,50 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [PUT] /promotion/{version}/activities/{activity_id}/products 接口的响应。 + /// + public class PromotionUpdateActivityProductsResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = default!; + + /// + /// 获取或设置活动状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置商品数量。 + /// + [Newtonsoft.Json.JsonProperty("total_count")] + [System.Text.Json.Serialization.JsonPropertyName("total_count")] + public int ProductCount { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityRequest.cs new file mode 100644 index 00000000..17e2c614 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityRequest.cs @@ -0,0 +1,36 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [PUT] /promotion/{version}/activities/{activity_id} 接口的请求。 + /// + public class PromotionUpdateActivityRequest : TikTokShopRequest + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ActivityId { get; set; } = string.Empty; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = string.Empty; + + /// + /// 获取或设置活动开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("begin_time")] + [System.Text.Json.Serialization.JsonPropertyName("begin_time")] + public long BeginTimestamp { get; set; } + + /// + /// 获取或设置活动结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("end_time")] + [System.Text.Json.Serialization.JsonPropertyName("end_time")] + public long EndTimestamp { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs new file mode 100644 index 00000000..6b4c90e7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs @@ -0,0 +1,36 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [PUT] /promotion/{version}/activities/{activity_id} 接口的响应。 + /// + public class PromotionUpdateActivityResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置活动 ID。 + /// + [Newtonsoft.Json.JsonProperty("activity_id")] + [System.Text.Json.Serialization.JsonPropertyName("activity_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ActivityId { get; set; } = default!; + + /// + /// 获取或设置活动标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = default!; + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + } + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityRequest.json new file mode 100644 index 00000000..7f72d059 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityRequest.json @@ -0,0 +1,7 @@ +{ + "activity_type": "FIXED_PRICE", + "begin_time": 1661756811, + "end_time": 1661856811, + "product_level": "PRODUCT", + "title": "DiscountEvent0829" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityResponse.json new file mode 100644 index 00000000..614b0ab3 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionCreateActivityResponse.json @@ -0,0 +1,11 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "create_time": 1661756811, + "status": "ONGOING", + "update_time": 1661756811 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeactivateActivityResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeactivateActivityResponse.json new file mode 100644 index 00000000..4f7642a2 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeactivateActivityResponse.json @@ -0,0 +1,11 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "status": "ONGOING", + "title": "FlashSale 20230707", + "update_time": 1661756811 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsRequest.json new file mode 100644 index 00000000..7c31c211 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsRequest.json @@ -0,0 +1,8 @@ +{ + "product_ids": [ + "7493989962827597361" + ], + "sku_ids": [ + "7135657830438176513" + ] +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsResponse.json new file mode 100644 index 00000000..cd6a87da --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionDeleteActivityProductsResponse.json @@ -0,0 +1,10 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "status": "ONGOING", + "update_time": 1661765135 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionGetActivityDetailResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionGetActivityDetailResponse.json new file mode 100644 index 00000000..ad03f5c8 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionGetActivityDetailResponse.json @@ -0,0 +1,40 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "activity_type": "FIXED_PRICE", + "begin_time": 1661756811, + "create_time": 1661750811, + "end_time": 1661856811, + "product_level": "PRODUCT", + "products": [ + { + "activity_price": { + "amount": "70500", + "currency": "IDR" + }, + "discount": "10", + "id": "7136011254174631686", + "quantity_limit": -1, + "quantity_per_user": -1, + "skus": [ + { + "activity_price": { + "amount": "70500", + "currency": "IDR" + }, + "discount": "10", + "id": "7136382541418366725", + "quantity_limit": -1, + "quantity_per_user": -1 + } + ] + } + ], + "status": "ONGOING", + "title": "FlashSale 20230707", + "update_time": 1661750811 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesRequest.json new file mode 100644 index 00000000..d1330929 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesRequest.json @@ -0,0 +1,6 @@ +{ + "activity_title": "Discount", + "page_size": 20, + "page_token": "21", + "status": "ONGOING" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesResponse.json new file mode 100644 index 00000000..47e2c0c2 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionSearchActivitiesResponse.json @@ -0,0 +1,22 @@ +{ + "code": 0, + "data": { + "activities": [ + { + "activity_type": "FIXED_PRICE", + "begin_time": 1661756811, + "create_time": 1661756811, + "end_time": 1661756811, + "id": "7136104329798256386", + "product_level": "PRODUCT", + "status": "ONGOING", + "title": "FlashSale 20230707", + "update_time": 1661756811 + } + ], + "next_page_token": "123", + "total_count": 120 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsRequest.json new file mode 100644 index 00000000..0b665d78 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsRequest.json @@ -0,0 +1,21 @@ +{ + "activity_id": "7136104288010372865", + "products": [ + { + "activity_price_amount": "4.5", + "discount": "10", + "id": "7135427619356477189", + "quantity_limit": -1, + "quantity_per_user": -1, + "skus": [ + { + "activity_price_amount": "6.5", + "discount": "10", + "id": "7125688837187176194", + "quantity_limit": -1, + "quantity_per_user": 10 + } + ] + } + ] +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsResponse.json new file mode 100644 index 00000000..0c4a12f9 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityProductsResponse.json @@ -0,0 +1,12 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "status": "DRAFT", + "title": "DiscountPromotion", + "total_count": 1, + "update_time": 1661756811 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityRequest.json new file mode 100644 index 00000000..b331b676 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityRequest.json @@ -0,0 +1,5 @@ +{ + "begin_time": 1661756811, + "end_time": 1662756811, + "title": "BlackFridayDiscount" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityResponse.json new file mode 100644 index 00000000..0a31beb5 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Promotion/PromotionUpdateActivityResponse.json @@ -0,0 +1,10 @@ +{ + "code": 0, + "data": { + "activity_id": "7136104329798256386", + "title": "BlackFridayDiscount", + "update_time": 1661756811 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +}