diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61a6c23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +################################################################################ +# This .gitignore file was automatically created by Microsoft(R) Visual Studio. +################################################################################ + +/.vs +/obj/Debug/netstandard2.0 +/obj +/bin diff --git a/Changes.md b/Changes.md index 28c6755..c9192d1 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,14 @@ Version History ------------------- +* v0.8.4 update + 1. Change all id field to 64bit integer (unsigned long) to prevent overflow. #560 + 2. Create RestClient.cs to use HttpClient, as Blazor does not support HttpWebRequest. PR#639 + 3. Accept '&' in password while calling WordPress Restful API. PR#527 + 4. Close HttpWebRequest write stream when finish. PR#529 + 5. Add WCObject.MetaDisplayValueProcessor function. PR#600 + 6. Add OrderCouponLineMeta class. PR#600 + 7. Change MetaData.display_value field to type object and run it through MetaDisplayValueProcessor() if configured. PR#600 * v0.8.3 update 1. Fix error while creating a refund. #476 2. Allow authenticate Woocommerce API with JWT (set WCAuthWithJWT to true). #478 diff --git a/RestAPI.cs b/RestAPI.cs index 2127a5e..9eea075 100644 --- a/RestAPI.cs +++ b/RestAPI.cs @@ -172,9 +172,11 @@ public virtual async Task SendHttpClientRequest(string endpoint, Requ if (JWTRequestFilter != null) JWTRequestFilter.Invoke(request); - var buffer = Encoding.UTF8.GetBytes($"username={wc_key}&password={wc_secret}"); - Stream dataStream = await request.GetRequestStreamAsync().ConfigureAwait(false); - dataStream.Write(buffer, 0, buffer.Length); + var buffer = Encoding.UTF8.GetBytes($"username={wc_key}&password={WebUtility.UrlEncode(wc_secret)}"); + using (Stream dataStream = await request.GetRequestStreamAsync().ConfigureAwait(false)) + { + dataStream.Write(buffer, 0, buffer.Length); + } WebResponse response = await request.GetResponseAsync().ConfigureAwait(false); Stream resStream = response.GetResponseStream(); string result = await GetStreamContent(resStream, "UTF-8").ConfigureAwait(false); @@ -231,8 +233,10 @@ public virtual async Task SendHttpClientRequest(string endpoint, Requ { httpWebRequest.ContentType = "application/json"; var buffer = Encoding.UTF8.GetBytes(SerializeJSon(requestBody)); - Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false); - dataStream.Write(buffer, 0, buffer.Length); + using (Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false)) + { + dataStream.Write(buffer, 0, buffer.Length); + } } else { @@ -243,23 +247,27 @@ public virtual async Task SendHttpClientRequest(string endpoint, Requ httpWebRequest.Headers["Content-Disposition"] = $"form-data; filename=\"{parms["name"]}\""; httpWebRequest.ContentType = "application/x-www-form-urlencoded"; - Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false); - FileStream fileStream = new FileStream(parms["path"], FileMode.Open, FileAccess.Read); - byte[] buffer = new byte[4096]; - int bytesRead = 0; - - while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) + using (Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false)) { - dataStream.Write(buffer, 0, bytesRead); + FileStream fileStream = new FileStream(parms["path"], FileMode.Open, FileAccess.Read); + byte[] buffer = new byte[4096]; + int bytesRead = 0; + + while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) + { + dataStream.Write(buffer, 0, bytesRead); + } + fileStream.Close(); } - fileStream.Close(); } else { httpWebRequest.ContentType = "application/json"; var buffer = Encoding.UTF8.GetBytes(requestBody.ToString()); - Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false); - dataStream.Write(buffer, 0, buffer.Length); + using (Stream dataStream = await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false)) + { + dataStream.Write(buffer, 0, buffer.Length); + } } } } diff --git a/RestClient.cs b/RestClient.cs index 4cdb3bb..b819021 100644 --- a/RestClient.cs +++ b/RestClient.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; @@ -46,7 +47,7 @@ public override async Task SendHttpClientRequest(string endpoint, Req //if (JWTRequestFilter != null) // JWTRequestFilter.Invoke(request); - request.Content = new StringContent($"username={wc_key}&password={wc_secret}", + request.Content = new StringContent($"username={wc_key}&password={WebUtility.UrlEncode(wc_secret)}", Encoding.UTF8, "application/x-www-form-urlencoded"); diff --git a/WooCommerce.NET.csproj b/WooCommerce.NET.csproj index 9cba1d5..8c5f709 100644 --- a/WooCommerce.NET.csproj +++ b/WooCommerce.NET.csproj @@ -3,7 +3,7 @@ netstandard2.0 WooCommerceNET - 0.8.3 + 0.8.4 JamesYang@NZ JamesYang@NZ A .NET Wrapper for WooCommerce/WordPress REST API @@ -15,25 +15,21 @@ GitHub: https://github.com/XiaoFaye/WooCommerce.NET Changes Doc: https://github.com/XiaoFaye/WooCommerce.NET/blob/master/Changes.md -* v0.8.3 update - 1. Fix error while creating a refund. #476 - 2. Allow authenticate Woocommerce API with JWT (set WCAuthWithJWT to true). #478 - 3. Fix error on retrieving refund. #484 - 4. Fix error on deserialize BatchObject. #523 - 5. Fix error on date format. #524 - 6. Add user-friendly attribute names and values to Metadata. #558 - 7. Change all id field to unsigned 32bit integer to prevent overflow. #560 - 8. Change functions in BaseObject to virtual to support Unit Test. #568 - 9. Add function to delete tax class by slug. #576 - 10. Allow WC Plugins to use WCObject. - 11. Add UpdateRangeRaw to ignore deserialize return json. #523 +* v0.8.4 update + 1. Change all id field to 64bit integer (unsigned long) to prevent overflow. #560 + 2. Create RestClient.cs to use HttpClient, as Blazor does not support HttpWebRequest. PR#639 + 3. Accept '&' in password while calling WordPress Restful API. PR#527 + 4. Close HttpWebRequest write stream when finish. PR#529 + 5. Add WCObject.MetaDisplayValueProcessor function. PR#600 + 6. Add OrderCouponLineMeta class. PR#600 + 7. Change MetaData.display_value field to type object and run it through MetaDisplayValueProcessor() if configured. PR#600 true - 0.8.3.0 + 0.8.4.0 true sn.key.snk License.md true - 0.8.3.0 + 0.8.4.0 WooCommerce Wordpress Restful API diff --git a/WooCommerce/Legacy/Coupon.cs b/WooCommerce/Legacy/Coupon.cs index cd79b4b..322ba95 100644 --- a/WooCommerce/Legacy/Coupon.cs +++ b/WooCommerce/Legacy/Coupon.cs @@ -20,7 +20,7 @@ public class Coupon : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code, always lowercase diff --git a/WooCommerce/Legacy/Customer.cs b/WooCommerce/Legacy/Customer.cs index 2767fb2..d11be5f 100644 --- a/WooCommerce/Legacy/Customer.cs +++ b/WooCommerce/Legacy/Customer.cs @@ -19,7 +19,7 @@ public class Customer /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the customer was created diff --git a/WooCommerce/Legacy/Order.cs b/WooCommerce/Legacy/Order.cs index f5f2dd0..ceaef8b 100644 --- a/WooCommerce/Legacy/Order.cs +++ b/WooCommerce/Legacy/Order.cs @@ -19,7 +19,7 @@ public class Order /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Order number @@ -167,7 +167,7 @@ public class Order /// required when creating a new order /// [DataMember(EmitDefaultValue = false)] - public uint? customer_id { get; set; } + public ulong? customer_id { get; set; } /// /// URL to view the order in frontend @@ -273,7 +273,7 @@ public class LineItem /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Line item subtotal @@ -400,7 +400,7 @@ public class ShippingLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping method ID @@ -438,14 +438,14 @@ public class TaxLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tax rate ID /// read-only /// [DataMember(EmitDefaultValue = false)] - public int? rate_id { get; set; } + public ulong? rate_id { get; set; } /// /// Tax rate code @@ -492,7 +492,7 @@ public class FeeLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping method title @@ -543,7 +543,7 @@ public class CouponLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code @@ -576,7 +576,7 @@ public class Order_Note /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the order note was created @@ -615,7 +615,7 @@ public class Order_Refund /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the order refund was created diff --git a/WooCommerce/Legacy/Product.cs b/WooCommerce/Legacy/Product.cs index 4bc8e15..0768f4d 100644 --- a/WooCommerce/Legacy/Product.cs +++ b/WooCommerce/Legacy/Product.cs @@ -27,7 +27,7 @@ public class Product : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product slug @@ -338,7 +338,7 @@ public class Product : JsonObject /// Product parent ID (post_parent) /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// List of product categories names (string). In write-mode need to pass a array of categories IDs (integer) (uses wp_set_object_terms()) @@ -502,7 +502,7 @@ public class Image /// Image ID (attachment ID) /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the image was created @@ -670,7 +670,7 @@ public class Variation /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the variation was created @@ -876,7 +876,7 @@ public class ProductAttribute /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name @@ -919,7 +919,7 @@ public class ProductAttributeTerm /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Term name @@ -958,7 +958,7 @@ public class Product_Category /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Category name @@ -977,7 +977,7 @@ public class Product_Category /// Category parent /// [DataMember(EmitDefaultValue = false)] - public uint? parent { get; set; } + public ulong? parent { get; set; } /// /// Category description @@ -1013,7 +1013,7 @@ public class ShippingClass /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping Class name @@ -1032,7 +1032,7 @@ public class ShippingClass /// Shipping Class parent /// [DataMember(EmitDefaultValue = false)] - public uint? parent { get; set; } + public ulong? parent { get; set; } /// /// Shipping Class description @@ -1056,7 +1056,7 @@ public class ProductTag /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tag name @@ -1101,7 +1101,7 @@ public class ProductReview /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime when the review was created diff --git a/WooCommerce/Legacy/Tax.cs b/WooCommerce/Legacy/Tax.cs index 99e9792..8c3ec90 100644 --- a/WooCommerce/Legacy/Tax.cs +++ b/WooCommerce/Legacy/Tax.cs @@ -10,7 +10,7 @@ public class Tax /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Country code. See ISO 3166 Codes (Countries) for more details diff --git a/WooCommerce/Legacy/Webhook.cs b/WooCommerce/Legacy/Webhook.cs index 69e9af4..e040d5a 100644 --- a/WooCommerce/Legacy/Webhook.cs +++ b/WooCommerce/Legacy/Webhook.cs @@ -19,7 +19,7 @@ public class Webhook /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// @@ -111,7 +111,7 @@ public class WebhookDelivery /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The delivery duration, in seconds @@ -221,13 +221,13 @@ public class RequestHeaders /// The webhook’s ID /// [DataMember(Name = "X-WC-Webhook-ID", EmitDefaultValue = false)] - public int XWCWebhookID { get; set; } + public uint XWCWebhookID { get; set; } /// /// The delivery ID /// [DataMember(Name = "X-WC-Webhook-Delivery-ID", EmitDefaultValue = false)] - public int XWCWebhookDeliveryID { get; set; } + public uint XWCWebhookDeliveryID { get; set; } } diff --git a/WooCommerce/v1/Coupon.cs b/WooCommerce/v1/Coupon.cs index fef77c0..23ff67b 100644 --- a/WooCommerce/v1/Coupon.cs +++ b/WooCommerce/v1/Coupon.cs @@ -15,7 +15,7 @@ public class Coupon : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code. diff --git a/WooCommerce/v1/Customer.cs b/WooCommerce/v1/Customer.cs index ca18764..02bc58a 100644 --- a/WooCommerce/v1/Customer.cs +++ b/WooCommerce/v1/Customer.cs @@ -112,7 +112,7 @@ public class LastOrder /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// UTC DateTime of the customer last order. diff --git a/WooCommerce/v1/Order.cs b/WooCommerce/v1/Order.cs index 445c18f..e755379 100644 --- a/WooCommerce/v1/Order.cs +++ b/WooCommerce/v1/Order.cs @@ -16,13 +16,13 @@ public class Order : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Parent order ID. /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// Order status. Default is pending. Options (plugins may include new status): pending, processing, on-hold, completed, cancelled, refunded and failed. @@ -75,7 +75,7 @@ public class Order : JsonObject /// User ID who owns the order. Use 0 for guests. Default is 0. /// [DataMember(EmitDefaultValue = false)] - public uint? customer_id { get; set; } + public ulong? customer_id { get; set; } /// /// Total discount amount for the order. @@ -253,7 +253,7 @@ public class LineItem /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -273,13 +273,13 @@ public class LineItem /// Product ID. /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Variation ID, if applicable. /// [DataMember(EmitDefaultValue = false)] - public uint? variation_id { get; set; } + public ulong? variation_id { get; set; } /// /// Quantity ordered. @@ -369,7 +369,7 @@ public class TaxItem : JsonObject /// tax item id /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// tax item total @@ -394,7 +394,7 @@ public class ShippingLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping method name. @@ -439,7 +439,7 @@ public class TaxLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tax rate code. @@ -494,7 +494,7 @@ public class FeeLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Fee name. @@ -546,7 +546,7 @@ public class CouponLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code. @@ -580,7 +580,7 @@ public class OrderNote /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the order note was created, in the site’s timezone. @@ -611,7 +611,7 @@ public class OrderRefund : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the order refund was created, in the site’s timezone. @@ -649,7 +649,7 @@ public class OrderRefundLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -669,13 +669,13 @@ public class OrderRefundLine /// Product ID. /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Variation ID, if applicable. /// [DataMember(EmitDefaultValue = false)] - public uint? variation_id { get; set; } + public ulong? variation_id { get; set; } /// /// Quantity ordered. diff --git a/WooCommerce/v1/Product.cs b/WooCommerce/v1/Product.cs index ca45b92..c608d43 100644 --- a/WooCommerce/v1/Product.cs +++ b/WooCommerce/v1/Product.cs @@ -16,7 +16,7 @@ public class Product : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -363,7 +363,7 @@ public class Product : JsonObject /// Product parent ID (post_parent). /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// Optional note to send the customer after purchase. @@ -453,7 +453,7 @@ public class Category /// Category ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Category name. @@ -477,7 +477,7 @@ public class Tag /// Tag ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tag name. @@ -501,7 +501,7 @@ public class Image /// Image ID (attachment ID). In write-mode used to attach pre-existing images. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. @@ -552,7 +552,7 @@ public class Attribute /// Attribute ID (required if is a global attribute). /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name (required if is a non-global attribute). @@ -592,7 +592,7 @@ public class DefaultAttribute /// Attribute ID (required if is a global attribute). /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name (required if is a non-global attribute). @@ -639,7 +639,7 @@ public class Variation : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the variation was created, in the site’s timezone. @@ -850,7 +850,7 @@ public class VariationAttribute /// Attribute ID (required if is a global attribute). /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name (required if is a non-global attribute). @@ -873,7 +873,7 @@ public class ProductAttribute /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name. @@ -915,7 +915,7 @@ public class ProductAttributeTerm /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Term name. @@ -951,7 +951,7 @@ public class ProductCategory : Category /// The id for the parent of the resource. /// [DataMember(EmitDefaultValue = false)] - public uint? parent { get; set; } + public ulong? parent { get; set; } /// /// HTML description of the resource. @@ -992,7 +992,7 @@ public class ProductCategoryImage /// Image ID (attachment ID). In write-mode used to attach pre-existing images. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. @@ -1038,7 +1038,7 @@ public class ShippingClass /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping class name. @@ -1078,7 +1078,7 @@ public class ProductTag /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tag name. @@ -1115,7 +1115,7 @@ public class ProductReview /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the review was created, in the site’s timezone. diff --git a/WooCommerce/v1/Report.cs b/WooCommerce/v1/Report.cs index 47a12f4..1306070 100644 --- a/WooCommerce/v1/Report.cs +++ b/WooCommerce/v1/Report.cs @@ -119,14 +119,14 @@ public class TopSellersReport /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint product_id { get; set; } + public ulong? product_id { get; set; } /// /// Total number of purchases. /// read-only /// [DataMember(EmitDefaultValue = false)] - public int quantity { get; set; } + public uint quantity { get; set; } } diff --git a/WooCommerce/v1/Tax.cs b/WooCommerce/v1/Tax.cs index 5f76153..2fd3573 100644 --- a/WooCommerce/v1/Tax.cs +++ b/WooCommerce/v1/Tax.cs @@ -15,7 +15,7 @@ public class TaxRate /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Country ISO 3166 code. See ISO 3166 Codes (Countries) for more details diff --git a/WooCommerce/v1/Webhook.cs b/WooCommerce/v1/Webhook.cs index d79e5ab..c2f3027 100644 --- a/WooCommerce/v1/Webhook.cs +++ b/WooCommerce/v1/Webhook.cs @@ -15,7 +15,7 @@ public class Webhook /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// A friendly name for the webhook. Defaults is Webhook created on lt;dategt;. @@ -94,7 +94,7 @@ public class WebhookDelivery /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The delivery duration, in seconds. @@ -210,13 +210,13 @@ public class RequestHeader /// The webhook’s ID /// [DataMember(Name = "X-WC-Webhook-ID", EmitDefaultValue = false)] - public int XWCWebhookID { get; set; } + public uint XWCWebhookID { get; set; } /// /// The delivery ID /// [DataMember(Name = "X-WC-Webhook-Delivery-ID", EmitDefaultValue = false)] - public int XWCWebhookDeliveryID { get; set; } + public uint XWCWebhookDeliveryID { get; set; } } diff --git a/WooCommerce/v2/Coupon.cs b/WooCommerce/v2/Coupon.cs index b31a434..71cfe8a 100644 --- a/WooCommerce/v2/Coupon.cs +++ b/WooCommerce/v2/Coupon.cs @@ -17,7 +17,7 @@ public class Coupon : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code. diff --git a/WooCommerce/v2/Customer.cs b/WooCommerce/v2/Customer.cs index 4925539..20fe08b 100644 --- a/WooCommerce/v2/Customer.cs +++ b/WooCommerce/v2/Customer.cs @@ -292,7 +292,7 @@ public class CustomerDownloads /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Product name. @@ -313,7 +313,7 @@ public class CustomerDownloads /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? order_id { get; set; } + public ulong? order_id { get; set; } /// /// Order key. diff --git a/WooCommerce/v2/Order.cs b/WooCommerce/v2/Order.cs index a1ef533..1225906 100644 --- a/WooCommerce/v2/Order.cs +++ b/WooCommerce/v2/Order.cs @@ -17,13 +17,13 @@ public class Order : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Parent order ID. /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// Order number. @@ -155,7 +155,7 @@ public class Order : JsonObject /// User ID who owns the order. 0 for guests. Default is 0. /// [DataMember(EmitDefaultValue = false)] - public uint? customer_id { get; set; } + public ulong? customer_id { get; set; } /// /// Customer’s IP address. @@ -437,7 +437,7 @@ public class OrderLineItem : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -449,13 +449,13 @@ public class OrderLineItem : JsonObject /// Product ID. /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Variation ID, if applicable. /// [DataMember(EmitDefaultValue = false)] - public uint? variation_id { get; set; } + public ulong? variation_id { get; set; } /// /// Quantity ordered. @@ -595,7 +595,7 @@ public class TaxItem : JsonObject /// tax item id /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// tax item total @@ -620,7 +620,7 @@ public class OrderShippingLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping method name. @@ -678,7 +678,7 @@ public class OrderFeeLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Fee name. @@ -705,13 +705,11 @@ public class OrderFeeLine : JsonObject /// public decimal? total { get; set; } - [DataMember(EmitDefaultValue = false, Name = "total_tax")] - protected object total_taxValue { get; set; } - /// /// Line total tax (after discounts). /// read-only /// + [DataMember(EmitDefaultValue = false)] public decimal? total_tax { get; set; } /// @@ -742,7 +740,7 @@ public class OrderCouponLine /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Coupon code. @@ -781,7 +779,7 @@ public class OrderRefundLine : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Refund reason. diff --git a/WooCommerce/v2/OrderNote.cs b/WooCommerce/v2/OrderNote.cs index 2964c7d..8c4b0fc 100644 --- a/WooCommerce/v2/OrderNote.cs +++ b/WooCommerce/v2/OrderNote.cs @@ -13,7 +13,7 @@ public class OrderNote /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the order note was created, in the site’s timezone. diff --git a/WooCommerce/v2/OrderRefund.cs b/WooCommerce/v2/OrderRefund.cs index 8d3e413..d90483c 100644 --- a/WooCommerce/v2/OrderRefund.cs +++ b/WooCommerce/v2/OrderRefund.cs @@ -15,7 +15,7 @@ public class OrderRefund : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the order refund was created, in the site’s timezone. @@ -49,7 +49,7 @@ public class OrderRefund : JsonObject /// User ID of user who created the refund. /// [DataMember(EmitDefaultValue = false)] - public uint? refunded_by { get; set; } + public ulong? refunded_by { get; set; } /// /// Meta data. See Order refund - Meta data properties @@ -86,7 +86,7 @@ public class OrderRefundItem /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -98,13 +98,13 @@ public class OrderRefundItem /// Product ID. /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Variation ID, if applicable. /// [DataMember(EmitDefaultValue = false)] - public uint? variation_id { get; set; } + public ulong? variation_id { get; set; } /// /// Quantity ordered. diff --git a/WooCommerce/v2/Product.cs b/WooCommerce/v2/Product.cs index 9da159e..4bd4a3b 100644 --- a/WooCommerce/v2/Product.cs +++ b/WooCommerce/v2/Product.cs @@ -17,7 +17,7 @@ public class Product : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -378,7 +378,7 @@ public class Product : JsonObject /// Product parent ID. /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// Optional note to send the customer after purchase. @@ -502,7 +502,7 @@ public class ProductCategoryLine /// Category ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Category name. @@ -527,7 +527,7 @@ public class ProductTagLine /// Tag ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tag name. @@ -552,7 +552,7 @@ public class ProductImage /// Image ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. @@ -615,7 +615,7 @@ public class ProductAttributeLine /// Attribute ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name. @@ -656,7 +656,7 @@ public class ProductDefaultAttribute /// Attribute ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name. @@ -688,7 +688,7 @@ public class ProductReview /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The content of the review. diff --git a/WooCommerce/v2/ProductAttribute.cs b/WooCommerce/v2/ProductAttribute.cs index 81f5163..a60286a 100644 --- a/WooCommerce/v2/ProductAttribute.cs +++ b/WooCommerce/v2/ProductAttribute.cs @@ -12,7 +12,7 @@ public class ProductAttribute /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name. @@ -57,7 +57,7 @@ public class ProductAttributeTerm /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Term name. diff --git a/WooCommerce/v2/ProductCategory.cs b/WooCommerce/v2/ProductCategory.cs index 5b422bd..f069cf4 100644 --- a/WooCommerce/v2/ProductCategory.cs +++ b/WooCommerce/v2/ProductCategory.cs @@ -13,7 +13,7 @@ public class ProductCategory /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Category name. @@ -32,7 +32,7 @@ public class ProductCategory /// The ID for the parent of the resource. /// [DataMember(EmitDefaultValue = false)] - public uint? parent { get; set; } + public ulong? parent { get; set; } /// /// HTML description of the resource. @@ -73,7 +73,7 @@ public class ProductCategoryImage /// Image ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. diff --git a/WooCommerce/v2/ProductTag.cs b/WooCommerce/v2/ProductTag.cs index 252c779..4069cf2 100644 --- a/WooCommerce/v2/ProductTag.cs +++ b/WooCommerce/v2/ProductTag.cs @@ -12,7 +12,7 @@ public class ProductTag /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Tag name. diff --git a/WooCommerce/v2/Report.cs b/WooCommerce/v2/Report.cs index fe089f7..6436775 100644 --- a/WooCommerce/v2/Report.cs +++ b/WooCommerce/v2/Report.cs @@ -163,7 +163,7 @@ public class TopSellersReport /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Total number of purchases. diff --git a/WooCommerce/v2/ShippingClass.cs b/WooCommerce/v2/ShippingClass.cs index 47688ad..ef4e218 100644 --- a/WooCommerce/v2/ShippingClass.cs +++ b/WooCommerce/v2/ShippingClass.cs @@ -12,7 +12,7 @@ public class ShippingClass /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping class name. diff --git a/WooCommerce/v2/ShippingZone.cs b/WooCommerce/v2/ShippingZone.cs index 23a5597..e681d0f 100644 --- a/WooCommerce/v2/ShippingZone.cs +++ b/WooCommerce/v2/ShippingZone.cs @@ -13,7 +13,7 @@ public class ShippingZone /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Shipping zone name. diff --git a/WooCommerce/v2/TaxRate.cs b/WooCommerce/v2/TaxRate.cs index 56b78e6..eba1bce 100644 --- a/WooCommerce/v2/TaxRate.cs +++ b/WooCommerce/v2/TaxRate.cs @@ -12,7 +12,7 @@ public class TaxRate /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Country ISO 3166 code. See ISO 3166 Codes (Countries) for more details diff --git a/WooCommerce/v2/Variation.cs b/WooCommerce/v2/Variation.cs index 58ba857..2dac60e 100644 --- a/WooCommerce/v2/Variation.cs +++ b/WooCommerce/v2/Variation.cs @@ -15,7 +15,7 @@ public class Variation : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the variation was created, in the site’s timezone. @@ -240,7 +240,7 @@ public class Variation : JsonObject /// Menu order, used to custom sort products. /// [DataMember(EmitDefaultValue = false)] - public int menu_order { get; set; } + public uint menu_order { get; set; } /// /// Meta data. See Product variation - Meta data properties @@ -309,7 +309,7 @@ public class VariationImage /// Image ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. @@ -371,7 +371,7 @@ public class VariationAttribute /// Attribute ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Attribute name. diff --git a/WooCommerce/v2/WCObject.cs b/WooCommerce/v2/WCObject.cs index 337a229..ef0c1fe 100644 --- a/WooCommerce/v2/WCObject.cs +++ b/WooCommerce/v2/WCObject.cs @@ -87,7 +87,7 @@ public class MetaData /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Meta key. @@ -128,14 +128,14 @@ public object value [DataMember(EmitDefaultValue = false)] public object display_value { - get => preDisplayValue; - set + get => preDisplayValue; + set { - if ( MetaDisplayValueProcessor != null) + if (MetaDisplayValueProcessor != null) preDisplayValue = MetaDisplayValueProcessor.Invoke(GetType().Name, value); else preDisplayValue = value; - } + } } } diff --git a/WooCommerce/v2/Webhook.cs b/WooCommerce/v2/Webhook.cs index 78d1372..9ab166a 100644 --- a/WooCommerce/v2/Webhook.cs +++ b/WooCommerce/v2/Webhook.cs @@ -14,7 +14,7 @@ public class Webhook /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// A friendly name for the webhook. @@ -107,7 +107,7 @@ public class WebhookDelivery /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The delivery duration, in seconds. @@ -221,13 +221,13 @@ public class RequestHeaders /// The webhook’s ID /// [DataMember(Name = "X-WC-Webhook-ID", EmitDefaultValue = false)] - public int XWCWebhookID { get; set; } + public uint XWCWebhookID { get; set; } /// /// The delivery ID /// [DataMember(Name = "X-WC-Webhook-Delivery-ID", EmitDefaultValue = false)] - public int XWCWebhookDeliveryID { get; set; } + public uint XWCWebhookDeliveryID { get; set; } } diff --git a/WooCommerce/v3/Data.cs b/WooCommerce/v3/Data.cs index 85065d3..cbd883e 100644 --- a/WooCommerce/v3/Data.cs +++ b/WooCommerce/v3/Data.cs @@ -86,7 +86,7 @@ public class Country /// Number of decimal points shown in displayed prices for this country. /// [DataMember(EmitDefaultValue = false)] - public int num_decimals { get; set; } + public uint num_decimals { get; set; } /// /// List of states in this country. See Continents - Countries - States properties diff --git a/WooCommerce/v3/Product.cs b/WooCommerce/v3/Product.cs index 12e20f0..82e0d04 100644 --- a/WooCommerce/v3/Product.cs +++ b/WooCommerce/v3/Product.cs @@ -17,7 +17,7 @@ public class Product : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// Product name. @@ -378,7 +378,7 @@ public class Product : JsonObject /// Product parent ID. /// [DataMember(EmitDefaultValue = false)] - public uint? parent_id { get; set; } + public ulong? parent_id { get; set; } /// /// Optional note to send the customer after purchase. @@ -539,7 +539,7 @@ public class ProductReview /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the review was created, in the site’s timezone. @@ -557,7 +557,7 @@ public class ProductReview /// Unique identifier for the product that the review belongs to. /// [DataMember(EmitDefaultValue = false)] - public uint? product_id { get; set; } + public ulong? product_id { get; set; } /// /// Status of the review. Options: approved, hold, spam, unspam, transh and untrash. Defauls to approved. diff --git a/WooCommerce/v3/Variation.cs b/WooCommerce/v3/Variation.cs index a529801..f933fd3 100644 --- a/WooCommerce/v3/Variation.cs +++ b/WooCommerce/v3/Variation.cs @@ -15,7 +15,7 @@ public class Variation : JsonObject /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the variation was created, in the site’s timezone. @@ -254,7 +254,7 @@ public class Variation : JsonObject /// Menu order, used to custom sort products. /// [DataMember(EmitDefaultValue = false)] - public int menu_order { get; set; } + public uint menu_order { get; set; } /// /// Meta data. See Product variation - Meta data properties @@ -282,7 +282,7 @@ public class VariationImage /// Image ID. /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The date the image was created, in the site’s timezone. diff --git a/WooCommerce/v3/Webhook.cs b/WooCommerce/v3/Webhook.cs index 34e4e8f..6ea4437 100644 --- a/WooCommerce/v3/Webhook.cs +++ b/WooCommerce/v3/Webhook.cs @@ -15,7 +15,7 @@ public class WebhookDelivery /// read-only /// [DataMember(EmitDefaultValue = false)] - public uint? id { get; set; } + public ulong? id { get; set; } /// /// The delivery duration, in seconds. @@ -129,13 +129,13 @@ public class RequestHeaders /// The webhook’s ID /// [DataMember(Name = "X-WC-Webhook-ID", EmitDefaultValue = false)] - public int XWCWebhookID { get; set; } + public uint XWCWebhookID { get; set; } /// /// The delivery ID /// [DataMember(Name = "X-WC-Webhook-Delivery-ID", EmitDefaultValue = false)] - public int XWCWebhookDeliveryID { get; set; } + public uint XWCWebhookDeliveryID { get; set; } } diff --git a/WordPress/v2/Categories.cs b/WordPress/v2/Categories.cs index ad635be..d2956a1 100644 --- a/WordPress/v2/Categories.cs +++ b/WordPress/v2/Categories.cs @@ -14,13 +14,13 @@ public class Categories /// Unique identifier for the term. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// Number of published posts for the term. /// [DataMember(EmitDefaultValue = false)] - public int count { get; set; } + public uint count { get; set; } /// /// HTML description of the term. @@ -56,7 +56,7 @@ public class Categories /// The parent term ID. /// [DataMember(EmitDefaultValue = false)] - public uint parent { get; set; } + public ulong? parent { get; set; } /// /// Meta fields. diff --git a/WordPress/v2/Comments.cs b/WordPress/v2/Comments.cs index d641452..5a0b974 100644 --- a/WordPress/v2/Comments.cs +++ b/WordPress/v2/Comments.cs @@ -13,13 +13,13 @@ public class Comments /// Unique identifier for the object. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// The ID of the user object, if author was a user. /// [DataMember(EmitDefaultValue = false)] - public int author { get; set; } + public ulong? author { get; set; } /// /// Email address for the object author. @@ -95,13 +95,13 @@ public string content /// The ID for the parent of the object. /// [DataMember(EmitDefaultValue = false)] - public uint parent { get; set; } + public ulong? parent { get; set; } /// /// The ID of the associated post object. /// [DataMember(EmitDefaultValue = false)] - public uint post { get; set; } + public ulong? post { get; set; } /// /// State of the object. diff --git a/WordPress/v2/Media.cs b/WordPress/v2/Media.cs index a5face0..32eea7e 100644 --- a/WordPress/v2/Media.cs +++ b/WordPress/v2/Media.cs @@ -48,7 +48,7 @@ public string guid /// Unique identifier for the object. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// URL to the object. @@ -112,7 +112,7 @@ public string title /// The ID for the author of the object. /// [DataMember(EmitDefaultValue = false)] - public int author { get; set; } + public ulong? author { get; set; } /// /// Whether or not comments are open on the object. @@ -210,7 +210,7 @@ public string description /// The ID for the associated post of the attachment. /// [DataMember(EmitDefaultValue = false)] - public uint? post { get; set; } + public ulong? post { get; set; } /// /// URL to the original attachment file. diff --git a/WordPress/v2/Pages.cs b/WordPress/v2/Pages.cs index aedec49..ddbf944 100644 --- a/WordPress/v2/Pages.cs +++ b/WordPress/v2/Pages.cs @@ -48,7 +48,7 @@ public string guid /// Unique identifier for the object. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// URL to the object. @@ -96,7 +96,7 @@ public string guid /// The ID for the parent of the object. /// [DataMember(EmitDefaultValue = false)] - public uint parent { get; set; } + public ulong? parent { get; set; } /// /// The title for the object. @@ -147,7 +147,7 @@ public string content /// The ID for the author of the object. /// [DataMember(EmitDefaultValue = false)] - public uint author { get; set; } + public ulong? author { get; set; } /// /// The excerpt for the object. @@ -175,7 +175,7 @@ public string excerpt /// The ID of the featured media for the object. /// [DataMember(EmitDefaultValue = false)] - public int featured_media { get; set; } + public ulong? featured_media { get; set; } /// /// Whether or not comments are open on the object. diff --git a/WordPress/v2/PostRevisions.cs b/WordPress/v2/PostRevisions.cs index d4a44e1..94150a6 100644 --- a/WordPress/v2/PostRevisions.cs +++ b/WordPress/v2/PostRevisions.cs @@ -14,7 +14,7 @@ public class PostRevisions /// The ID for the author of the object. /// [DataMember(EmitDefaultValue = false)] - public uint author { get; set; } + public ulong? author { get; set; } /// /// The date the object was published, in the site's timezone. @@ -54,7 +54,7 @@ public string guid /// Unique identifier for the object. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// The date the object was last modified, in the site's timezone. @@ -72,7 +72,7 @@ public string guid /// The ID for the parent of the object. /// [DataMember(EmitDefaultValue = false)] - public uint parent { get; set; } + public ulong? parent { get; set; } /// /// An alphanumeric identifier for the object unique to its type. diff --git a/WordPress/v2/Posts.cs b/WordPress/v2/Posts.cs index f424351..e7ec234 100644 --- a/WordPress/v2/Posts.cs +++ b/WordPress/v2/Posts.cs @@ -49,7 +49,7 @@ public string guid /// Unique identifier for the object. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// URL to the object. @@ -141,7 +141,7 @@ public string content /// The ID for the author of the object. /// [DataMember(EmitDefaultValue = false)] - public uint author { get; set; } + public ulong? author { get; set; } /// /// The excerpt for the object. @@ -169,7 +169,7 @@ public string excerpt /// The ID of the featured media for the object. /// [DataMember(EmitDefaultValue = false)] - public int featured_media { get; set; } + public ulong? featured_media { get; set; } /// /// Whether or not comments are open on the object. diff --git a/WordPress/v2/Tags.cs b/WordPress/v2/Tags.cs index 1133008..a5880ae 100644 --- a/WordPress/v2/Tags.cs +++ b/WordPress/v2/Tags.cs @@ -14,13 +14,13 @@ public class Tags /// Unique identifier for the term. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// Number of published posts for the term. /// [DataMember(EmitDefaultValue = false)] - public int count { get; set; } + public uint count { get; set; } /// /// HTML description of the term. diff --git a/WordPress/v2/Users.cs b/WordPress/v2/Users.cs index 255540a..90afcdf 100644 --- a/WordPress/v2/Users.cs +++ b/WordPress/v2/Users.cs @@ -14,7 +14,7 @@ public class Users /// Unique identifier for the user. /// [DataMember(EmitDefaultValue = false)] - public uint id { get; set; } + public ulong? id { get; set; } /// /// Login name for the user.