diff --git a/ShopifySharp.Experimental/ShopifySharp.Experimental.fsproj b/ShopifySharp.Experimental/ShopifySharp.Experimental.fsproj
index af535d2d..054802c5 100755
--- a/ShopifySharp.Experimental/ShopifySharp.Experimental.fsproj
+++ b/ShopifySharp.Experimental/ShopifySharp.Experimental.fsproj
@@ -34,4 +34,4 @@
-
\ No newline at end of file
+
diff --git a/ShopifySharp.Extensions.DependencyInjection.Tests/TestExtensions.cs b/ShopifySharp.Extensions.DependencyInjection.Tests/TestExtensions.cs
index 3c6acb41..817cc78a 100644
--- a/ShopifySharp.Extensions.DependencyInjection.Tests/TestExtensions.cs
+++ b/ShopifySharp.Extensions.DependencyInjection.Tests/TestExtensions.cs
@@ -1,28 +1,27 @@
-namespace ShopifySharp.Extensions.DependencyInjection.Tests
+namespace ShopifySharp.Extensions.DependencyInjection.Tests;
+
+public static class ObjectExtensions
{
- public static class ObjectExtensions
+ private static readonly Dictionary ServiceLifetimeInstanceValidation = new()
{
- private static readonly Dictionary ServiceLifetimeInstanceValidation = new()
- {
- { ServiceLifetime.Scoped, true },
- { ServiceLifetime.Singleton, true },
- { ServiceLifetime.Transient, false }
- };
+ { ServiceLifetime.Scoped, true },
+ { ServiceLifetime.Singleton, true },
+ { ServiceLifetime.Transient, false }
+ };
- public static bool ValidLifetimeInstance(this object actual, object expceted, ServiceLifetime serviceLifetime)
- {
- return ServiceLifetimeInstanceValidation.TryGetValue(serviceLifetime, out bool value) && value ? ReferenceEquals(actual, expceted) : !ReferenceEquals(actual, expceted);
- }
+ public static bool ValidLifetimeInstance(this object actual, object expceted, ServiceLifetime serviceLifetime)
+ {
+ return ServiceLifetimeInstanceValidation.TryGetValue(serviceLifetime, out bool value) && value ? ReferenceEquals(actual, expceted) : !ReferenceEquals(actual, expceted);
}
+}
- public static class ServiceProviderExtensions
+public static class ServiceProviderExtensions
+{
+ public static TestServiceLifetime GetServiceInstances(this ServiceProvider? serviceProvider) where T : class
{
- public static TestServiceLifetime GetServiceInstances(this ServiceProvider? serviceProvider) where T : class
- {
- var service1 = serviceProvider?.GetService();
- var service2 = serviceProvider?.GetService();
+ var service1 = serviceProvider?.GetService();
+ var service2 = serviceProvider?.GetService();
- return new TestServiceLifetime(service1, service2);
- }
+ return new TestServiceLifetime(service1, service2);
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp.Extensions.DependencyInjection/ShopifySharp.Extensions.DependencyInjection.csproj b/ShopifySharp.Extensions.DependencyInjection/ShopifySharp.Extensions.DependencyInjection.csproj
index 8f56689e..6d3b8bbb 100644
--- a/ShopifySharp.Extensions.DependencyInjection/ShopifySharp.Extensions.DependencyInjection.csproj
+++ b/ShopifySharp.Extensions.DependencyInjection/ShopifySharp.Extensions.DependencyInjection.csproj
@@ -27,4 +27,4 @@
-
\ No newline at end of file
+
diff --git a/ShopifySharp.Tests/Checkout_Tests.cs b/ShopifySharp.Tests/Checkout_Tests.cs
index 5e4b9eaf..11217cab 100644
--- a/ShopifySharp.Tests/Checkout_Tests.cs
+++ b/ShopifySharp.Tests/Checkout_Tests.cs
@@ -1,4 +1,4 @@
-using System.Threading.Tasks;
+using System.Threading.Tasks;
using Xunit;
namespace ShopifySharp.Tests;
diff --git a/ShopifySharp.Tests/CustomerAddress_Tests.cs b/ShopifySharp.Tests/CustomerAddress_Tests.cs
index 3b0f1d7c..d3493fc7 100644
--- a/ShopifySharp.Tests/CustomerAddress_Tests.cs
+++ b/ShopifySharp.Tests/CustomerAddress_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
diff --git a/ShopifySharp.Tests/DateTime_Tests.cs b/ShopifySharp.Tests/DateTime_Tests.cs
index 712af61d..a0fc3195 100644
--- a/ShopifySharp.Tests/DateTime_Tests.cs
+++ b/ShopifySharp.Tests/DateTime_Tests.cs
@@ -1,4 +1,4 @@
-#nullable enable
+#nullable enable
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
diff --git a/ShopifySharp.Tests/DiscountCode_Tests.cs b/ShopifySharp.Tests/DiscountCode_Tests.cs
index e5892b36..f83c6d30 100644
--- a/ShopifySharp.Tests/DiscountCode_Tests.cs
+++ b/ShopifySharp.Tests/DiscountCode_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
diff --git a/ShopifySharp.Tests/FulfillmentRequest_Tests.cs b/ShopifySharp.Tests/FulfillmentRequest_Tests.cs
index 9134c6e3..7f2b8451 100644
--- a/ShopifySharp.Tests/FulfillmentRequest_Tests.cs
+++ b/ShopifySharp.Tests/FulfillmentRequest_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
diff --git a/ShopifySharp.Tests/GenerateGraphQLSchema_Test.cs b/ShopifySharp.Tests/GenerateGraphQLSchema_Test.cs
index 1d6a27e4..ad8f1af4 100644
--- a/ShopifySharp.Tests/GenerateGraphQLSchema_Test.cs
+++ b/ShopifySharp.Tests/GenerateGraphQLSchema_Test.cs
@@ -7,44 +7,43 @@
using Wish.GraphQLSchemaGenerator;
using Xunit;
-namespace ShopifySharp.Tests
+namespace ShopifySharp.Tests;
+
+[Trait("Category", "GraphQL")]
+public class GenerateGraphQLSchema_Test
{
- [Trait("Category", "GraphQL")]
- public class GenerateGraphQLSchema_Test
+ [Fact(Skip = "This test should be run manually to re-generate the GraphQL types whenever the API version is upgraded")]
+ public async Task GenerateGraphQLTypes()
{
- [Fact(Skip = "This test should be run manually to re-generate the GraphQL types whenever the API version is upgraded")]
- public async Task GenerateGraphQLTypes()
+ var scalarNameToTypeName = new Dictionary
+ {
+ { "UnsignedInt64", "ulong" },
+ { "Money", "decimal" },
+ { "Decimal", "decimal" },
+ { "DateTime", "DateTime" },//GraphQL datetimes are always UTC
+ { "Date", "DateOnly" },
+ { "UtcOffset", "TimeSpan" },
+ { "URL", "string" },
+ { "HTML", "string" },
+ { "JSON", "string" },
+ { "FormattedString", "string" },
+ { "ARN", "string" },
+ { "StorefrontID", "string" },
+ { "Color", "string" },
+ };
+ string csharpCode = await new GraphQLTypeGenerator().GenerateTypesAsync("ShopifySharp.GraphQL", scalarNameToTypeName, async query =>
{
- var scalarNameToTypeName = new Dictionary
- {
- { "UnsignedInt64", "ulong" },
- { "Money", "decimal" },
- { "Decimal", "decimal" },
- { "DateTime", "DateTime" },//GraphQL datetimes are always UTC
- { "Date", "DateOnly" },
- { "UtcOffset", "TimeSpan" },
- { "URL", "string" },
- { "HTML", "string" },
- { "JSON", "string" },
- { "FormattedString", "string" },
- { "ARN", "string" },
- { "StorefrontID", "string" },
- { "Color", "string" },
- };
- string csharpCode = await new GraphQLTypeGenerator().GenerateTypesAsync("ShopifySharp.GraphQL", scalarNameToTypeName, async query =>
- {
- var res = await new GraphService(Utils.MyShopifyUrl, Utils.AccessToken).PostAsync(query);
- var doc = JsonDocument.Parse(res.ToString());
- return doc;
- });
+ var res = await new GraphService(Utils.MyShopifyUrl, Utils.AccessToken).PostAsync(query);
+ var doc = JsonDocument.Parse(res.ToString());
+ return doc;
+ });
- var strCode = new StringBuilder()
- .AppendLine("#if NET6_0_OR_GREATER")
- .AppendLine(csharpCode)
- .AppendLine("#endif");
+ var strCode = new StringBuilder()
+ .AppendLine("#if NET6_0_OR_GREATER")
+ .AppendLine(csharpCode)
+ .AppendLine("#endif");
- File.WriteAllText(@"../../../../ShopifySharp/Entities/GraphQL/GraphQLSchema.generated.cs", strCode.ToString());
- }
+ File.WriteAllText(@"../../../../ShopifySharp/Entities/GraphQL/GraphQLSchema.generated.cs", strCode.ToString());
}
}
#endif
diff --git a/ShopifySharp.Tests/GiftCard_Tests.cs b/ShopifySharp.Tests/GiftCard_Tests.cs
index 91993c8b..9d409d5e 100644
--- a/ShopifySharp.Tests/GiftCard_Tests.cs
+++ b/ShopifySharp.Tests/GiftCard_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
diff --git a/ShopifySharp.Tests/Graph_SendTests.cs b/ShopifySharp.Tests/Graph_SendTests.cs
index 0bace957..e0850476 100644
--- a/ShopifySharp.Tests/Graph_SendTests.cs
+++ b/ShopifySharp.Tests/Graph_SendTests.cs
@@ -4,24 +4,24 @@
using ShopifySharp.GraphQL;
using Xunit;
-namespace ShopifySharp.Tests
+namespace ShopifySharp.Tests;
+
+[Trait("Category", "Graph")]
+public class Graph_SendTests
{
- [Trait("Category", "Graph")]
- public class Graph_SendTests
+ [Fact]
+ public async Task GetOrders()
{
- [Fact]
- public async Task GetOrders()
+ foreach (var policy in new IRequestExecutionPolicy[]
+ {
+ new DefaultRequestExecutionPolicy(),
+ new RetryExecutionPolicy(),
+ new LeakyBucketExecutionPolicy()
+ })
{
- foreach (var policy in new IRequestExecutionPolicy[]
- {
- new DefaultRequestExecutionPolicy(),
- new RetryExecutionPolicy(),
- new LeakyBucketExecutionPolicy()
- })
- {
- var svc = new GraphService(Utils.MyShopifyUrl, Utils.AccessToken);
- svc.SetExecutionPolicy(policy);
- var res = await svc.SendAsync(@"
+ var svc = new GraphService(Utils.MyShopifyUrl, Utils.AccessToken);
+ svc.SetExecutionPolicy(policy);
+ var res = await svc.SendAsync(@"
{
orders(first:10)
{
@@ -43,33 +43,33 @@ public async Task GetOrders()
}
}
");
- var orders = res.nodes;
- Assert.True(orders.Count() > 0);
- var o = orders.First();
- Assert.True(o.name != null);
- Assert.True(o.lineItems.nodes.First().quantity != null);
- var commentEventEmbed = o as ICommentEventEmbed;
- Assert.NotNull(commentEventEmbed);
- Assert.NotNull(commentEventEmbed.AsOrder());
- Assert.Null(commentEventEmbed.AsCustomer());
- }
+ var orders = res.nodes;
+ Assert.True(orders.Count() > 0);
+ var o = orders.First();
+ Assert.True(o.name != null);
+ Assert.True(o.lineItems.nodes.First().quantity != null);
+ var commentEventEmbed = o as ICommentEventEmbed;
+ Assert.NotNull(commentEventEmbed);
+ Assert.NotNull(commentEventEmbed.AsOrder());
+ Assert.Null(commentEventEmbed.AsCustomer());
}
+ }
- [Fact]
- public async Task GetOrdersWithVariables()
+ [Fact]
+ public async Task GetOrdersWithVariables()
+ {
+ foreach (var policy in new IRequestExecutionPolicy[]
+ {
+ new DefaultRequestExecutionPolicy(),
+ new RetryExecutionPolicy(),
+ new LeakyBucketExecutionPolicy()
+ })
{
- foreach (var policy in new IRequestExecutionPolicy[]
- {
- new DefaultRequestExecutionPolicy(),
- new RetryExecutionPolicy(),
- new LeakyBucketExecutionPolicy()
- })
+ var svc = new GraphService(Utils.MyShopifyUrl, Utils.AccessToken);
+ svc.SetExecutionPolicy(policy);
+ var res = await svc.SendAsync(new GraphRequest
{
- var svc = new GraphService(Utils.MyShopifyUrl, Utils.AccessToken);
- svc.SetExecutionPolicy(policy);
- var res = await svc.SendAsync(new GraphRequest
- {
- query =
+ query =
@"
query ($firstOrders: Int!, $firstLineItems: Int!)
{
@@ -92,22 +92,21 @@ public async Task GetOrdersWithVariables()
}
}
}",
- variables = new
- {
- firstOrders = 10,
- firstLineItems = 20
- }
- });
- var orders = res.nodes;
- Assert.True(orders.Count() > 0);
- var o = orders.First();
- Assert.True(o.name != null);
- Assert.True(o.lineItems.nodes.First().quantity != null);
- var commentEventEmbed = o as ICommentEventEmbed;
- Assert.NotNull(commentEventEmbed);
- Assert.NotNull(commentEventEmbed.AsOrder());
- Assert.Null(commentEventEmbed.AsCustomer());
- }
+ variables = new
+ {
+ firstOrders = 10,
+ firstLineItems = 20
+ }
+ });
+ var orders = res.nodes;
+ Assert.True(orders.Count() > 0);
+ var o = orders.First();
+ Assert.True(o.name != null);
+ Assert.True(o.lineItems.nodes.First().quantity != null);
+ var commentEventEmbed = o as ICommentEventEmbed;
+ Assert.NotNull(commentEventEmbed);
+ Assert.NotNull(commentEventEmbed.AsOrder());
+ Assert.Null(commentEventEmbed.AsCustomer());
}
}
}
diff --git a/ShopifySharp.Tests/LeakyBucket_Tests.cs b/ShopifySharp.Tests/LeakyBucket_Tests.cs
index e92d0766..2b33ca9d 100644
--- a/ShopifySharp.Tests/LeakyBucket_Tests.cs
+++ b/ShopifySharp.Tests/LeakyBucket_Tests.cs
@@ -1,5 +1,7 @@
using System;
+using System.Threading;
using System.Threading.Tasks;
+using FluentAssertions;
using ShopifySharp.Infrastructure.Policies.LeakyBucketPolicy;
using Xunit;
@@ -124,7 +126,7 @@ public async Task BlockedMultipleCallsCompleteAfterEnoughTime()
Assert.False(task3.IsCompleted);
Assert.Equal(1, b.ComputedCurrentlyAvailable);
-
+
await PassSeconds(1);
Assert.True(task1.IsCompleted);
Assert.False(task2.IsCompleted);
@@ -163,4 +165,4 @@ private async Task PassSeconds(int seconds)
now = now.AddSeconds(seconds);
await Task.Delay(TimeSpan.FromSeconds(seconds * 1.2));
}
-}
\ No newline at end of file
+}
diff --git a/ShopifySharp.Tests/Policies/LeakyBucketExecutionPolicyTests.cs b/ShopifySharp.Tests/Policies/LeakyBucketExecutionPolicyTests.cs
index e2ab2dc5..0670b0e8 100644
--- a/ShopifySharp.Tests/Policies/LeakyBucketExecutionPolicyTests.cs
+++ b/ShopifySharp.Tests/Policies/LeakyBucketExecutionPolicyTests.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using JetBrains.Annotations;
diff --git a/ShopifySharp.Tests/SalesChannel/CheckoutSalesChannel_Tests.cs b/ShopifySharp.Tests/SalesChannel/CheckoutSalesChannel_Tests.cs
index 28aa7742..164a5b91 100644
--- a/ShopifySharp.Tests/SalesChannel/CheckoutSalesChannel_Tests.cs
+++ b/ShopifySharp.Tests/SalesChannel/CheckoutSalesChannel_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
diff --git a/ShopifySharp.Tests/SalesChannel/CollectionListing_Tests.cs b/ShopifySharp.Tests/SalesChannel/CollectionListing_Tests.cs
index c40da9d0..05d3d54e 100644
--- a/ShopifySharp.Tests/SalesChannel/CollectionListing_Tests.cs
+++ b/ShopifySharp.Tests/SalesChannel/CollectionListing_Tests.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using System.Threading.Tasks;
using Xunit;
diff --git a/ShopifySharp.Tests/SalesChannel/ProductListing_Tests.cs b/ShopifySharp.Tests/SalesChannel/ProductListing_Tests.cs
index 18141540..892ea10a 100644
--- a/ShopifySharp.Tests/SalesChannel/ProductListing_Tests.cs
+++ b/ShopifySharp.Tests/SalesChannel/ProductListing_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
diff --git a/ShopifySharp.Tests/ShopifySharp.Tests.csproj b/ShopifySharp.Tests/ShopifySharp.Tests.csproj
index 77ab7d11..01b0416e 100644
--- a/ShopifySharp.Tests/ShopifySharp.Tests.csproj
+++ b/ShopifySharp.Tests/ShopifySharp.Tests.csproj
@@ -1,4 +1,4 @@
-
+latestnet8.0;net472
diff --git a/ShopifySharp.Tests/TenderTransaction_Tests.cs b/ShopifySharp.Tests/TenderTransaction_Tests.cs
index f38e4790..621a02c8 100644
--- a/ShopifySharp.Tests/TenderTransaction_Tests.cs
+++ b/ShopifySharp.Tests/TenderTransaction_Tests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Linq;
using System.Threading.Tasks;
using ShopifySharp.Filters;
diff --git a/ShopifySharp.Tests/User_Tests.cs b/ShopifySharp.Tests/User_Tests.cs
index 596ca6c3..05f01efa 100644
--- a/ShopifySharp.Tests/User_Tests.cs
+++ b/ShopifySharp.Tests/User_Tests.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using System.Threading.Tasks;
using ShopifySharp.Filters;
using Xunit;
diff --git a/ShopifySharp/Converters/DateFormatConverter.cs b/ShopifySharp/Converters/DateFormatConverter.cs
index dc38bdc9..91ce0a70 100644
--- a/ShopifySharp/Converters/DateFormatConverter.cs
+++ b/ShopifySharp/Converters/DateFormatConverter.cs
@@ -1,16 +1,15 @@
-using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Converters;
-namespace ShopifySharp.Converters
+namespace ShopifySharp.Converters;
+
+///
+/// Converts a Date to and from the provided date format string.
+/// In Particular, GiftCard.ExpiresOn only accepts the format 'yyyy-MM-dd'. If the time is included the value is ignored
+///
+public class DateFormatConverter : IsoDateTimeConverter
{
- ///
- /// Converts a Date to and from the provided date format string.
- /// In Particular, GiftCard.ExpiresOn only accepts the format 'yyyy-MM-dd'. If the time is included the value is ignored
- ///
- public class DateFormatConverter : IsoDateTimeConverter
+ public DateFormatConverter(string format)
{
- public DateFormatConverter(string format)
- {
- base.DateTimeFormat = format;
- }
+ base.DateTimeFormat = format;
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Converters/FalseToNullConverter.cs b/ShopifySharp/Converters/FalseToNullConverter.cs
index 0dc75341..1dd54d0f 100644
--- a/ShopifySharp/Converters/FalseToNullConverter.cs
+++ b/ShopifySharp/Converters/FalseToNullConverter.cs
@@ -1,73 +1,72 @@
-using System;
+using System;
using Newtonsoft.Json;
-namespace ShopifySharp.Converters
+namespace ShopifySharp.Converters;
+
+///
+/// A custom boolean converter that converts False to null and null to False.
+///
+public class FalseToNullConverter : JsonConverter
{
- ///
- /// A custom boolean converter that converts False to null and null to False.
- ///
- public class FalseToNullConverter : JsonConverter
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ if(reader.Value?.ToString() == null || reader.Value?.ToString() == "")
+ {
+ return false;
+ }
+ else
{
- if(reader.Value?.ToString() == null || reader.Value?.ToString() == "")
+ bool output = false;
+
+ if (bool.TryParse(reader.Value.ToString(), out output))
{
- return false;
+ return output;
}
else
{
- bool output = false;
-
- if (bool.TryParse(reader.Value.ToString(), out output))
- {
- return output;
- }
- else
- {
- throw new JsonReaderException($"Cannot convert given JSON value with {nameof(FalseToNullConverter)}.");
- }
+ throw new JsonReaderException($"Cannot convert given JSON value with {nameof(FalseToNullConverter)}.");
}
}
+ }
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ if (value == null)
{
- if (value == null)
+ writer.WriteNull();
+ }
+ else
+ {
+ bool boolean = bool.Parse(value.ToString());
+
+ if(boolean == false)
{
writer.WriteNull();
}
else
{
- bool boolean = bool.Parse(value.ToString());
-
- if(boolean == false)
- {
- writer.WriteNull();
- }
- else
- {
- writer.WriteValue(true);
- }
+ writer.WriteValue(true);
}
}
+ }
- public override bool CanConvert(Type objectType)
+ public override bool CanConvert(Type objectType)
+ {
+ if(objectType == typeof(string))
{
- if(objectType == typeof(string))
- {
- return true;
- }
- else if(objectType == typeof(bool))
- {
- return true;
- }
- else if(objectType == typeof(Nullable))
- {
- return true;
- }
- else
- {
- return false;
- }
+ return true;
+ }
+ else if(objectType == typeof(bool))
+ {
+ return true;
+ }
+ else if(objectType == typeof(Nullable))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Converters/InvalidDateConverter.cs b/ShopifySharp/Converters/InvalidDateConverter.cs
index 122a91f3..5f8f756f 100644
--- a/ShopifySharp/Converters/InvalidDateConverter.cs
+++ b/ShopifySharp/Converters/InvalidDateConverter.cs
@@ -1,28 +1,27 @@
-using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Converters;
using System;
using Newtonsoft.Json;
-namespace ShopifySharp.Converters
+namespace ShopifySharp.Converters;
+
+///
+/// A custom converter that detects invalid dates and convert them to null instead of throwing an exception.
+/// In particular, FulfillmentEvent.EstimatedDeliveryAt has been observed to sometimes contain an invalid date
+/// e.g '0000-12-31T18:09:24-05:50', which is smaller than both DateTime.MinValue and DateTimeOffset.MinValue
+/// UPDATE October 2022:
+/// This API bug has been encountered in several additional API fields, such as transaction.processed_at, customer.accepts_marketing_updated_at and customer.email_marketing_consent.consent_updated_at
+/// See https://github.com/nozzlegear/ShopifySharp/issues/803
+/// This converter is applied to all date properties because:
+/// *It seems to can start occurring on multiple any date fields
+/// *The impact of not handling is quite severe. ShopifySharp would fail to deserialize and return an error
+///
+public class InvalidDateConverter : IsoDateTimeConverter
{
- ///
- /// A custom converter that detects invalid dates and convert them to null instead of throwing an exception.
- /// In particular, FulfillmentEvent.EstimatedDeliveryAt has been observed to sometimes contain an invalid date
- /// e.g '0000-12-31T18:09:24-05:50', which is smaller than both DateTime.MinValue and DateTimeOffset.MinValue
- /// UPDATE October 2022:
- /// This API bug has been encountered in several additional API fields, such as transaction.processed_at, customer.accepts_marketing_updated_at and customer.email_marketing_consent.consent_updated_at
- /// See https://github.com/nozzlegear/ShopifySharp/issues/803
- /// This converter is applied to all date properties because:
- /// *It seems to can start occurring on multiple any date fields
- /// *The impact of not handling is quite severe. ShopifySharp would fail to deserialize and return an error
- ///
- public class InvalidDateConverter : IsoDateTimeConverter
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- if (reader.Value != null && reader.Value.ToString().StartsWith("0000-"))
- return null;
+ if (reader.Value != null && reader.Value.ToString().StartsWith("0000-"))
+ return null;
- return base.ReadJson(reader, objectType, existingValue, serializer);
- }
+ return base.ReadJson(reader, objectType, existingValue, serializer);
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Converters/NullOnErrorConverter.cs b/ShopifySharp/Converters/NullOnErrorConverter.cs
index b58f4e4b..23d0cdbf 100644
--- a/ShopifySharp/Converters/NullOnErrorConverter.cs
+++ b/ShopifySharp/Converters/NullOnErrorConverter.cs
@@ -1,35 +1,34 @@
-using System;
+using System;
using Newtonsoft.Json;
-namespace ShopifySharp.Converters
+namespace ShopifySharp.Converters;
+
+///
+/// A custom converter that returns null if an error occurs while deserializing
+///
+public class NullOnErrorConverter : JsonConverter
{
- ///
- /// A custom converter that returns null if an error occurs while deserializing
- ///
- public class NullOnErrorConverter : JsonConverter
+ public override bool CanWrite => false;
+
+ public override bool CanConvert(Type objectType)
{
- public override bool CanWrite => false;
+ return true;
+ }
- public override bool CanConvert(Type objectType)
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ {
+ try
{
- return true;
+ return serializer.Deserialize(reader, objectType);
}
-
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ catch
{
- try
- {
- return serializer.Deserialize(reader, objectType);
- }
- catch
- {
- return null;
- }
+ return null;
}
+ }
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
- {
- throw new NotImplementedException($"Unnecessary because {nameof(CanWrite)} is false.");
- }
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ throw new NotImplementedException($"Unnecessary because {nameof(CanWrite)} is false.");
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Converters/NullableEnumConverter.cs b/ShopifySharp/Converters/NullableEnumConverter.cs
index e4d8dd03..cbd20daa 100644
--- a/ShopifySharp/Converters/NullableEnumConverter.cs
+++ b/ShopifySharp/Converters/NullableEnumConverter.cs
@@ -1,52 +1,51 @@
-using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Converters;
using System;
using Newtonsoft.Json;
using System.Runtime.Serialization;
using System.Reflection;
using System.Linq;
-namespace ShopifySharp.Converters
+namespace ShopifySharp.Converters;
+
+///
+/// A custom enum converter for all enums which returns the value
+/// as null when the value is null or does not exist.
+///
+public class NullableEnumConverter : StringEnumConverter where T : struct
{
- ///
- /// A custom enum converter for all enums which returns the value
- /// as null when the value is null or does not exist.
- ///
- public class NullableEnumConverter : StringEnumConverter where T : struct
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ T parsed;
+
+ if (!Enum.TryParse(reader.Value?.ToString() ?? "", true, out parsed))
{
- T parsed;
+ // Some EnumMember values have an '_', '-' or '/' in their value and will fail the TryParse or IsDefined checks.
+ // Use reflection to pull all of the enums values, get their EnumMember value and check if there's a match.
- if (!Enum.TryParse(reader.Value?.ToString() ?? "", true, out parsed))
- {
- // Some EnumMember values have an '_', '-' or '/' in their value and will fail the TryParse or IsDefined checks.
- // Use reflection to pull all of the enums values, get their EnumMember value and check if there's a match.
+ var enumType = typeof(T);
+ var enumTypeInfo = enumType.GetTypeInfo();
+ var enumVals = Enum.GetValues(enumType);
- var enumType = typeof(T);
- var enumTypeInfo = enumType.GetTypeInfo();
- var enumVals = Enum.GetValues(enumType);
+ foreach (var enumVal in enumVals)
+ {
+ var valInfo = enumTypeInfo.DeclaredMembers;
+ var enumMember = valInfo.First().GetCustomAttributes(typeof(EnumMemberAttribute), false);
- foreach (var enumVal in enumVals)
+ if (enumMember.Count() == 0)
{
- var valInfo = enumTypeInfo.DeclaredMembers;
- var enumMember = valInfo.First().GetCustomAttributes(typeof(EnumMemberAttribute), false);
-
- if (enumMember.Count() == 0)
- {
- continue;
- }
-
- if (((EnumMemberAttribute)enumMember.First()).Value?.ToString() == reader.Value?.ToString())
- {
- return (T)enumVal;
- }
+ continue;
}
- //No match found. Return null.
- return null;
+ if (((EnumMemberAttribute)enumMember.First()).Value?.ToString() == reader.Value?.ToString())
+ {
+ return (T)enumVal;
+ }
}
- return parsed;
+ //No match found. Return null.
+ return null;
}
+
+ return parsed;
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Credentials/ShopifyApiCredentials.cs b/ShopifySharp/Credentials/ShopifyApiCredentials.cs
index 4f1bc60a..4e3a0aa6 100644
--- a/ShopifySharp/Credentials/ShopifyApiCredentials.cs
+++ b/ShopifySharp/Credentials/ShopifyApiCredentials.cs
@@ -5,46 +5,45 @@
using System;
-namespace ShopifySharp.Credentials
+namespace ShopifySharp.Credentials;
+
+public readonly struct ShopifyApiCredentials(string shopDomain, string accessToken)
{
- public readonly struct ShopifyApiCredentials(string shopDomain, string accessToken)
- {
- public string ShopDomain { get; } = shopDomain;
- public string AccessToken { get; } = accessToken;
+ public string ShopDomain { get; } = shopDomain;
+ public string AccessToken { get; } = accessToken;
- #if NETSTANDARD2_0
+#if NETSTANDARD2_0
public override bool Equals(object obj)
{
return obj is ShopifyApiCredentials other
&& ShopDomain == other.ShopDomain
&& AccessToken == other.AccessToken;
}
- #else
- public override bool Equals(object? obj)
- {
- return obj is ShopifyApiCredentials other
- && ShopDomain == other.ShopDomain
- && AccessToken == other.AccessToken;
- }
- #endif
+#else
+ public override bool Equals(object? obj)
+ {
+ return obj is ShopifyApiCredentials other
+ && ShopDomain == other.ShopDomain
+ && AccessToken == other.AccessToken;
+ }
+#endif
- public override int GetHashCode()
- {
- #if NETSTANDARD2_0
+ public override int GetHashCode()
+ {
+#if NETSTANDARD2_0
return (ShopDomain, AccessToken).GetHashCode();
- #else
- return HashCode.Combine(ShopDomain, AccessToken);
- #endif
- }
+#else
+ return HashCode.Combine(ShopDomain, AccessToken);
+#endif
+ }
- public static bool operator ==(ShopifyApiCredentials left, ShopifyApiCredentials right)
- {
- return left.Equals(right);
- }
+ public static bool operator ==(ShopifyApiCredentials left, ShopifyApiCredentials right)
+ {
+ return left.Equals(right);
+ }
- public static bool operator !=(ShopifyApiCredentials left, ShopifyApiCredentials right)
- {
- return !(left == right);
- }
+ public static bool operator !=(ShopifyApiCredentials left, ShopifyApiCredentials right)
+ {
+ return !(left == right);
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Credentials/ShopifyPartnerApiCredentials.cs b/ShopifySharp/Credentials/ShopifyPartnerApiCredentials.cs
index 4e566f99..f5e44bee 100644
--- a/ShopifySharp/Credentials/ShopifyPartnerApiCredentials.cs
+++ b/ShopifySharp/Credentials/ShopifyPartnerApiCredentials.cs
@@ -5,46 +5,45 @@
using System;
-namespace ShopifySharp.Credentials
+namespace ShopifySharp.Credentials;
+
+public readonly struct ShopifyPartnerApiCredentials(long partnerOrganizationId, string accessToken)
{
- public readonly struct ShopifyPartnerApiCredentials(long partnerOrganizationId, string accessToken)
- {
- public long PartnerOrganizationId { get; } = partnerOrganizationId;
- public string AccessToken { get; } = accessToken;
+ public long PartnerOrganizationId { get; } = partnerOrganizationId;
+ public string AccessToken { get; } = accessToken;
- #if NETSTANDARD2_0
+#if NETSTANDARD2_0
public override bool Equals(object obj)
{
return obj is ShopifyPartnerApiCredentials other
&& PartnerOrganizationId == other.PartnerOrganizationId
&& AccessToken == other.AccessToken;
}
- #else
- public override bool Equals(object? obj)
- {
- return obj is ShopifyPartnerApiCredentials other
- && PartnerOrganizationId == other.PartnerOrganizationId
- && AccessToken == other.AccessToken;
- }
- #endif
+#else
+ public override bool Equals(object? obj)
+ {
+ return obj is ShopifyPartnerApiCredentials other
+ && PartnerOrganizationId == other.PartnerOrganizationId
+ && AccessToken == other.AccessToken;
+ }
+#endif
- public override int GetHashCode()
- {
- #if NETSTANDARD2_0
+ public override int GetHashCode()
+ {
+#if NETSTANDARD2_0
return (PartnerOrganizationId, AccessToken).GetHashCode();
- #else
- return HashCode.Combine(PartnerOrganizationId, AccessToken);
- #endif
- }
+#else
+ return HashCode.Combine(PartnerOrganizationId, AccessToken);
+#endif
+ }
- public static bool operator ==(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
- {
- return left.Equals(right);
- }
+ public static bool operator ==(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
+ {
+ return left.Equals(right);
+ }
- public static bool operator !=(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
- {
- return !(left == right);
- }
+ public static bool operator !=(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
+ {
+ return !(left == right);
}
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/AccessScope.cs b/ShopifySharp/Entities/AccessScope.cs
index 5c037ae5..eac72b37 100644
--- a/ShopifySharp/Entities/AccessScope.cs
+++ b/ShopifySharp/Entities/AccessScope.cs
@@ -1,16 +1,15 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing an access scope
+///
+public class AccessScope
{
///
- /// An object representing an access scope
+ /// The scope's handle, such as "read_orders", "write_products", etc...
///
- public class AccessScope
- {
- ///
- /// The scope's handle, such as "read_orders", "write_products", etc...
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
- }
-}
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Address.cs b/ShopifySharp/Entities/Address.cs
index 1ad61300..e546764b 100644
--- a/ShopifySharp/Entities/Address.cs
+++ b/ShopifySharp/Entities/Address.cs
@@ -1,109 +1,108 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class Address: ShopifyObject
{
- public class Address: ShopifyObject
- {
- ///
- /// The mailing address.
- ///
- [JsonProperty("address1")]
- public string Address1 { get; set; }
-
- ///
- /// An additional field for the mailing address.
- ///
- [JsonProperty("address2")]
- public string Address2 { get; set; }
-
- ///
- /// The city.
- ///
- [JsonProperty("city")]
- public string City { get; set; }
-
- ///
- /// The company.
- ///
- [JsonProperty("company")]
- public string Company { get; set; }
-
- ///
- /// The country.
- ///
- [JsonProperty("country")]
- public string Country { get; set; }
-
- ///
- /// The two-letter country code corresponding to the country.
- ///
- [JsonProperty("country_code")]
- public string CountryCode { get; set; }
-
- ///
- /// The normalized country name.
- ///
- [JsonProperty("country_name")]
- public string CountryName { get; set; }
-
- ///
- /// Indicates whether this address is the default address.
- ///
- [JsonProperty("default")]
- public bool? Default { get; set; }
-
- ///
- /// The first name.
- ///
- [JsonProperty("first_name")]
- public string FirstName { get; set; }
-
- ///
- /// The last name.
- ///
- [JsonProperty("last_name")]
- public string LastName { get; set; }
-
- ///
- /// The latitude. Auto-populated by Shopify on the order's Billing/Shipping address.
- ///
- [JsonProperty("latitude")]
- public decimal? Latitude { get; set; }
-
- ///
- /// The longitude. Auto-populated by Shopify on the order's Billing/Shipping address.
- ///
- [JsonProperty("longitude")]
- public decimal? Longitude { get; set; }
-
- ///
- /// The name.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
-
- ///
- /// The phone number.
- ///
- [JsonProperty("phone")]
- public string Phone { get; set; }
-
- ///
- /// The province or state name
- ///
- [JsonProperty("province")]
- public string Province { get; set; }
-
- ///
- /// The two-letter province or state code.
- ///
- [JsonProperty("province_code")]
- public string ProvinceCode { get; set; }
-
- ///
- /// The ZIP or postal code.
- ///
- [JsonProperty("zip")]
- public string Zip { get; set; }
- }
-}
+ ///
+ /// The mailing address.
+ ///
+ [JsonProperty("address1")]
+ public string Address1 { get; set; }
+
+ ///
+ /// An additional field for the mailing address.
+ ///
+ [JsonProperty("address2")]
+ public string Address2 { get; set; }
+
+ ///
+ /// The city.
+ ///
+ [JsonProperty("city")]
+ public string City { get; set; }
+
+ ///
+ /// The company.
+ ///
+ [JsonProperty("company")]
+ public string Company { get; set; }
+
+ ///
+ /// The country.
+ ///
+ [JsonProperty("country")]
+ public string Country { get; set; }
+
+ ///
+ /// The two-letter country code corresponding to the country.
+ ///
+ [JsonProperty("country_code")]
+ public string CountryCode { get; set; }
+
+ ///
+ /// The normalized country name.
+ ///
+ [JsonProperty("country_name")]
+ public string CountryName { get; set; }
+
+ ///
+ /// Indicates whether this address is the default address.
+ ///
+ [JsonProperty("default")]
+ public bool? Default { get; set; }
+
+ ///
+ /// The first name.
+ ///
+ [JsonProperty("first_name")]
+ public string FirstName { get; set; }
+
+ ///
+ /// The last name.
+ ///
+ [JsonProperty("last_name")]
+ public string LastName { get; set; }
+
+ ///
+ /// The latitude. Auto-populated by Shopify on the order's Billing/Shipping address.
+ ///
+ [JsonProperty("latitude")]
+ public decimal? Latitude { get; set; }
+
+ ///
+ /// The longitude. Auto-populated by Shopify on the order's Billing/Shipping address.
+ ///
+ [JsonProperty("longitude")]
+ public decimal? Longitude { get; set; }
+
+ ///
+ /// The name.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// The phone number.
+ ///
+ [JsonProperty("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// The province or state name
+ ///
+ [JsonProperty("province")]
+ public string Province { get; set; }
+
+ ///
+ /// The two-letter province or state code.
+ ///
+ [JsonProperty("province_code")]
+ public string ProvinceCode { get; set; }
+
+ ///
+ /// The ZIP or postal code.
+ ///
+ [JsonProperty("zip")]
+ public string Zip { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/ApplicationCredit.cs b/ShopifySharp/Entities/ApplicationCredit.cs
index f104925d..ef914202 100644
--- a/ShopifySharp/Entities/ApplicationCredit.cs
+++ b/ShopifySharp/Entities/ApplicationCredit.cs
@@ -1,28 +1,27 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing Shopify's ApplicationCredit object, which can be used to offer credits for payments made via the Application Charge, Recurring Application Charge, and Usage Charge APIs.
+///
+public class ApplicationCredit: ShopifyObject
{
///
- /// An object representing Shopify's ApplicationCredit object, which can be used to offer credits for payments made via the Application Charge, Recurring Application Charge, and Usage Charge APIs.
+ /// The description of the application credit.
///
- public class ApplicationCredit: ShopifyObject
- {
- ///
- /// The description of the application credit.
- ///
- [JsonProperty("description")]
- public string Description { get; set; }
+ [JsonProperty("description")]
+ public string Description { get; set; }
- ///
- /// The amount refunded by the application credit.
- ///
- [JsonProperty("amount")]
- public decimal? Amount { get; set; }
+ ///
+ /// The amount refunded by the application credit.
+ ///
+ [JsonProperty("amount")]
+ public decimal? Amount { get; set; }
- ///
- /// States whether or not the application credit is a test transaction. Valid values are true or null.
- ///
- [JsonProperty("test")]
- public bool? Test { get; set; }
- }
-}
+ ///
+ /// States whether or not the application credit is a test transaction. Valid values are true or null.
+ ///
+ [JsonProperty("test")]
+ public bool? Test { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/AppliedDiscount.cs b/ShopifySharp/Entities/AppliedDiscount.cs
index e9236bb3..f40ab408 100644
--- a/ShopifySharp/Entities/AppliedDiscount.cs
+++ b/ShopifySharp/Entities/AppliedDiscount.cs
@@ -1,39 +1,38 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class AppliedDiscount
{
- public class AppliedDiscount
- {
- ///
- /// Title of the discount.
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// Title of the discount.
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// Reason for the discount.
- ///
- [JsonProperty("description")]
- public string Description { get; set; }
+ ///
+ /// Reason for the discount.
+ ///
+ [JsonProperty("description")]
+ public string Description { get; set; }
- ///
- /// he value of the discount. If the type of the discount is fixed_amount, then this is a fixed dollar amount. If the type is percentage, then this is the percentage.
- ///
- [JsonProperty("value")]
- public string Value { get; set; }
+ ///
+ /// he value of the discount. If the type of the discount is fixed_amount, then this is a fixed dollar amount. If the type is percentage, then this is the percentage.
+ ///
+ [JsonProperty("value")]
+ public string Value { get; set; }
- ///
- /// The type of discount. Known values are "percentage" and "fixed_amount".
- ///
- [JsonProperty("value_type")]
- public string ValueType { get; set; }
+ ///
+ /// The type of discount. Known values are "percentage" and "fixed_amount".
+ ///
+ [JsonProperty("value_type")]
+ public string ValueType { get; set; }
- ///
- /// The applied amount of the discount, based on the setting of value_type.
- /// When ValueType is set to fixed_amount discount amount = quantity * value
- /// When ValueType is set to percentage discount amount = floor(price * quantity * value) / 100
- ///
- [JsonProperty("amount")]
- public decimal? Amount { get; set; }
- }
-}
+ ///
+ /// The applied amount of the discount, based on the setting of value_type.
+ /// When ValueType is set to fixed_amount discount amount = quantity * value
+ /// When ValueType is set to percentage discount amount = floor(price * quantity * value) / 100
+ ///
+ [JsonProperty("amount")]
+ public decimal? Amount { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Article.cs b/ShopifySharp/Entities/Article.cs
index fad21b9c..b36bbef0 100644
--- a/ShopifySharp/Entities/Article.cs
+++ b/ShopifySharp/Entities/Article.cs
@@ -1,95 +1,94 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify blog article.
+///
+public class Article : ShopifyObject
{
///
- /// An object representing a Shopify blog article.
+ /// The name of the author of this article
///
- public class Article : ShopifyObject
- {
- ///
- /// The name of the author of this article
- ///
- [JsonProperty("author")]
- public string Author { get; set; }
+ [JsonProperty("author")]
+ public string Author { get; set; }
- ///
- /// A unique numeric identifier for the blog containing the article.
- ///
- [JsonProperty("blog_id")]
- public long? BlogId { get; set; }
+ ///
+ /// A unique numeric identifier for the blog containing the article.
+ ///
+ [JsonProperty("blog_id")]
+ public long? BlogId { get; set; }
- ///
- /// The text of the body of the article, complete with HTML markup.
- ///
- [JsonProperty("body_html")]
- public string BodyHtml { get; set; }
+ ///
+ /// The text of the body of the article, complete with HTML markup.
+ ///
+ [JsonProperty("body_html")]
+ public string BodyHtml { get; set; }
- ///
- /// The date and time when the article was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time when the article was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// A human-friendly unique string for an article automatically generated from its title. It is used in the article's URL.
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
+ ///
+ /// A human-friendly unique string for an article automatically generated from its title. It is used in the article's URL.
+ ///
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
- ///
- /// The article image.
- ///
- [JsonProperty("image")]
- public ArticleImage Image { get; set; }
+ ///
+ /// The article image.
+ ///
+ [JsonProperty("image")]
+ public ArticleImage Image { get; set; }
- ///
- /// States whether or not the article is visible.
- ///
- [JsonProperty("published")]
- public bool? Published { get; set; }
+ ///
+ /// States whether or not the article is visible.
+ ///
+ [JsonProperty("published")]
+ public bool? Published { get; set; }
- ///
- /// The date and time when the article was published.
- ///
- [JsonProperty("published_at")]
- public DateTimeOffset? PublishedAt { get; set; }
+ ///
+ /// The date and time when the article was published.
+ ///
+ [JsonProperty("published_at")]
+ public DateTimeOffset? PublishedAt { get; set; }
- ///
- /// The text of the summary of the article, complete with HTML markup.
- ///
- [JsonProperty("summary_html")]
- public string SummaryHtml { get; set; }
+ ///
+ /// The text of the summary of the article, complete with HTML markup.
+ ///
+ [JsonProperty("summary_html")]
+ public string SummaryHtml { get; set; }
- ///
- /// Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3.
- ///
- [JsonProperty("tags")]
- public string Tags { get; set; }
+ ///
+ /// Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3.
+ ///
+ [JsonProperty("tags")]
+ public string Tags { get; set; }
- ///
- /// States the name of the template an article is using if it is using an alternate template. If an article is using the default article.liquid template, the value returned is null.
- ///
- [JsonProperty("template_suffix")]
- public string TemplateSuffix { get; set; }
+ ///
+ /// States the name of the template an article is using if it is using an alternate template. If an article is using the default article.liquid template, the value returned is null.
+ ///
+ [JsonProperty("template_suffix")]
+ public string TemplateSuffix { get; set; }
- ///
- /// The title of the article.
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// The title of the article.
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// The date and time when the article was last updated.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ ///
+ /// The date and time when the article was last updated.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- ///
- /// A unique numeric identifier for the author of the article.
- ///
- [JsonProperty("user_id")]
- public long? UserId { get; set; }
- }
-}
+ ///
+ /// A unique numeric identifier for the author of the article.
+ ///
+ [JsonProperty("user_id")]
+ public long? UserId { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/ArticleImage.cs b/ShopifySharp/Entities/ArticleImage.cs
index 37bc167c..3b6e18bc 100644
--- a/ShopifySharp/Entities/ArticleImage.cs
+++ b/ShopifySharp/Entities/ArticleImage.cs
@@ -1,29 +1,28 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Represents a Shopify article's image.
+///
+public class ArticleImage
{
///
- /// Represents a Shopify article's image.
+ /// A base64 image string only used when creating an image. It will be converted to the property.
///
- public class ArticleImage
- {
- ///
- /// A base64 image string only used when creating an image. It will be converted to the property.
- ///
- [JsonProperty("attachment")]
- public string Attachment { get; set; }
+ [JsonProperty("attachment")]
+ public string Attachment { get; set; }
- ///
- /// The date and time the image was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time the image was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// The image's src URL.
- ///
- [JsonProperty("src")]
- public string Src { get; set; }
- }
-}
+ ///
+ /// The image's src URL.
+ ///
+ [JsonProperty("src")]
+ public string Src { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Asset.cs b/ShopifySharp/Entities/Asset.cs
index 870eebb7..d7ce1da3 100644
--- a/ShopifySharp/Entities/Asset.cs
+++ b/ShopifySharp/Entities/Asset.cs
@@ -1,87 +1,86 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify asset. Assets do not have ids, but rather keys, and are associated with specific themes.
+///
+public class Asset
{
///
- /// An object representing a Shopify asset. Assets do not have ids, but rather keys, and are associated with specific themes.
+ /// An asset attached to a store's theme.
///
- public class Asset
- {
- ///
- /// An asset attached to a store's theme.
- ///
- [JsonProperty("attachment")]
- public string Attachment { get; set; }
+ [JsonProperty("attachment")]
+ public string Attachment { get; set; }
- ///
- /// The MD5 representation of the content, consisting of a string of 32 hexadecimal digits.
- /// May be null if an asset has not been updated recently.
- ///
- [JsonProperty("checksum")]
- public string Checksum { get; set; }
+ ///
+ /// The MD5 representation of the content, consisting of a string of 32 hexadecimal digits.
+ /// May be null if an asset has not been updated recently.
+ ///
+ [JsonProperty("checksum")]
+ public string Checksum { get; set; }
- ///
- /// MIME representation of the content, consisting of the type and subtype of the asset,
- /// e.g. "image/gif"
- ///
- [JsonProperty("content_type")]
- public string ContentType { get; set; }
+ ///
+ /// MIME representation of the content, consisting of the type and subtype of the asset,
+ /// e.g. "image/gif"
+ ///
+ [JsonProperty("content_type")]
+ public string ContentType { get; set; }
- ///
- /// The date and time when the asset was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time when the asset was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// The path to the asset within a shop, prefixed with the asset's 'bucket' type,
- /// e.g. 'templates/index.liquid' or 'assets/bg-body.gif'.
- ///
- [JsonProperty("key")]
- public string Key { get; set; }
+ ///
+ /// The path to the asset within a shop, prefixed with the asset's 'bucket' type,
+ /// e.g. 'templates/index.liquid' or 'assets/bg-body.gif'.
+ ///
+ [JsonProperty("key")]
+ public string Key { get; set; }
- ///
- /// The public facing URL of the asset.
- ///
- [JsonProperty("public_url")]
- public string PublicUrl { get; set; }
+ ///
+ /// The public facing URL of the asset.
+ ///
+ [JsonProperty("public_url")]
+ public string PublicUrl { get; set; }
- ///
- /// The asset size in bytes.
- ///
- [JsonProperty("size")]
- public long? Size { get; set; }
+ ///
+ /// The asset size in bytes.
+ ///
+ [JsonProperty("size")]
+ public long? Size { get; set; }
- ///
- /// When set in an asset and used in ,
- /// a new asset will be created and copied from an asset with the key matching this source key.
- ///
- [JsonProperty("source_key")]
- public string SourceKey { get; set; }
+ ///
+ /// When set in an asset and used in ,
+ /// a new asset will be created and copied from an asset with the key matching this source key.
+ ///
+ [JsonProperty("source_key")]
+ public string SourceKey { get; set; }
- ///
- /// Specifies the location of an asset.
- ///
- [JsonProperty("src")]
- public string Src { get; set; }
+ ///
+ /// Specifies the location of an asset.
+ ///
+ [JsonProperty("src")]
+ public string Src { get; set; }
- ///
- /// A unique numeric identifier for the theme.
- ///
- [JsonProperty("theme_id")]
- public long? ThemeId { get; set; }
+ ///
+ /// A unique numeric identifier for the theme.
+ ///
+ [JsonProperty("theme_id")]
+ public long? ThemeId { get; set; }
- ///
- /// The date and time when an asset was last updated.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ ///
+ /// The date and time when an asset was last updated.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- ///
- /// The asset that you are adding.
- ///
- [JsonProperty("value")]
- public string Value { get; set; }
- }
-}
+ ///
+ /// The asset that you are adding.
+ ///
+ [JsonProperty("value")]
+ public string Value { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/AssignedFulfillmentOrder.cs b/ShopifySharp/Entities/AssignedFulfillmentOrder.cs
index 45aeda3f..ab23910c 100644
--- a/ShopifySharp/Entities/AssignedFulfillmentOrder.cs
+++ b/ShopifySharp/Entities/AssignedFulfillmentOrder.cs
@@ -1,66 +1,65 @@
using Newtonsoft.Json;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify assigned fulfillment order.
+///
+public class AssignedFulfillmentOrder : ShopifyObject
{
///
- /// An object representing a Shopify assigned fulfillment order.
+ /// The ID of the fulfillment order's assigned location. This is the location from which the order is expected to be fulfilled.
///
- public class AssignedFulfillmentOrder : ShopifyObject
- {
- ///
- /// The ID of the fulfillment order's assigned location. This is the location from which the order is expected to be fulfilled.
- ///
- [JsonProperty("assigned_location_id")]
- public long? AssignedLocationId { get; set; }
+ [JsonProperty("assigned_location_id")]
+ public long? AssignedLocationId { get; set; }
- ///
- /// The destination where the items should be sent upon fulfillment.
- ///
- [JsonProperty("destination")]
- public FulfillmentOrderDestination Destination { get; set; }
+ ///
+ /// The destination where the items should be sent upon fulfillment.
+ ///
+ [JsonProperty("destination")]
+ public FulfillmentOrderDestination Destination { get; set; }
- ///
- /// Represents line items belonging to a fulfillment order:
- ///
- [JsonProperty("line_items")]
- public IEnumerable LineItems { get; set; }
+ ///
+ /// Represents line items belonging to a fulfillment order:
+ ///
+ [JsonProperty("line_items")]
+ public IEnumerable LineItems { get; set; }
- ///
- /// The ID of the order that's associated with the fulfillment order.
- ///
- [JsonProperty("order_id")]
- public long? OrderId { get; set; }
+ ///
+ /// The ID of the order that's associated with the fulfillment order.
+ ///
+ [JsonProperty("order_id")]
+ public long? OrderId { get; set; }
- ///
- /// The status of the fulfillment order.
- /// unsubmitted: The initial request status for the newly-created fulfillment orders. This is the only valid request status for fulfillment orders that aren't assigned to a fulfillment service.
- /// submitted: The merchant requested fulfillment for this fulfillment order.
- /// accepted: The fulfillment service accepted the merchant's fulfillment request.
- /// rejected: The fulfillment service rejected the merchant's fulfillment request.
- /// cancellation_requested: The merchant requested a cancellation of the fulfillment request for this fulfillment order.
- /// cancellation_accepted: The fulfillment service accepted the merchant's fulfillment cancellation request.
- /// cancellation_rejected: The fulfillment service rejected the merchant's fulfillment cancellation request.
- /// closed: The fulfillment service closed the fulfillment order without completing it.
- ///
- [JsonProperty("request_status")]
- public string RequestStatus { get; set; }
+ ///
+ /// The status of the fulfillment order.
+ /// unsubmitted: The initial request status for the newly-created fulfillment orders. This is the only valid request status for fulfillment orders that aren't assigned to a fulfillment service.
+ /// submitted: The merchant requested fulfillment for this fulfillment order.
+ /// accepted: The fulfillment service accepted the merchant's fulfillment request.
+ /// rejected: The fulfillment service rejected the merchant's fulfillment request.
+ /// cancellation_requested: The merchant requested a cancellation of the fulfillment request for this fulfillment order.
+ /// cancellation_accepted: The fulfillment service accepted the merchant's fulfillment cancellation request.
+ /// cancellation_rejected: The fulfillment service rejected the merchant's fulfillment cancellation request.
+ /// closed: The fulfillment service closed the fulfillment order without completing it.
+ ///
+ [JsonProperty("request_status")]
+ public string RequestStatus { get; set; }
- ///
- /// The ID of the shop that's associated with the fulfillment order.
- ///
- [JsonProperty("shop_id")]
- public long? ShopId { get; set; }
+ ///
+ /// The ID of the shop that's associated with the fulfillment order.
+ ///
+ [JsonProperty("shop_id")]
+ public long? ShopId { get; set; }
- ///
- /// The status of the fulfillment order. Valid values:
- /// open: Default state for newly created fulfillment orders.
- /// in_progress: The fulfillment order is being processed.
- /// cancelled: The fulfillment order has been cancelled by the merchant.
- /// incomplete: The fulfillment order cannot be completed as requested.
- /// closed: The fulfillment order has been completed and closed.
- ///
- [JsonProperty("status")]
- public string Status { get; set; }
- }
-}
+ ///
+ /// The status of the fulfillment order. Valid values:
+ /// open: Default state for newly created fulfillment orders.
+ /// in_progress: The fulfillment order is being processed.
+ /// cancelled: The fulfillment order has been cancelled by the merchant.
+ /// incomplete: The fulfillment order cannot be completed as requested.
+ /// closed: The fulfillment order has been completed and closed.
+ ///
+ [JsonProperty("status")]
+ public string Status { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/AssignedFulfillmentOrderLineItem.cs b/ShopifySharp/Entities/AssignedFulfillmentOrderLineItem.cs
index c8bdbdea..0c0a62a3 100644
--- a/ShopifySharp/Entities/AssignedFulfillmentOrderLineItem.cs
+++ b/ShopifySharp/Entities/AssignedFulfillmentOrderLineItem.cs
@@ -1,43 +1,42 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class AssignedFulfillmentOrderLineItem : ShopifyObject
{
- public class AssignedFulfillmentOrderLineItem : ShopifyObject
- {
- ///
- /// The ID of the shop associated with the fulfillment order line item.
- ///
- [JsonProperty("shop_id")]
- public long? ShopId { get; set; }
+ ///
+ /// The ID of the shop associated with the fulfillment order line item.
+ ///
+ [JsonProperty("shop_id")]
+ public long? ShopId { get; set; }
- ///
- /// The ID of the fulfillment order associated with this line item.
- ///
- [JsonProperty("fulfillment_order_id")]
- public long? FulfillmentOrderId { get; set; }
+ ///
+ /// The ID of the fulfillment order associated with this line item.
+ ///
+ [JsonProperty("fulfillment_order_id")]
+ public long? FulfillmentOrderId { get; set; }
- ///
- /// The ID of the line item associated with this fulfillment order line item.
- ///
- [JsonProperty("line_item_id")]
- public long? LineItemId { get; set; }
+ ///
+ /// The ID of the line item associated with this fulfillment order line item.
+ ///
+ [JsonProperty("line_item_id")]
+ public long? LineItemId { get; set; }
- ///
- /// The ID of the inventory item associated with this fulfillment order line item.
- ///
- [JsonProperty("inventory_item_id")]
- public long? InventoryItemId { get; set; }
+ ///
+ /// The ID of the inventory item associated with this fulfillment order line item.
+ ///
+ [JsonProperty("inventory_item_id")]
+ public long? InventoryItemId { get; set; }
- ///
- /// The total number of units to be fulfilled.
- ///
- [JsonProperty("quantity")]
- public long? Quantity { get; set; }
+ ///
+ /// The total number of units to be fulfilled.
+ ///
+ [JsonProperty("quantity")]
+ public long? Quantity { get; set; }
- ///
- /// The number of units remaining to be fulfilled.
- ///
- [JsonProperty("fulfillable_quantity")]
- public long? FulfillableQuantity { get; set; }
- }
-}
+ ///
+ /// The number of units remaining to be fulfilled.
+ ///
+ [JsonProperty("fulfillable_quantity")]
+ public long? FulfillableQuantity { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/AssignedLocation.cs b/ShopifySharp/Entities/AssignedLocation.cs
index a0955105..82006f3d 100644
--- a/ShopifySharp/Entities/AssignedLocation.cs
+++ b/ShopifySharp/Entities/AssignedLocation.cs
@@ -1,61 +1,60 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class AssignedLocation
{
- public class AssignedLocation
- {
- ///
- /// The street address of the assigned location.
- ///
- [JsonProperty("address1")]
- public string Address1 { get; set; }
-
- ///
- /// An optional additional field for the street address of the assigned location.
- ///
- [JsonProperty("address2")]
- public string Address2 { get; set; }
-
- ///
- /// The city of the assigned location.
- ///
- [JsonProperty("city")]
- public string City { get; set; }
-
- ///
- /// The two-letter code for the country of the assigned location.
- ///
- [JsonProperty("country_code")]
- public string CountryCode { get; set; }
-
- ///
- /// The ID of the assigned location.
- ///
- [JsonProperty("location_id")]
- public string LocationId { get; set; }
-
- ///
- /// The name of the assigned location.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
-
- ///
- /// The phone number of the assigned location.
- ///
- [JsonProperty("phone")]
- public string Phone { get; set; }
-
- ///
- /// The province of the assigned location.
- ///
- [JsonProperty("province")]
- public string Province { get; set; }
-
- ///
- /// The ZIP code of the assigned location.
- ///
- [JsonProperty("zip")]
- public string Zip { get; set; }
- }
+ ///
+ /// The street address of the assigned location.
+ ///
+ [JsonProperty("address1")]
+ public string Address1 { get; set; }
+
+ ///
+ /// An optional additional field for the street address of the assigned location.
+ ///
+ [JsonProperty("address2")]
+ public string Address2 { get; set; }
+
+ ///
+ /// The city of the assigned location.
+ ///
+ [JsonProperty("city")]
+ public string City { get; set; }
+
+ ///
+ /// The two-letter code for the country of the assigned location.
+ ///
+ [JsonProperty("country_code")]
+ public string CountryCode { get; set; }
+
+ ///
+ /// The ID of the assigned location.
+ ///
+ [JsonProperty("location_id")]
+ public string LocationId { get; set; }
+
+ ///
+ /// The name of the assigned location.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// The phone number of the assigned location.
+ ///
+ [JsonProperty("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// The province of the assigned location.
+ ///
+ [JsonProperty("province")]
+ public string Province { get; set; }
+
+ ///
+ /// The ZIP code of the assigned location.
+ ///
+ [JsonProperty("zip")]
+ public string Zip { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Blog.cs b/ShopifySharp/Entities/Blog.cs
index d1412c11..5f3f7fd9 100644
--- a/ShopifySharp/Entities/Blog.cs
+++ b/ShopifySharp/Entities/Blog.cs
@@ -1,74 +1,73 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Represents a Blog � not a blog post � on a merchant's Shopify store.
+///
+public class Blog: ShopifyObject
{
///
- /// Represents a Blog � not a blog post � on a merchant's Shopify store.
+ /// Indicates whether readers can post comments to the blog and if comments are moderated or not. Possible values are:
+ /// "no" (default): Readers cannot post comments to blog articles.
+ /// "moderate": Readers can post comments to blog articles, but comments must be moderated before they appear.
+ /// "yes": Readers can post comments to blog articles without moderation.
///
- public class Blog: ShopifyObject
- {
- ///
- /// Indicates whether readers can post comments to the blog and if comments are moderated or not. Possible values are:
- /// "no" (default): Readers cannot post comments to blog articles.
- /// "moderate": Readers can post comments to blog articles, but comments must be moderated before they appear.
- /// "yes": Readers can post comments to blog articles without moderation.
- ///
- [JsonProperty("commentable")]
- public string Commentable { get; set; }
+ [JsonProperty("commentable")]
+ public string Commentable { get; set; }
- ///
- /// The date and time when the blog was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time when the blog was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// Feedburner is a web feed management provider and can be enabled to provide custom RSS feeds for Shopify bloggers. This property will default to blank or "null" unless feedburner is enabled through the shop admin.
- ///
- ///
- /// Shopify does not document the value type for this property.
- ///
- [JsonProperty("feedburner")]
- public object Feedburner { get; set; }
+ ///
+ /// Feedburner is a web feed management provider and can be enabled to provide custom RSS feeds for Shopify bloggers. This property will default to blank or "null" unless feedburner is enabled through the shop admin.
+ ///
+ ///
+ /// Shopify does not document the value type for this property.
+ ///
+ [JsonProperty("feedburner")]
+ public object Feedburner { get; set; }
- ///
- /// URL to the feedburner location for blogs that have enabled feedburner through their store admin.
- ///
- [JsonProperty("feedburner_url")]
- public string FeedburnerLocation { get; set; }
+ ///
+ /// URL to the feedburner location for blogs that have enabled feedburner through their store admin.
+ ///
+ [JsonProperty("feedburner_url")]
+ public string FeedburnerLocation { get; set; }
- ///
- /// A human-friendly unique string for a blog automatically generated from its title. This handle is used by the Liquid templating language to refer to the blog.
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
+ ///
+ /// A human-friendly unique string for a blog automatically generated from its title. This handle is used by the Liquid templating language to refer to the blog.
+ ///
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
- ///
- /// Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3.
- ///
- ///
- /// Shopify seems to ignore these tags when creating or updating a blog.
- ///
- [JsonProperty("tags")]
- public string Tags { get; set; }
+ ///
+ /// Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3.
+ ///
+ ///
+ /// Shopify seems to ignore these tags when creating or updating a blog.
+ ///
+ [JsonProperty("tags")]
+ public string Tags { get; set; }
- ///
- /// States the name of the template a blog is using if it is using an alternate template. If a blog is using the default blog.liquid template, the value returned is "null".
- ///
- [JsonProperty("template_suffix")]
- public string TemplateSuffix { get; set; }
+ ///
+ /// States the name of the template a blog is using if it is using an alternate template. If a blog is using the default blog.liquid template, the value returned is "null".
+ ///
+ [JsonProperty("template_suffix")]
+ public string TemplateSuffix { get; set; }
- ///
- /// The title of the blog.
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// The title of the blog.
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// The date and time when changes were last made to the blog's properties. Note that this is not updated when creating, modifying or deleting articles in the blog.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
- }
-}
+ ///
+ /// The date and time when changes were last made to the blog's properties. Note that this is not updated when creating, modifying or deleting articles in the blog.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CancellationRequest.cs b/ShopifySharp/Entities/CancellationRequest.cs
index 32f7f714..40344215 100644
--- a/ShopifySharp/Entities/CancellationRequest.cs
+++ b/ShopifySharp/Entities/CancellationRequest.cs
@@ -1,17 +1,16 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify fulfillment cancellation request.
+///
+public class CancellationRequest
{
///
- /// An object representing a Shopify fulfillment cancellation request.
+ /// An optional reason for the cancellation request.
///
- public class CancellationRequest
- {
- ///
- /// An optional reason for the cancellation request.
- ///
- [JsonProperty("message")]
- public string Message { get; set; }
+ [JsonProperty("message")]
+ public string Message { get; set; }
- }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Carrier.cs b/ShopifySharp/Entities/Carrier.cs
index dd3f1b07..4a0c2363 100644
--- a/ShopifySharp/Entities/Carrier.cs
+++ b/ShopifySharp/Entities/Carrier.cs
@@ -1,49 +1,48 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify CarrierService.
+///
+public class Carrier : ShopifyObject
{
///
- /// An object representing a Shopify CarrierService.
+ /// States whether or not this carrier service is active. Valid values are "true" and "false".
///
- public class Carrier : ShopifyObject
- {
- ///
- /// States whether or not this carrier service is active. Valid values are "true" and "false".
- ///
- [JsonProperty("active")]
- public bool? Active { get; set; }
-
- ///
- /// States the URL endpoint that shopify needs to retrieve shipping rates. This must be a public URL.
- ///
- [JsonProperty("callback_url")]
- public string CallbackUrl { get; set; }
-
- ///
- /// Distinguishes between api or legacy carrier services.
- ///
- [JsonProperty("carrier_service_type")]
- public string CarrierServiceType { get; set; }
-
- ///
- /// The name of the shipping service as seen by merchants and their customers.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
-
- ///
- /// States if merchants are able to send dummy data to your service through the Shopify admin
- /// to see shipping rate examples. Valid values are "true" and "false".
- ///
- [JsonProperty("service_discovery")]
- public bool? ServiceDiscovery { get; set; }
-
- ///
- /// The format of the data returned by the URL endpoint. Valid values are "json" and "xml".
- /// If a format is not specified, it will default to json.
- ///
- [JsonProperty("format")]
- public string Format { get; set; }
-
- }
+ [JsonProperty("active")]
+ public bool? Active { get; set; }
+
+ ///
+ /// States the URL endpoint that shopify needs to retrieve shipping rates. This must be a public URL.
+ ///
+ [JsonProperty("callback_url")]
+ public string CallbackUrl { get; set; }
+
+ ///
+ /// Distinguishes between api or legacy carrier services.
+ ///
+ [JsonProperty("carrier_service_type")]
+ public string CarrierServiceType { get; set; }
+
+ ///
+ /// The name of the shipping service as seen by merchants and their customers.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// States if merchants are able to send dummy data to your service through the Shopify admin
+ /// to see shipping rate examples. Valid values are "true" and "false".
+ ///
+ [JsonProperty("service_discovery")]
+ public bool? ServiceDiscovery { get; set; }
+
+ ///
+ /// The format of the data returned by the URL endpoint. Valid values are "json" and "xml".
+ /// If a format is not specified, it will default to json.
+ ///
+ [JsonProperty("format")]
+ public string Format { get; set; }
+
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CarrierShippingRateProvider.cs b/ShopifySharp/Entities/CarrierShippingRateProvider.cs
index 70d272d6..3f597552 100644
--- a/ShopifySharp/Entities/CarrierShippingRateProvider.cs
+++ b/ShopifySharp/Entities/CarrierShippingRateProvider.cs
@@ -1,32 +1,30 @@
using Newtonsoft.Json;
-namespace ShopifySharp
-{
- public class CarrierShippingRateProvider : ShopifyObject
- {
- ///
- /// A Carrier Service (also known as a Carrier Calculated Service or Shipping Service) provides real-time shipping rates to Shopify. Some common carrier services include: Canada Post, FedEx, UPS, and USPS. Note that the term "carrier" is often used interchangeably with the terms "shipping company" and "rate provider."
- ///
- [JsonProperty("carrier_service_id")]
- public long? CarrierServiceId { get; set; }
+namespace ShopifySharp;
- ///
- /// Rate adjustments - Flat fee
- ///
- [JsonProperty("flat_modifier")]
- public decimal? FlatModifier { get; set; }
+public class CarrierShippingRateProvider : ShopifyObject
+{
+ ///
+ /// A Carrier Service (also known as a Carrier Calculated Service or Shipping Service) provides real-time shipping rates to Shopify. Some common carrier services include: Canada Post, FedEx, UPS, and USPS. Note that the term "carrier" is often used interchangeably with the terms "shipping company" and "rate provider."
+ ///
+ [JsonProperty("carrier_service_id")]
+ public long? CarrierServiceId { get; set; }
- ///
- /// Rate adjustments - percentage
- ///
- [JsonProperty("percent_modifier")]
- public int? PercentModifier { get; set; }
+ ///
+ /// Rate adjustments - Flat fee
+ ///
+ [JsonProperty("flat_modifier")]
+ public decimal? FlatModifier { get; set; }
- ///
- /// Shipping zone id
- ///
- [JsonProperty("shipping_zone_id")]
- public long? ShippingZoneId { get; set; }
- }
+ ///
+ /// Rate adjustments - percentage
+ ///
+ [JsonProperty("percent_modifier")]
+ public int? PercentModifier { get; set; }
+ ///
+ /// Shipping zone id
+ ///
+ [JsonProperty("shipping_zone_id")]
+ public long? ShippingZoneId { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Charge.cs b/ShopifySharp/Entities/Charge.cs
index ba31a216..84859308 100644
--- a/ShopifySharp/Entities/Charge.cs
+++ b/ShopifySharp/Entities/Charge.cs
@@ -2,67 +2,66 @@
using Newtonsoft.Json;
using ShopifySharp.Converters;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing an application charge.
+///
+public class Charge : ShopifyObject
{
///
- /// An object representing an application charge.
+ /// The URL that the customer should be sent to, to accept or decline the application charge.
///
- public class Charge : ShopifyObject
- {
- ///
- /// The URL that the customer should be sent to, to accept or decline the application charge.
- ///
- [JsonProperty("confirmation_url")]
- public string ConfirmationUrl { get; set; }
+ [JsonProperty("confirmation_url")]
+ public string ConfirmationUrl { get; set; }
- ///
- /// The date and time when the application charge was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time when the application charge was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// The name of the application charge.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
+ ///
+ /// The name of the application charge.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
- ///
- /// The price of the application charge.
- ///
- /// Shopify returns this as a string, but JSON.net should be able to convert it to a decimal.
- [JsonProperty("price")]
- public decimal? Price { get; set; }
+ ///
+ /// The price of the application charge.
+ ///
+ /// Shopify returns this as a string, but JSON.net should be able to convert it to a decimal.
+ [JsonProperty("price")]
+ public decimal? Price { get; set; }
- ///
- /// The URL the customer is sent to once they accept/decline a charge.
- ///
- [JsonProperty("return_url")]
- public string ReturnUrl { get; set; }
+ ///
+ /// The URL the customer is sent to once they accept/decline a charge.
+ ///
+ [JsonProperty("return_url")]
+ public string ReturnUrl { get; set; }
- ///
- /// The status of the charged. Known values are 'pending', 'accepted', 'active', 'cancelled', 'declined' and 'expired'.
- ///
- [JsonProperty("status")]
- public string Status { get; set; }
+ ///
+ /// The status of the charged. Known values are 'pending', 'accepted', 'active', 'cancelled', 'declined' and 'expired'.
+ ///
+ [JsonProperty("status")]
+ public string Status { get; set; }
- ///
- /// States whether or not the application charge is a test transaction.
- ///
- /// Valid values are 'true' or null. Needs a special converter to convert null to false and vice-versa.
- [JsonProperty("test", NullValueHandling = NullValueHandling.Include), JsonConverter(typeof(FalseToNullConverter))]
- public bool? Test { get; set; }
+ ///
+ /// States whether or not the application charge is a test transaction.
+ ///
+ /// Valid values are 'true' or null. Needs a special converter to convert null to false and vice-versa.
+ [JsonProperty("test", NullValueHandling = NullValueHandling.Include), JsonConverter(typeof(FalseToNullConverter))]
+ public bool? Test { get; set; }
- ///
- /// The date and time when the recurring application charge was last updated.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ ///
+ /// The date and time when the recurring application charge was last updated.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- ///
- /// The currency of the price of the application charge.
- ///
- [JsonProperty("currency")]
- public string Currency { get; set; }
- }
+ ///
+ /// The currency of the price of the application charge.
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Checkout.cs b/ShopifySharp/Entities/Checkout.cs
index b8247f89..4430f53f 100644
--- a/ShopifySharp/Entities/Checkout.cs
+++ b/ShopifySharp/Entities/Checkout.cs
@@ -1,230 +1,229 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An entity representing a Shopify product.
+///
+public class Checkout : ShopifyObject
{
///
- /// An entity representing a Shopify product.
- ///
- public class Checkout : ShopifyObject
- {
- ///
- /// The full recovery URL to be sent to a customer to recover their abandoned checkout.
- ///
- [JsonProperty("abandoned_checkout_url")]
- public string AbandonedCheckoutUrl { get; set; }
-
- ///
- /// The mailing address associated with the payment method.
- ///
- [JsonProperty("billing_address")]
- public Address BillingAddress { get; set; }
-
- ///
- /// Indicates whether or not the person who placed the order would like to receive email
- /// updates from the shop. This is set when checking the "I want to receive occasional
- /// emails about new products, promotions and other news" checkbox during checkout.
- ///
- [JsonProperty("buyer_accepts_marketing")]
- public bool? BuyerAcceptsMarketing { get; set; }
-
- ///
- /// Unique identifier for a particular cart that is attached to a particular order.
- ///
- [JsonProperty("cart_token")]
- public string CartToken { get; set; }
-
- ///
- /// The date and time when the abandoned cart was completed. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("closed_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public DateTimeOffset? ClosedAt { get; set; }
-
- ///
- /// The date and time when the abandoned cart was last modified. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("completed_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public DateTimeOffset? CompletedAt { get; set; }
-
- ///
- /// The date and time when the abandoned cart was created. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("created_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public DateTimeOffset? CreatedAt { get; set; }
-
- ///
- /// The three letter code (ISO 4217) for the currency used for the payment.
- ///
- [JsonProperty("currency")]
- public string Currency { get; set; }
-
- ///
- /// Information about the customer.
- ///
- [JsonProperty("customer")]
- public Customer Customer { get; set; }
-
- ///
- /// The two or three-letter language code, optionally followed by a region modifier. Example values: en, en-CA.
- ///
- [JsonProperty("customer_locale")]
- public string CustomerLocale { get; set; }
-
- ///
- /// The ID of the Shopify POS device that created the checkout.
- ///
- [JsonProperty("device_id")]
- public long? DeviceId { get; set; }
-
- ///
- /// Applicable discount codes that can be applied to the order. If no codes exist the value will default to blank.
- ///
- [JsonProperty("discount_codes")]
- public IEnumerable DiscountCodes { get; set; }
-
- ///
- /// The customer's email address.
- ///
- [JsonProperty("email")]
- public string Email { get; set; }
-
- ///
- /// The payment gateway used.
- ///
- [JsonProperty("gateway")]
- public string Gateway { get; set; }
-
- ///
- /// The URL for the page where the buyer landed when entering the shop.
- ///
- [JsonProperty("landing_site")]
- public string LandingSite { get; set; }
-
- ///
- /// A list of line item objects, each one containing information about an item in the order.
- ///
- [JsonProperty("line_items")]
- public IEnumerable LineItems { get; set; }
-
- ///
- /// The ID of the physical location where the checkout was processed.
- ///
- [JsonProperty("location_id")]
- public long? LocationId { get; set; }
-
- ///
- /// The text of an optional note that a shop owner can attach to the order.
- ///
- [JsonProperty("note")]
- public string Note { get; set; }
-
- ///
- /// The customer's phone number for receiving SMS notifications.
- ///
- [JsonProperty("phone")]
- public string Phone { get; set; }
-
- ///
- /// The three-letter code (ISO 4217 format) of the currency that the customer used at checkout.
- ///
- [JsonProperty("presentment_currency")]
- public string PresentmentCurrency { get; set; }
-
- ///
- /// The website that the customer clicked on to come to the shop.
- ///
- [JsonProperty("referring_site")]
- public string ReferringSite { get; set; }
-
- ///
- /// The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require one.
- ///
- [JsonProperty("shipping_address")]
- public Address ShippingAddress { get; set; }
-
- ///
- /// An array of shipping line objects, each of which details the shipping methods used.
- ///
- [JsonProperty("shipping_lines")]
- public IEnumerable ShippingLines { get; set; }
-
- ///
- /// Where the checkout originated. Known values are: "web", "pos", "iphone", and "android"
- ///
- [JsonProperty("source_name")]
- public string SourceName { get; set; }
-
- ///
- /// Price of the order before shipping and taxes
- ///
- [JsonProperty("subtotal_price")]
- public decimal? SubtotalPrice { get; set; }
-
- ///
- /// An array of tax line objects, each of which details the taxes applicable to the order.
- ///
- [JsonProperty("tax_lines")]
- public IEnumerable TaxLines { get; set; }
-
- ///
- /// Whether taxes are included in the price.
- ///
- [JsonProperty("taxes_included")]
- public bool? TaxesIncluded { get; set; }
-
- ///
- /// Unique identifier for a particular order.
- ///
- [JsonProperty("token")]
- public string Token { get; set; }
-
- ///
- /// The total amount of the discounts to be applied to the price of the order.
- ///
- [JsonProperty("total_discounts")]
- public decimal? TotalDiscounts { get; set; }
+ /// The full recovery URL to be sent to a customer to recover their abandoned checkout.
+ ///
+ [JsonProperty("abandoned_checkout_url")]
+ public string AbandonedCheckoutUrl { get; set; }
+
+ ///
+ /// The mailing address associated with the payment method.
+ ///
+ [JsonProperty("billing_address")]
+ public Address BillingAddress { get; set; }
+
+ ///
+ /// Indicates whether or not the person who placed the order would like to receive email
+ /// updates from the shop. This is set when checking the "I want to receive occasional
+ /// emails about new products, promotions and other news" checkbox during checkout.
+ ///
+ [JsonProperty("buyer_accepts_marketing")]
+ public bool? BuyerAcceptsMarketing { get; set; }
+
+ ///
+ /// Unique identifier for a particular cart that is attached to a particular order.
+ ///
+ [JsonProperty("cart_token")]
+ public string CartToken { get; set; }
+
+ ///
+ /// The date and time when the abandoned cart was completed. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("closed_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public DateTimeOffset? ClosedAt { get; set; }
+
+ ///
+ /// The date and time when the abandoned cart was last modified. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("completed_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public DateTimeOffset? CompletedAt { get; set; }
+
+ ///
+ /// The date and time when the abandoned cart was created. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("created_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ ///
+ /// The three letter code (ISO 4217) for the currency used for the payment.
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
+
+ ///
+ /// Information about the customer.
+ ///
+ [JsonProperty("customer")]
+ public Customer Customer { get; set; }
+
+ ///
+ /// The two or three-letter language code, optionally followed by a region modifier. Example values: en, en-CA.
+ ///
+ [JsonProperty("customer_locale")]
+ public string CustomerLocale { get; set; }
+
+ ///
+ /// The ID of the Shopify POS device that created the checkout.
+ ///
+ [JsonProperty("device_id")]
+ public long? DeviceId { get; set; }
+
+ ///
+ /// Applicable discount codes that can be applied to the order. If no codes exist the value will default to blank.
+ ///
+ [JsonProperty("discount_codes")]
+ public IEnumerable DiscountCodes { get; set; }
+
+ ///
+ /// The customer's email address.
+ ///
+ [JsonProperty("email")]
+ public string Email { get; set; }
+
+ ///
+ /// The payment gateway used.
+ ///
+ [JsonProperty("gateway")]
+ public string Gateway { get; set; }
+
+ ///
+ /// The URL for the page where the buyer landed when entering the shop.
+ ///
+ [JsonProperty("landing_site")]
+ public string LandingSite { get; set; }
+
+ ///
+ /// A list of line item objects, each one containing information about an item in the order.
+ ///
+ [JsonProperty("line_items")]
+ public IEnumerable LineItems { get; set; }
+
+ ///
+ /// The ID of the physical location where the checkout was processed.
+ ///
+ [JsonProperty("location_id")]
+ public long? LocationId { get; set; }
+
+ ///
+ /// The text of an optional note that a shop owner can attach to the order.
+ ///
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ ///
+ /// The customer's phone number for receiving SMS notifications.
+ ///
+ [JsonProperty("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// The three-letter code (ISO 4217 format) of the currency that the customer used at checkout.
+ ///
+ [JsonProperty("presentment_currency")]
+ public string PresentmentCurrency { get; set; }
+
+ ///
+ /// The website that the customer clicked on to come to the shop.
+ ///
+ [JsonProperty("referring_site")]
+ public string ReferringSite { get; set; }
+
+ ///
+ /// The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require one.
+ ///
+ [JsonProperty("shipping_address")]
+ public Address ShippingAddress { get; set; }
+
+ ///
+ /// An array of shipping line objects, each of which details the shipping methods used.
+ ///
+ [JsonProperty("shipping_lines")]
+ public IEnumerable ShippingLines { get; set; }
+
+ ///
+ /// Where the checkout originated. Known values are: "web", "pos", "iphone", and "android"
+ ///
+ [JsonProperty("source_name")]
+ public string SourceName { get; set; }
+
+ ///
+ /// Price of the order before shipping and taxes
+ ///
+ [JsonProperty("subtotal_price")]
+ public decimal? SubtotalPrice { get; set; }
+
+ ///
+ /// An array of tax line objects, each of which details the taxes applicable to the order.
+ ///
+ [JsonProperty("tax_lines")]
+ public IEnumerable TaxLines { get; set; }
+
+ ///
+ /// Whether taxes are included in the price.
+ ///
+ [JsonProperty("taxes_included")]
+ public bool? TaxesIncluded { get; set; }
+
+ ///
+ /// Unique identifier for a particular order.
+ ///
+ [JsonProperty("token")]
+ public string Token { get; set; }
+
+ ///
+ /// The total amount of the discounts to be applied to the price of the order.
+ ///
+ [JsonProperty("total_discounts")]
+ public decimal? TotalDiscounts { get; set; }
- ///
- /// The total duties of the checkout in presentment currency.
- ///
- [JsonProperty("total_duties")]
- public decimal? TotalDuties { get; set; }
+ ///
+ /// The total duties of the checkout in presentment currency.
+ ///
+ [JsonProperty("total_duties")]
+ public decimal? TotalDuties { get; set; }
- ///
- /// The sum of all the prices of all the items in the order.
- ///
- [JsonProperty("total_line_items_price")]
- public decimal? TotalLineItemsPrice { get; set; }
-
- ///
- /// The sum of all the prices of all the items in the order, taxes and discounts included.
- ///
- [JsonProperty("total_price")]
- public decimal? TotalPrice { get; set; }
-
- ///
- /// The sum of all the taxes applied to the line items in the order.
- ///
- [JsonProperty("total_tax")]
- public decimal? TotalTax { get; set; }
-
- ///
- /// The sum of all the weights of the line items in the order, in grams.
- ///
- [JsonProperty("total_weight")]
- public decimal? TotalWeight { get; set; }
-
- ///
- /// The date and time when the abandoned cart was last modified. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("updated_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public DateTimeOffset? UpdatedAt { get; set; }
-
- ///
- /// The ID of the user who created the checkout.
- ///
- [JsonProperty("user_id")]
- public long? UserId { get; set; }
- }
-}
+ ///
+ /// The sum of all the prices of all the items in the order.
+ ///
+ [JsonProperty("total_line_items_price")]
+ public decimal? TotalLineItemsPrice { get; set; }
+
+ ///
+ /// The sum of all the prices of all the items in the order, taxes and discounts included.
+ ///
+ [JsonProperty("total_price")]
+ public decimal? TotalPrice { get; set; }
+
+ ///
+ /// The sum of all the taxes applied to the line items in the order.
+ ///
+ [JsonProperty("total_tax")]
+ public decimal? TotalTax { get; set; }
+
+ ///
+ /// The sum of all the weights of the line items in the order, in grams.
+ ///
+ [JsonProperty("total_weight")]
+ public decimal? TotalWeight { get; set; }
+
+ ///
+ /// The date and time when the abandoned cart was last modified. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("updated_at", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public DateTimeOffset? UpdatedAt { get; set; }
+
+ ///
+ /// The ID of the user who created the checkout.
+ ///
+ [JsonProperty("user_id")]
+ public long? UserId { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CheckoutLineItem.cs b/ShopifySharp/Entities/CheckoutLineItem.cs
index e384d454..bf5d176a 100644
--- a/ShopifySharp/Entities/CheckoutLineItem.cs
+++ b/ShopifySharp/Entities/CheckoutLineItem.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using System.Collections.Generic;
using ShopifySharp.Converters;
diff --git a/ShopifySharp/Entities/CheckoutShippingRate.cs b/ShopifySharp/Entities/CheckoutShippingRate.cs
index 780519d3..c4429004 100755
--- a/ShopifySharp/Entities/CheckoutShippingRate.cs
+++ b/ShopifySharp/Entities/CheckoutShippingRate.cs
@@ -1,36 +1,35 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CheckoutShippingRate
{
- public class CheckoutShippingRate
+ public CheckoutShippingRate()
{
- public CheckoutShippingRate()
- {
- }
+ }
- [JsonProperty("id")]
- public string Id { get; set; }
+ [JsonProperty("id")]
+ public string Id { get; set; }
- [JsonProperty("handle")]
- public string Handle { get; set; }
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
- [JsonProperty("price")]
- public string Price { get; set; }
+ [JsonProperty("price")]
+ public string Price { get; set; }
- [JsonProperty("title")]
- public string Title { get; set; }
+ [JsonProperty("title")]
+ public string Title { get; set; }
- [JsonProperty("phoneRequired")]
- public bool PhoneRequired { get; set; }
+ [JsonProperty("phoneRequired")]
+ public bool PhoneRequired { get; set; }
- ///
- /// As of 2019-01-21, the type of this property is unknown. In Shopify's documentation, it only appears as a null value.
- ///
- [JsonProperty("deliveryRange")]
- public object DeliveryRange { get; set; }
+ ///
+ /// As of 2019-01-21, the type of this property is unknown. In Shopify's documentation, it only appears as a null value.
+ ///
+ [JsonProperty("deliveryRange")]
+ public object DeliveryRange { get; set; }
- [JsonProperty("checkout")]
- public CheckoutShippingRatePrices Checkout { get; set; }
- }
+ [JsonProperty("checkout")]
+ public CheckoutShippingRatePrices Checkout { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CheckoutShippingRatePrices.cs b/ShopifySharp/Entities/CheckoutShippingRatePrices.cs
index e9eb0a20..25cf7f0d 100755
--- a/ShopifySharp/Entities/CheckoutShippingRatePrices.cs
+++ b/ShopifySharp/Entities/CheckoutShippingRatePrices.cs
@@ -1,16 +1,15 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CheckoutShippingRatePrices
{
- public class CheckoutShippingRatePrices
- {
- [JsonProperty("totalTax")]
- public string TotalTax { get; set; }
+ [JsonProperty("totalTax")]
+ public string TotalTax { get; set; }
- [JsonProperty("totalPrice")]
- public string TotalPrice { get; set; }
+ [JsonProperty("totalPrice")]
+ public string TotalPrice { get; set; }
- [JsonProperty("subtotalPrice")]
- public string SubtotalPrice { get; set; }
- }
+ [JsonProperty("subtotalPrice")]
+ public string SubtotalPrice { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/ClientDetails.cs b/ShopifySharp/Entities/ClientDetails.cs
index fe774e4a..bec4a13e 100644
--- a/ShopifySharp/Entities/ClientDetails.cs
+++ b/ShopifySharp/Entities/ClientDetails.cs
@@ -1,43 +1,42 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class ClientDetails
{
- public class ClientDetails
- {
- ///
- /// Shopify does not offer documentation for this field.
- ///
- [JsonProperty("accept_language")]
- public string AcceptLanguage { get; set; }
+ ///
+ /// Shopify does not offer documentation for this field.
+ ///
+ [JsonProperty("accept_language")]
+ public string AcceptLanguage { get; set; }
- ///
- /// The browser screen height in pixels, if available.
- ///
- [JsonProperty("browser_height")]
- public int? BrowserHeight { get; set; }
+ ///
+ /// The browser screen height in pixels, if available.
+ ///
+ [JsonProperty("browser_height")]
+ public int? BrowserHeight { get; set; }
- ///
- /// The browser IP address.
- ///
- [JsonProperty("browser_ip")]
- public string BrowserIp { get; set; }
+ ///
+ /// The browser IP address.
+ ///
+ [JsonProperty("browser_ip")]
+ public string BrowserIp { get; set; }
- ///
- /// The browser screen width in pixels, if available.
- ///
- [JsonProperty("browser_width")]
- public int? BrowserWidth { get; set; }
+ ///
+ /// The browser screen width in pixels, if available.
+ ///
+ [JsonProperty("browser_width")]
+ public int? BrowserWidth { get; set; }
- ///
- /// A hash of the session.
- ///
- [JsonProperty("session_hash")]
- public string SessionHash { get; set; }
+ ///
+ /// A hash of the session.
+ ///
+ [JsonProperty("session_hash")]
+ public string SessionHash { get; set; }
- ///
- /// The browser's user agent string.
- ///
- [JsonProperty("user_agent")]
- public string UserAgent { get; set; }
- }
-}
+ ///
+ /// The browser's user agent string.
+ ///
+ [JsonProperty("user_agent")]
+ public string UserAgent { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Collect.cs b/ShopifySharp/Entities/Collect.cs
index 5efd3a77..6a7f31fa 100644
--- a/ShopifySharp/Entities/Collect.cs
+++ b/ShopifySharp/Entities/Collect.cs
@@ -1,47 +1,46 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify collect.
+///
+public class Collect : ShopifyObject
{
///
- /// An object representing a Shopify collect.
+ /// The id of the custom collection containing the product.
///
- public class Collect : ShopifyObject
- {
- ///
- /// The id of the custom collection containing the product.
- ///
- [JsonProperty("collection_id")]
- public long? CollectionId { get; set; }
+ [JsonProperty("collection_id")]
+ public long? CollectionId { get; set; }
- ///
- /// The unique numeric identifier for the product in the custom collection.
- ///
- [JsonProperty("product_id")]
- public long? ProductId { get; set; }
+ ///
+ /// The unique numeric identifier for the product in the custom collection.
+ ///
+ [JsonProperty("product_id")]
+ public long? ProductId { get; set; }
- ///
- /// The date and time when the collect was created. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The date and time when the collect was created. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// The date and time when the collect was last updated. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ ///
+ /// The date and time when the collect was last updated. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- ///
- /// A number specifying the manually sorted position of this product in a custom collection. The first position is 1. This value only applies when the custom collection is viewed using the Manual sort order.
- ///
- [JsonProperty("position")]
- public int? Position { get; set; }
+ ///
+ /// A number specifying the manually sorted position of this product in a custom collection. The first position is 1. This value only applies when the custom collection is viewed using the Manual sort order.
+ ///
+ [JsonProperty("position")]
+ public int? Position { get; set; }
- ///
- /// This is the same value as position but padded with leading zeroes to make it alphanumeric-sortable.
- ///
- [JsonProperty("sort_value")]
- public string SortValue { get; set; }
- }
-}
+ ///
+ /// This is the same value as position but padded with leading zeroes to make it alphanumeric-sortable.
+ ///
+ [JsonProperty("sort_value")]
+ public string SortValue { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Collection.cs b/ShopifySharp/Entities/Collection.cs
index b254f303..bc00797c 100644
--- a/ShopifySharp/Entities/Collection.cs
+++ b/ShopifySharp/Entities/Collection.cs
@@ -1,64 +1,63 @@
using System;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class Collection : ShopifyObject
{
- public class Collection : ShopifyObject
- {
- ///
- /// A description of the collection, complete with HTML markup. Many templates display this on their collection pages.
- ///
- [JsonProperty("body_html")]
- public string BodyHtml { get; set; }
-
- ///
- /// A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. (limit: 255 characters)
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
-
- ///
- /// Image associated with the collection.
- ///
- [JsonProperty("image")]
- public CollectionImage Image { get; set; }
-
- ///
- /// The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection.
- ///
- [JsonProperty("published_at")]
- public DateTimeOffset? PublishedAt { get; set; }
-
- ///
- /// Whether the collection is published to the Point of Sale channel. Valid values: `web`, `global`
- ///
- [JsonProperty("published_scope")]
- public string PublishedScope { get; set; }
-
- ///
- /// The order in which products in the collection appear. Valid values: `alpha-asc`, `alpha-desc`, `best-selling`,
- /// `created`, `created-desc`, `manual`, `price-asc`, `price-desc`
- ///
- [JsonProperty("sort_order")]
- public string SortOrder { get; set; }
-
- ///
- /// The suffix of the liquid template being used. For example, if the value is custom, then the collection is
- /// using the collection.custom.liquid template. If the value is null, then the collection is using the default collection.liquid.
- ///
- [JsonProperty("template_suffix")]
- public string TemplateSuffix { get; set; }
-
- ///
- /// The name of the collection. (limit: 255 characters)
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
-
- ///
- /// The date and time (ISO 8601 format) when the collection was last modified.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
- }
+ ///
+ /// A description of the collection, complete with HTML markup. Many templates display this on their collection pages.
+ ///
+ [JsonProperty("body_html")]
+ public string BodyHtml { get; set; }
+
+ ///
+ /// A unique, human-readable string for the collection automatically generated from its title. This is used in themes by the Liquid templating language to refer to the collection. (limit: 255 characters)
+ ///
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
+
+ ///
+ /// Image associated with the collection.
+ ///
+ [JsonProperty("image")]
+ public CollectionImage Image { get; set; }
+
+ ///
+ /// The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden collection.
+ ///
+ [JsonProperty("published_at")]
+ public DateTimeOffset? PublishedAt { get; set; }
+
+ ///
+ /// Whether the collection is published to the Point of Sale channel. Valid values: `web`, `global`
+ ///
+ [JsonProperty("published_scope")]
+ public string PublishedScope { get; set; }
+
+ ///
+ /// The order in which products in the collection appear. Valid values: `alpha-asc`, `alpha-desc`, `best-selling`,
+ /// `created`, `created-desc`, `manual`, `price-asc`, `price-desc`
+ ///
+ [JsonProperty("sort_order")]
+ public string SortOrder { get; set; }
+
+ ///
+ /// The suffix of the liquid template being used. For example, if the value is custom, then the collection is
+ /// using the collection.custom.liquid template. If the value is null, then the collection is using the default collection.liquid.
+ ///
+ [JsonProperty("template_suffix")]
+ public string TemplateSuffix { get; set; }
+
+ ///
+ /// The name of the collection. (limit: 255 characters)
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
+
+ ///
+ /// The date and time (ISO 8601 format) when the collection was last modified.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CollectionImage.cs b/ShopifySharp/Entities/CollectionImage.cs
index a6b3dbd2..8fb619da 100644
--- a/ShopifySharp/Entities/CollectionImage.cs
+++ b/ShopifySharp/Entities/CollectionImage.cs
@@ -1,44 +1,43 @@
using System;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CollectionImage
{
- public class CollectionImage
- {
- ///
- /// An image attached to a collection returned as Base64-encoded binary data.
- ///
- [JsonProperty("attachment")]
- public string Attachment { get; set; }
+ ///
+ /// An image attached to a collection returned as Base64-encoded binary data.
+ ///
+ [JsonProperty("attachment")]
+ public string Attachment { get; set; }
- ///
- /// The source URL that specifies the location of the image.
- ///
- [JsonProperty("src")]
- public string Src { get; set; }
+ ///
+ /// The source URL that specifies the location of the image.
+ ///
+ [JsonProperty("src")]
+ public string Src { get; set; }
- ///
- /// The alternative text that describes the collection image.
- ///
- [JsonProperty("alt")]
- public string Alt { get; set; }
+ ///
+ /// The alternative text that describes the collection image.
+ ///
+ [JsonProperty("alt")]
+ public string Alt { get; set; }
- ///
- /// The time and date (ISO 8601 format) when the image was added to the collection.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
+ ///
+ /// The time and date (ISO 8601 format) when the image was added to the collection.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- ///
- /// The width of the image in pixels.
- ///
- [JsonProperty("width")]
- public int Width { get; set; }
+ ///
+ /// The width of the image in pixels.
+ ///
+ [JsonProperty("width")]
+ public int Width { get; set; }
- ///
- /// The height of the image in pixels.
- ///
- [JsonProperty("height")]
- public int Height { get; set; }
- }
+ ///
+ /// The height of the image in pixels.
+ ///
+ [JsonProperty("height")]
+ public int Height { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CollectionListing.cs b/ShopifySharp/Entities/CollectionListing.cs
index f2f93394..085a85aa 100644
--- a/ShopifySharp/Entities/CollectionListing.cs
+++ b/ShopifySharp/Entities/CollectionListing.cs
@@ -1,42 +1,41 @@
-using System;
+using System;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// A CollectionListing resource represents a product collection
+/// that a merchant has made available to your sales channel.
+/// Merchants can make collections available to your sales channel directly from their Shopify admin.
+/// You can use this resource to retrieve collections that a merchant has published and display them in your marketplace.
+/// You can also retrieve a list of published product IDs that belong to a published collection.
+///
+public class CollectionListing
{
- ///
- /// A CollectionListing resource represents a product collection
- /// that a merchant has made available to your sales channel.
- /// Merchants can make collections available to your sales channel directly from their Shopify admin.
- /// You can use this resource to retrieve collections that a merchant has published and display them in your marketplace.
- /// You can also retrieve a list of published product IDs that belong to a published collection.
- ///
- public class CollectionListing
- {
- [JsonProperty("collection_id")]
- public long? CollectionId { get; set; }
-
- [JsonProperty("body_html")]
- public string BodyHtml { get; set; }
-
- [JsonProperty("default_product_image")]
- public ProductImage DefaultProductImage { get; set; }
-
- [JsonProperty("image")]
- public CollectionImage[] Image { get; set; }
-
- [JsonProperty("handle")]
- public string Handle { get; set; }
-
- [JsonProperty("published_at")]
- public DateTimeOffset? PublishedAt { get; set; }
-
- [JsonProperty("title")]
- public string Title { get; set; }
-
- [JsonProperty("sort_order")]
- public string SortOrder { get; set; }
-
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
- }
-}
+ [JsonProperty("collection_id")]
+ public long? CollectionId { get; set; }
+
+ [JsonProperty("body_html")]
+ public string BodyHtml { get; set; }
+
+ [JsonProperty("default_product_image")]
+ public ProductImage DefaultProductImage { get; set; }
+
+ [JsonProperty("image")]
+ public CollectionImage[] Image { get; set; }
+
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
+
+ [JsonProperty("published_at")]
+ public DateTimeOffset? PublishedAt { get; set; }
+
+ [JsonProperty("title")]
+ public string Title { get; set; }
+
+ [JsonProperty("sort_order")]
+ public string SortOrder { get; set; }
+
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Country.cs b/ShopifySharp/Entities/Country.cs
index 063bebe0..ab96251b 100644
--- a/ShopifySharp/Entities/Country.cs
+++ b/ShopifySharp/Entities/Country.cs
@@ -1,39 +1,38 @@
using System.Collections.Generic;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class Country : ShopifyObject
{
- public class Country : ShopifyObject
- {
- ///
- /// The full name of the country, in English.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
+ ///
+ /// The full name of the country, in English.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
- ///
- /// The tax value in decimal format.
- ///
- ///
- [JsonProperty("tax")]
- public decimal? Tax { get; set; }
+ ///
+ /// The tax value in decimal format.
+ ///
+ ///
+ [JsonProperty("tax")]
+ public decimal? Tax { get; set; }
- ///
- /// The ISO 3166-1 alpha-2 two-letter country code for the country. The code for a given country will be the same as the code for the same country in another shop.
- ///
- [JsonProperty("code")]
- public string Code { get; set; }
+ ///
+ /// The ISO 3166-1 alpha-2 two-letter country code for the country. The code for a given country will be the same as the code for the same country in another shop.
+ ///
+ [JsonProperty("code")]
+ public string Code { get; set; }
- ///
- /// The name of the tax as it is referred to in the applicable province/state. For example, in Ontario, Canada the tax is referred to as HST.
- ///
- [JsonProperty("tax_name")]
- public string TaxName { get; set; }
+ ///
+ /// The name of the tax as it is referred to in the applicable province/state. For example, in Ontario, Canada the tax is referred to as HST.
+ ///
+ [JsonProperty("tax_name")]
+ public string TaxName { get; set; }
- ///
- /// The sub-regions of a country. The term provinces also encompasses states.
- ///
- [JsonProperty("provinces")]
- public IEnumerable Provinces { get; set; }
- }
+ ///
+ /// The sub-regions of a country. The term provinces also encompasses states.
+ ///
+ [JsonProperty("provinces")]
+ public IEnumerable Provinces { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CurrencyExchangeAdjustment.cs b/ShopifySharp/Entities/CurrencyExchangeAdjustment.cs
index 74872040..949ec711 100644
--- a/ShopifySharp/Entities/CurrencyExchangeAdjustment.cs
+++ b/ShopifySharp/Entities/CurrencyExchangeAdjustment.cs
@@ -1,31 +1,30 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CurrencyExchangeAdjustment : ShopifyObject
{
- public class CurrencyExchangeAdjustment : ShopifyObject
- {
- ///
- /// The difference between the amounts on the associated transaction and the parent transaction.
- ///
- [JsonProperty("adjustment")]
- public decimal? Adjustment { get; set; }
+ ///
+ /// The difference between the amounts on the associated transaction and the parent transaction.
+ ///
+ [JsonProperty("adjustment")]
+ public decimal? Adjustment { get; set; }
- ///
- /// The amount of the parent transaction in the shop currency.
- ///
- [JsonProperty("original_amount")]
- public decimal? OriginalAmount { get; set; }
+ ///
+ /// The amount of the parent transaction in the shop currency.
+ ///
+ [JsonProperty("original_amount")]
+ public decimal? OriginalAmount { get; set; }
- ///
- /// The amount of the associated transaction in the shop currency.
- ///
- [JsonProperty("final_amount")]
- public decimal? FinalAmount { get; set; }
+ ///
+ /// The amount of the associated transaction in the shop currency.
+ ///
+ [JsonProperty("final_amount")]
+ public decimal? FinalAmount { get; set; }
- ///
- /// The shop currency.
- ///
- [JsonProperty("currency")]
- public string Currency { get; set; }
- }
+ ///
+ /// The shop currency.
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomCollection.cs b/ShopifySharp/Entities/CustomCollection.cs
index 3558cd3d..30d29539 100644
--- a/ShopifySharp/Entities/CustomCollection.cs
+++ b/ShopifySharp/Entities/CustomCollection.cs
@@ -2,89 +2,88 @@
using System;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An entity representing a Shopify Custom Collection Object.
+///
+public class CustomCollection : ShopifyObject
{
///
- /// An entity representing a Shopify Custom Collection Object.
+ /// The description of the Custom collection, complete with HTML markup. Many templates display this on their Custom collection page.
///
- public class CustomCollection : ShopifyObject
- {
- ///
- /// The description of the Custom collection, complete with HTML markup. Many templates display this on their Custom collection page.
- ///
- [JsonProperty("body_html")]
- public string BodyHtml { get; set; }
+ [JsonProperty("body_html")]
+ public string BodyHtml { get; set; }
- ///
- /// A human-friendly unique string for the Custom collection automatically generated from its title. This is used in shop themes by the Liquid templating language to refer to the Custom collection. Limit of 255 characters.
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
+ ///
+ /// A human-friendly unique string for the Custom collection automatically generated from its title. This is used in shop themes by the Liquid templating language to refer to the Custom collection. Limit of 255 characters.
+ ///
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
- ///
- /// The collection image.
- ///
- [JsonProperty("image")]
- public CustomCollectionImage Image { get; set; }
+ ///
+ /// The collection image.
+ ///
+ [JsonProperty("image")]
+ public CustomCollectionImage Image { get; set; }
- ///
- /// Whether the collection is published or not.
- ///
- [JsonProperty("published")]
- public bool? Published { get; set; }
+ ///
+ /// Whether the collection is published or not.
+ ///
+ [JsonProperty("published")]
+ public bool? Published { get; set; }
- ///
- /// This can have two different types of values, depending on whether the Custom collection has been published (i.e., made visible to customers):
- /// If the Custom collection is published, this value is the date and time when it was published.The API returns this value in ISO 8601 format.
- /// If the Custom collection is hidden (i.e., not published), this value is null. Changing a Custom collection's status from published to hidden changes its published_at property to null.
- ///
- [JsonProperty("published_at")]
- public DateTimeOffset? PublishedAt { get; set; }
+ ///
+ /// This can have two different types of values, depending on whether the Custom collection has been published (i.e., made visible to customers):
+ /// If the Custom collection is published, this value is the date and time when it was published.The API returns this value in ISO 8601 format.
+ /// If the Custom collection is hidden (i.e., not published), this value is null. Changing a Custom collection's status from published to hidden changes its published_at property to null.
+ ///
+ [JsonProperty("published_at")]
+ public DateTimeOffset? PublishedAt { get; set; }
- ///
- /// The sales channels in which the Custom collection is visible.
- ///
- [JsonProperty("published_scope")]
- public string PublishedScope { get; set; }
+ ///
+ /// The sales channels in which the Custom collection is visible.
+ ///
+ [JsonProperty("published_scope")]
+ public string PublishedScope { get; set; }
- ///
- /// The order in which products in the Custom collection appear
- ///
- [JsonProperty("sort_order")]
- public string SortOrder { get; set; }
+ ///
+ /// The order in which products in the Custom collection appear
+ ///
+ [JsonProperty("sort_order")]
+ public string SortOrder { get; set; }
- ///
- /// The suffix of the template you are using. By default, the original template is called product.liquid, without any suffix. Any additional templates will be: product.suffix.liquid.
- ///
- [JsonProperty("template_suffix")]
- public string TemplateSuffix { get; set; }
+ ///
+ /// The suffix of the template you are using. By default, the original template is called product.liquid, without any suffix. Any additional templates will be: product.suffix.liquid.
+ ///
+ [JsonProperty("template_suffix")]
+ public string TemplateSuffix { get; set; }
- ///
- /// The name of the Custom collection. Limit of 255 characters.
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// The name of the Custom collection. Limit of 255 characters.
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// The date and time when the Custom collection was last modified. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+ ///
+ /// The date and time when the Custom collection was last modified. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
- ///
- /// The collection of collects associated to this custom collection
- ///
- [JsonProperty("collects")]
- public IEnumerable Collects { get; set; }
+ ///
+ /// The collection of collects associated to this custom collection
+ ///
+ [JsonProperty("collects")]
+ public IEnumerable Collects { get; set; }
- ///
- /// Additional metadata about the . Note: This is not naturally returned with a response, as
- /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
- /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
- ///
- [JsonProperty("metafields")]
- public IEnumerable Metafields { get; set; }
- }
-}
+ ///
+ /// Additional metadata about the . Note: This is not naturally returned with a response, as
+ /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
+ /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
+ ///
+ [JsonProperty("metafields")]
+ public IEnumerable Metafields { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomCollectionImage.cs b/ShopifySharp/Entities/CustomCollectionImage.cs
index 84a1214d..23c41482 100644
--- a/ShopifySharp/Entities/CustomCollectionImage.cs
+++ b/ShopifySharp/Entities/CustomCollectionImage.cs
@@ -1,47 +1,46 @@
using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Represents the image for a
+///
+public class CustomCollectionImage
{
///
- /// Represents the image for a
+ /// An image attached to a shop's theme returned as Base64-encoded binary data.
///
- public class CustomCollectionImage
- {
- ///
- /// An image attached to a shop's theme returned as Base64-encoded binary data.
- ///
- [JsonProperty("attachment")]
- public string Attachment { get; set; }
+ [JsonProperty("attachment")]
+ public string Attachment { get; set; }
- ///
- /// Source URL that specifies the location of the image.
- ///
- [JsonProperty("src")]
- public string Src { get; set; }
+ ///
+ /// Source URL that specifies the location of the image.
+ ///
+ [JsonProperty("src")]
+ public string Src { get; set; }
- ///
- /// Alternative text that describes the collection image.
- ///
- [JsonProperty("alt")]
- public string Alt { get; set; }
+ ///
+ /// Alternative text that describes the collection image.
+ ///
+ [JsonProperty("alt")]
+ public string Alt { get; set; }
- ///
- /// The date the image was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? Created_At { get; set; }
+ ///
+ /// The date the image was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? Created_At { get; set; }
- ///
- /// Width of the image in pixels.
- ///
- [JsonProperty("width")]
- public int? Width { get; set; }
+ ///
+ /// Width of the image in pixels.
+ ///
+ [JsonProperty("width")]
+ public int? Width { get; set; }
- ///
- /// Height of the image in pixels.
- ///
- [JsonProperty("height")]
- public int? Height { get; set; }
- }
-}
+ ///
+ /// Height of the image in pixels.
+ ///
+ [JsonProperty("height")]
+ public int? Height { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Customer.cs b/ShopifySharp/Entities/Customer.cs
index ed30bbe1..4f3f87fe 100644
--- a/ShopifySharp/Entities/Customer.cs
+++ b/ShopifySharp/Entities/Customer.cs
@@ -2,164 +2,163 @@
using System;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class Customer : ShopifyObject
{
- public class Customer : ShopifyObject
- {
- ///
- /// A list of addresses for the customer.
- ///
- [JsonProperty("addresses")]
- public IEnumerable Addresses { get; set; }
-
- ///
- /// The date and time when the customer was created.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
-
- ///
- /// Currency used for customer's last order
- ///
- [JsonProperty("currency")]
- public string Currency { get; set; }
-
- ///
- /// The default address for the customer.
- ///
- [JsonProperty("default_address")]
- public Address DefaultAddress { get; set; }
-
- ///
- /// The email address of the customer.
- ///
- [JsonProperty("email")]
- public string Email { get; set; }
-
- ///
- /// The customer's first name.
- ///
- [JsonProperty("first_name")]
- public string FirstName { get; set; }
-
- ///
- /// The customer's identifier used with Multipass login
- ///
- [JsonProperty("multipass_identifier")]
- public string MultipassIdentifier { get; set; }
-
- ///
- /// The customer's last name.
- ///
- [JsonProperty("last_name")]
- public string LastName { get; set; }
-
- ///
- /// The id of the customer's last order.
- /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
- ///
- /// Property can be null or longer than max int32 value. Set to nullable long instead.
- [JsonProperty("last_order_id")]
- public long? LastOrderId { get; set; }
-
- ///
- /// The name of the customer's last order. This is directly related to the Order's name field.
- /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
- ///
- [JsonProperty("last_order_name")]
- public string LastOrderName { get; set; }
-
- ///
- /// A note about the customer.
- ///
- [JsonProperty("note")]
- public string Note { get; set; }
-
- ///
- /// The number of orders associated with this customer.
- /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
- ///
- [JsonProperty("orders_count")]
- public int? OrdersCount { get; set; }
-
- ///
- /// The phone number for the customer. Valid formats can be of different types, for example:
- ///
- /// 6135551212
- ///
- /// +16135551212
- ///
- /// 555-1212
- ///
- /// (613)555-1212
- ///
- /// +1 613-555-1212
- ///
- [JsonProperty("phone")]
- public string Phone { get; set; }
-
- ///
- /// The state of the customer in a shop. Valid values are 'disabled', 'decline', 'invited' and 'enabled'.
- ///
- [JsonProperty("state")]
- public string State { get; set; }
-
- ///
- /// Tags are additional short descriptors formatted as a string of comma-separated values.
- ///
- [JsonProperty("tags")]
- public string Tags { get; set; }
-
- ///
- /// Indicates whether the customer should be charged taxes when placing orders.
- ///
- [JsonProperty("tax_exempt")]
- public bool? TaxExempt { get; set; }
-
- ///
- /// Whether the customer is exempt from paying specific taxes on their order. Canadian taxes only
- ///
- [JsonProperty("tax_exemptions")]
- public string[] TaxExemptions { get; set; }
-
- ///
- /// The total amount of money that the customer has spent at the shop.
- /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
- ///
- /// The Shopify API actually returns this value as a string, but Json.Net can automatically convert to decimal.
- [JsonProperty("total_spent")]
- public decimal? TotalSpent { get; set; }
-
- ///
- /// The date and time when the customer information was updated.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
-
- ///
- /// States whether or not the email address has been verified.
- ///
- [JsonProperty("verified_email")]
- public bool? VerifiedEmail { get; set; }
-
- ///
- /// The marketing consent information when the customer consented to receiving marketing material by SMS. The phone property is required to create a customer with SMS consent information and to perform an SMS update on a customer that doesn't have a phone number recorded.
- ///
- [JsonProperty("sms_marketing_consent")]
- public CustomerSmsMarketingConsent SmsMarketingConsent { get; set; }
-
- ///
- /// Additional metadata about the . Note: This is not naturally returned with a response, as
- /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
- /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
- ///
- [JsonProperty("metafields")]
- public IEnumerable Metafields { get; set; }
-
- ///
- /// The marketing consent information when the customer consented to receiving marketing material by email. The email property is required to create a customer with email consent information and to update a customer for email consent that doesn't have an email recorded.
- ///
- [JsonProperty("email_marketing_consent")]
- public CustomerEmailMarketingConsent EmailMarketingConsent { get; set; }
- }
-}
+ ///
+ /// A list of addresses for the customer.
+ ///
+ [JsonProperty("addresses")]
+ public IEnumerable Addresses { get; set; }
+
+ ///
+ /// The date and time when the customer was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ ///
+ /// Currency used for customer's last order
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
+
+ ///
+ /// The default address for the customer.
+ ///
+ [JsonProperty("default_address")]
+ public Address DefaultAddress { get; set; }
+
+ ///
+ /// The email address of the customer.
+ ///
+ [JsonProperty("email")]
+ public string Email { get; set; }
+
+ ///
+ /// The customer's first name.
+ ///
+ [JsonProperty("first_name")]
+ public string FirstName { get; set; }
+
+ ///
+ /// The customer's identifier used with Multipass login
+ ///
+ [JsonProperty("multipass_identifier")]
+ public string MultipassIdentifier { get; set; }
+
+ ///
+ /// The customer's last name.
+ ///
+ [JsonProperty("last_name")]
+ public string LastName { get; set; }
+
+ ///
+ /// The id of the customer's last order.
+ /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
+ ///
+ /// Property can be null or longer than max int32 value. Set to nullable long instead.
+ [JsonProperty("last_order_id")]
+ public long? LastOrderId { get; set; }
+
+ ///
+ /// The name of the customer's last order. This is directly related to the Order's name field.
+ /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
+ ///
+ [JsonProperty("last_order_name")]
+ public string LastOrderName { get; set; }
+
+ ///
+ /// A note about the customer.
+ ///
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ ///
+ /// The number of orders associated with this customer.
+ /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
+ ///
+ [JsonProperty("orders_count")]
+ public int? OrdersCount { get; set; }
+
+ ///
+ /// The phone number for the customer. Valid formats can be of different types, for example:
+ ///
+ /// 6135551212
+ ///
+ /// +16135551212
+ ///
+ /// 555-1212
+ ///
+ /// (613)555-1212
+ ///
+ /// +1 613-555-1212
+ ///
+ [JsonProperty("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// The state of the customer in a shop. Valid values are 'disabled', 'decline', 'invited' and 'enabled'.
+ ///
+ [JsonProperty("state")]
+ public string State { get; set; }
+
+ ///
+ /// Tags are additional short descriptors formatted as a string of comma-separated values.
+ ///
+ [JsonProperty("tags")]
+ public string Tags { get; set; }
+
+ ///
+ /// Indicates whether the customer should be charged taxes when placing orders.
+ ///
+ [JsonProperty("tax_exempt")]
+ public bool? TaxExempt { get; set; }
+
+ ///
+ /// Whether the customer is exempt from paying specific taxes on their order. Canadian taxes only
+ ///
+ [JsonProperty("tax_exemptions")]
+ public string[] TaxExemptions { get; set; }
+
+ ///
+ /// The total amount of money that the customer has spent at the shop.
+ /// **Note**: this value is deprecated specifically when the customer is returned using the Orders API. In that case, the value will always be null. The property is still available via the Customers API.
+ ///
+ /// The Shopify API actually returns this value as a string, but Json.Net can automatically convert to decimal.
+ [JsonProperty("total_spent")]
+ public decimal? TotalSpent { get; set; }
+
+ ///
+ /// The date and time when the customer information was updated.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+
+ ///
+ /// States whether or not the email address has been verified.
+ ///
+ [JsonProperty("verified_email")]
+ public bool? VerifiedEmail { get; set; }
+
+ ///
+ /// The marketing consent information when the customer consented to receiving marketing material by SMS. The phone property is required to create a customer with SMS consent information and to perform an SMS update on a customer that doesn't have a phone number recorded.
+ ///
+ [JsonProperty("sms_marketing_consent")]
+ public CustomerSmsMarketingConsent SmsMarketingConsent { get; set; }
+
+ ///
+ /// Additional metadata about the . Note: This is not naturally returned with a response, as
+ /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
+ /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
+ ///
+ [JsonProperty("metafields")]
+ public IEnumerable Metafields { get; set; }
+
+ ///
+ /// The marketing consent information when the customer consented to receiving marketing material by email. The email property is required to create a customer with email consent information and to update a customer for email consent that doesn't have an email recorded.
+ ///
+ [JsonProperty("email_marketing_consent")]
+ public CustomerEmailMarketingConsent EmailMarketingConsent { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerDataRequestWebhook.cs b/ShopifySharp/Entities/CustomerDataRequestWebhook.cs
index 5f3be6a4..31929a12 100644
--- a/ShopifySharp/Entities/CustomerDataRequestWebhook.cs
+++ b/ShopifySharp/Entities/CustomerDataRequestWebhook.cs
@@ -1,23 +1,22 @@
using System.Collections.Generic;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Sent via the GDPR customers/data_request webhook, indicating that a customer has requested all data that you may have stored related to them. It's your responsibility to provide this data to the store owner directly.
+///
+public class CustomerDataRequestWebhook : ShopRedactedWebhook
{
///
- /// Sent via the GDPR customers/data_request webhook, indicating that a customer has requested all data that you may have stored related to them. It's your responsibility to provide this data to the store owner directly.
+ /// The customer who has been redacted.
///
- public class CustomerDataRequestWebhook : ShopRedactedWebhook
- {
- ///
- /// The customer who has been redacted.
- ///
- [JsonProperty("customer")]
- public RedactedCustomer Customer { get; set; }
+ [JsonProperty("customer")]
+ public RedactedCustomer Customer { get; set; }
- ///
- /// A list of order ids placed by the customer that they are requesting information on.
- ///
- [JsonProperty("orders_requested")]
- public IEnumerable OrdersRequested { get; set; }
- }
+ ///
+ /// A list of order ids placed by the customer that they are requesting information on.
+ ///
+ [JsonProperty("orders_requested")]
+ public IEnumerable OrdersRequested { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerEmailMarketingConsent.cs b/ShopifySharp/Entities/CustomerEmailMarketingConsent.cs
index 87506f28..c884c931 100644
--- a/ShopifySharp/Entities/CustomerEmailMarketingConsent.cs
+++ b/ShopifySharp/Entities/CustomerEmailMarketingConsent.cs
@@ -1,26 +1,25 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using System;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CustomerEmailMarketingConsent
{
- public class CustomerEmailMarketingConsent
- {
- ///
- /// The current email marketing state for the customer.
- ///
- [JsonProperty("state")]
- public string State { get; set; }
+ ///
+ /// The current email marketing state for the customer.
+ ///
+ [JsonProperty("state")]
+ public string State { get; set; }
- ///
- /// The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email.
- ///
- [JsonProperty("opt_in_level")]
- public string OptInLevel { get; set; }
+ ///
+ /// The marketing subscription opt-in level, as described in the M3AAWG Sender Best Common Practices, that the customer gave when they consented to receive marketing material by email.
+ ///
+ [JsonProperty("opt_in_level")]
+ public string OptInLevel { get; set; }
- ///
- /// The date and time when the customer consented to receive marketing material by email. If no date is provided, then the date and time when the consent information was sent is used.
- ///
- [JsonProperty("consent_updated_at")]
- public DateTimeOffset? ConsentUpdatedAt { get; set; }
- }
-}
+ ///
+ /// The date and time when the customer consented to receive marketing material by email. If no date is provided, then the date and time when the consent information was sent is used.
+ ///
+ [JsonProperty("consent_updated_at")]
+ public DateTimeOffset? ConsentUpdatedAt { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerEmailMarketingConsentWebhook.cs b/ShopifySharp/Entities/CustomerEmailMarketingConsentWebhook.cs
index 5d969b4f..c9f8758a 100644
--- a/ShopifySharp/Entities/CustomerEmailMarketingConsentWebhook.cs
+++ b/ShopifySharp/Entities/CustomerEmailMarketingConsentWebhook.cs
@@ -1,20 +1,19 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Payload for webhook customers_email_marketing_consent/update
+/// https://shopify.dev/docs/api/admin-rest/2023-07/resources/webhook#event-topics-customers-marketing-consent-update
+///
+public class CustomerEmailMarketingConsentWebhook : ShopifyObject
{
- ///
- /// Payload for webhook customers_email_marketing_consent/update
- /// https://shopify.dev/docs/api/admin-rest/2023-07/resources/webhook#event-topics-customers-marketing-consent-update
- ///
- public class CustomerEmailMarketingConsentWebhook : ShopifyObject
- {
- [JsonProperty("customer_id")]
- public long? CustomerId { get; set; }
+ [JsonProperty("customer_id")]
+ public long? CustomerId { get; set; }
- [JsonProperty("email_address")]
- public string EmailAddress { get; set; }
+ [JsonProperty("email_address")]
+ public string EmailAddress { get; set; }
- [JsonProperty("email_marketing_consent")]
- public CustomerEmailMarketingConsent EmailMarketingConsent { get; set; }
- }
-}
+ [JsonProperty("email_marketing_consent")]
+ public CustomerEmailMarketingConsent EmailMarketingConsent { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerInvite.cs b/ShopifySharp/Entities/CustomerInvite.cs
index ab2bf8e3..4c8bbb69 100644
--- a/ShopifySharp/Entities/CustomerInvite.cs
+++ b/ShopifySharp/Entities/CustomerInvite.cs
@@ -1,39 +1,38 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CustomerInvite : ShopifyObject
{
- public class CustomerInvite : ShopifyObject
- {
- ///
- /// The email address of the customer to be invited
- ///
- [JsonProperty("to")]
- public string To { get; set; }
+ ///
+ /// The email address of the customer to be invited
+ ///
+ [JsonProperty("to")]
+ public string To { get; set; }
- ///
- /// The sender of the email
- ///
- [JsonProperty("from")]
- public string From { get; set; }
+ ///
+ /// The sender of the email
+ ///
+ [JsonProperty("from")]
+ public string From { get; set; }
- ///
- /// the subject
- ///
- [JsonProperty("subject")]
- public string Subject { get; set; }
+ ///
+ /// the subject
+ ///
+ [JsonProperty("subject")]
+ public string Subject { get; set; }
- ///
- /// a custom message to include
- ///
- [JsonProperty("custom_message")]
- public string CustomMessage { get; set; }
+ ///
+ /// a custom message to include
+ ///
+ [JsonProperty("custom_message")]
+ public string CustomMessage { get; set; }
- ///
- /// blind copy addresses
- ///
- [JsonProperty("bcc")]
- public IEnumerable Bcc { get; set; }
+ ///
+ /// blind copy addresses
+ ///
+ [JsonProperty("bcc")]
+ public IEnumerable Bcc { get; set; }
- }
-}
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerMarketingConsentWebhook.cs b/ShopifySharp/Entities/CustomerMarketingConsentWebhook.cs
index e4885cba..706043a3 100644
--- a/ShopifySharp/Entities/CustomerMarketingConsentWebhook.cs
+++ b/ShopifySharp/Entities/CustomerMarketingConsentWebhook.cs
@@ -1,17 +1,16 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Payload for webhook customers_marketing_consent/update
+/// https://shopify.dev/docs/api/admin-rest/2023-07/resources/webhook#event-topics-customers-marketing-consent-update
+///
+public class CustomerMarketingConsentWebhook : ShopifyObject
{
- ///
- /// Payload for webhook customers_marketing_consent/update
- /// https://shopify.dev/docs/api/admin-rest/2023-07/resources/webhook#event-topics-customers-marketing-consent-update
- ///
- public class CustomerMarketingConsentWebhook : ShopifyObject
- {
- [JsonProperty("phone")]
- public string Phone { get; set; }
+ [JsonProperty("phone")]
+ public string Phone { get; set; }
- [JsonProperty("sms_marketing_consent")]
- public CustomerSmsMarketingConsent SmsMarketingConsent { get; set; }
- }
-}
+ [JsonProperty("sms_marketing_consent")]
+ public CustomerSmsMarketingConsent SmsMarketingConsent { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerRedactedWebhook.cs b/ShopifySharp/Entities/CustomerRedactedWebhook.cs
index 001e6f61..7fcc641e 100644
--- a/ShopifySharp/Entities/CustomerRedactedWebhook.cs
+++ b/ShopifySharp/Entities/CustomerRedactedWebhook.cs
@@ -1,23 +1,22 @@
using System.Collections.Generic;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// Sent via the GDPR customers/redact webhook, indicating that you should purge the customer's data from your systems.
+///
+public class CustomerRedactedWebhook : ShopRedactedWebhook
{
///
- /// Sent via the GDPR customers/redact webhook, indicating that you should purge the customer's data from your systems.
+ /// The customer who has been redacted.
///
- public class CustomerRedactedWebhook : ShopRedactedWebhook
- {
- ///
- /// The customer who has been redacted.
- ///
- [JsonProperty("customer")]
- public RedactedCustomer Customer { get; set; }
+ [JsonProperty("customer")]
+ public RedactedCustomer Customer { get; set; }
- ///
- /// A list of order ids placed by the customer that must also be purged from your systems.
- ///
- [JsonProperty("orders_to_redact")]
- public IEnumerable OrdersToRedact { get; set; }
- }
+ ///
+ /// A list of order ids placed by the customer that must also be purged from your systems.
+ ///
+ [JsonProperty("orders_to_redact")]
+ public IEnumerable OrdersToRedact { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/CustomerSmsMarketingConsent.cs b/ShopifySharp/Entities/CustomerSmsMarketingConsent.cs
index 54ef3527..5cb42c97 100644
--- a/ShopifySharp/Entities/CustomerSmsMarketingConsent.cs
+++ b/ShopifySharp/Entities/CustomerSmsMarketingConsent.cs
@@ -1,32 +1,31 @@
using System;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class CustomerSmsMarketingConsent
{
- public class CustomerSmsMarketingConsent
- {
- ///
- /// The current SMS marketing state for the customer.
- ///
- [JsonProperty("state")]
- public string State { get; set; }
+ ///
+ /// The current SMS marketing state for the customer.
+ ///
+ [JsonProperty("state")]
+ public string State { get; set; }
- ///
- /// The marketing subscription opt-in level, as described by the M3AAWG best practices guidelines, that the customer gave when they consented to receive marketing material by SMS.
- ///
- [JsonProperty("opt_in_level")]
- public string OptInLevel { get; set; }
+ ///
+ /// The marketing subscription opt-in level, as described by the M3AAWG best practices guidelines, that the customer gave when they consented to receive marketing material by SMS.
+ ///
+ [JsonProperty("opt_in_level")]
+ public string OptInLevel { get; set; }
- ///
- /// The date and time at which the customer consented to receive marketing material by SMS.
- ///
- [JsonProperty("consent_updated_at")]
- public DateTimeOffset? ConsentUpdatedAt { get; set; }
+ ///
+ /// The date and time at which the customer consented to receive marketing material by SMS.
+ ///
+ [JsonProperty("consent_updated_at")]
+ public DateTimeOffset? ConsentUpdatedAt { get; set; }
- ///
- /// The source for whether the customer has consented to receive marketing material by SMS.
- ///
- [JsonProperty("consent_collected_from")]
- public string ConsentCollectedFrom { get; set; }
- }
-}
+ ///
+ /// The source for whether the customer has consented to receive marketing material by SMS.
+ ///
+ [JsonProperty("consent_collected_from")]
+ public string ConsentCollectedFrom { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DeliveryMethod.cs b/ShopifySharp/Entities/DeliveryMethod.cs
index 6ff478bf..35628b4b 100644
--- a/ShopifySharp/Entities/DeliveryMethod.cs
+++ b/ShopifySharp/Entities/DeliveryMethod.cs
@@ -1,24 +1,23 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DeliveryMethod
{
- public class DeliveryMethod
- {
- ///
- /// The ID of the delivery method.
- ///
- [JsonProperty("id")]
- public long? Id { get; set; }
+ ///
+ /// The ID of the delivery method.
+ ///
+ [JsonProperty("id")]
+ public long? Id { get; set; }
- ///
- /// The type of delivery method. Valid values.
- /// local: A delivery to a customer's doorstep
- /// none: No delivery method
- /// pick_up: A delivery that a customer picks up at your retail store, curbside, or any location that you choose
- /// retail: A delivery to a retail store
- /// shipping: A delivery to a customer using a shipping carrier
- ///
- [JsonProperty("method_type")]
- public string MethodType { get; set; }
- }
-}
+ ///
+ /// The type of delivery method. Valid values.
+ /// local: A delivery to a customer's doorstep
+ /// none: No delivery method
+ /// pick_up: A delivery that a customer picks up at your retail store, curbside, or any location that you choose
+ /// retail: A delivery to a retail store
+ /// shipping: A delivery to a customer using a shipping carrier
+ ///
+ [JsonProperty("method_type")]
+ public string MethodType { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DiscountAllocation.cs b/ShopifySharp/Entities/DiscountAllocation.cs
index 64c57482..bd926a8b 100644
--- a/ShopifySharp/Entities/DiscountAllocation.cs
+++ b/ShopifySharp/Entities/DiscountAllocation.cs
@@ -1,25 +1,24 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DiscountAllocation
{
- public class DiscountAllocation
- {
- ///
- /// The discount amount allocated to the line (not sure why it is a string)
- ///
- [JsonProperty("amount")]
- public string Amount { get; set; }
+ ///
+ /// The discount amount allocated to the line (not sure why it is a string)
+ ///
+ [JsonProperty("amount")]
+ public string Amount { get; set; }
- ///
- /// The index of the associated discount application in the order's discount_applications list.
- ///
- [JsonProperty("discount_application_index")]
- public long DiscountApplicationIndex { get; set; }
+ ///
+ /// The index of the associated discount application in the order's discount_applications list.
+ ///
+ [JsonProperty("discount_application_index")]
+ public long DiscountApplicationIndex { get; set; }
- ///
- /// The discount amount allocated to the line item in shop and presentment currencies.
- ///
- [JsonProperty("amount_set")]
- public PriceSet AmountSet { get; set; }
- }
-}
+ ///
+ /// The discount amount allocated to the line item in shop and presentment currencies.
+ ///
+ [JsonProperty("amount_set")]
+ public PriceSet AmountSet { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DiscountApplication.cs b/ShopifySharp/Entities/DiscountApplication.cs
index 94b46798..857137fc 100644
--- a/ShopifySharp/Entities/DiscountApplication.cs
+++ b/ShopifySharp/Entities/DiscountApplication.cs
@@ -1,76 +1,75 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DiscountApplication
{
- public class DiscountApplication
- {
- ///
- /// The discount application type. Valid values:
- /// manual: The discount was manually applied by the merchant(for example, by using an app or creating a draft order).
- /// script: The discount was applied by a Shopify Script.
- /// discount_code: The discount was applied by a discount code.
- ///
- [JsonProperty("type")]
- public string Type { get; set; }
+ ///
+ /// The discount application type. Valid values:
+ /// manual: The discount was manually applied by the merchant(for example, by using an app or creating a draft order).
+ /// script: The discount was applied by a Shopify Script.
+ /// discount_code: The discount was applied by a discount code.
+ ///
+ [JsonProperty("type")]
+ public string Type { get; set; }
- ///
- /// The discount code that was used to apply the discount. Available only for discount code applications.
- ///
- [JsonProperty("code")]
- public string Code { get; set; }
+ ///
+ /// The discount code that was used to apply the discount. Available only for discount code applications.
+ ///
+ [JsonProperty("code")]
+ public string Code { get; set; }
- ///
- /// The title of the discount application, as defined by the merchant. Available only for manual discount applications.
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// The title of the discount application, as defined by the merchant. Available only for manual discount applications.
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// The description of the discount application, as defined by the merchant or the Shopify Script. Available only for manual and script discount applications.
- ///
- [JsonProperty("description")]
- public string Description { get; set; }
+ ///
+ /// The description of the discount application, as defined by the merchant or the Shopify Script. Available only for manual and script discount applications.
+ ///
+ [JsonProperty("description")]
+ public string Description { get; set; }
- ///
- /// The value of the discount application as a decimal. This represents the intention of the discount application.
- /// For example, if the intent was to apply a 20% discount, then the value will be 20.0.
- /// If the intent was to apply a $15 discount, then the value will be 15.0.
- ///
- [JsonProperty("value")]
- public string Value { get; set; }
+ ///
+ /// The value of the discount application as a decimal. This represents the intention of the discount application.
+ /// For example, if the intent was to apply a 20% discount, then the value will be 20.0.
+ /// If the intent was to apply a $15 discount, then the value will be 15.0.
+ ///
+ [JsonProperty("value")]
+ public string Value { get; set; }
- ///
- /// The type of the value. Valid values:
- /// fixed_amount: A fixed amount discount value in the currency of the order.
- /// percentage: A percentage discount value.
- ///
- [JsonProperty("value_type")]
- public string ValueType { get; set; }
+ ///
+ /// The type of the value. Valid values:
+ /// fixed_amount: A fixed amount discount value in the currency of the order.
+ /// percentage: A percentage discount value.
+ ///
+ [JsonProperty("value_type")]
+ public string ValueType { get; set; }
- ///
- /// The method by which the discount application value has been allocated to entitled lines. Valid values:
- /// across: The value is spread across all entitled lines.
- /// each: The value is applied onto every entitled line.
- /// one: The value is applied onto a single line.
- ///
- [JsonProperty("allocation_method")]
- public string AllocationMethod { get; set; }
+ ///
+ /// The method by which the discount application value has been allocated to entitled lines. Valid values:
+ /// across: The value is spread across all entitled lines.
+ /// each: The value is applied onto every entitled line.
+ /// one: The value is applied onto a single line.
+ ///
+ [JsonProperty("allocation_method")]
+ public string AllocationMethod { get; set; }
- ///
- /// The lines on the order, of the type defined by target_type, that the discount is allocated over. Valid values:
- /// all: The discount is allocated onto all lines,
- /// entitled: The discount is allocated only onto lines it is entitled for.
- /// explicit: The discount is allocated onto explicitly selected lines.
- ///
- [JsonProperty("target_selection")]
- public string TargetSelection { get; set; }
+ ///
+ /// The lines on the order, of the type defined by target_type, that the discount is allocated over. Valid values:
+ /// all: The discount is allocated onto all lines,
+ /// entitled: The discount is allocated only onto lines it is entitled for.
+ /// explicit: The discount is allocated onto explicitly selected lines.
+ ///
+ [JsonProperty("target_selection")]
+ public string TargetSelection { get; set; }
- ///
- /// The type of line on the order that the discount is applicable on. Valid values:
- /// line_item: The discount applies to line items.
- /// shipping_line: The discount applies to shipping lines.
- ///
- [JsonProperty("target_type")]
- public string TargetType { get; set; }
- }
-}
+ ///
+ /// The type of line on the order that the discount is applicable on. Valid values:
+ /// line_item: The discount applies to line items.
+ /// shipping_line: The discount applies to shipping lines.
+ ///
+ [JsonProperty("target_type")]
+ public string TargetType { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DiscountCode.cs b/ShopifySharp/Entities/DiscountCode.cs
index 43bd23d8..6f976715 100644
--- a/ShopifySharp/Entities/DiscountCode.cs
+++ b/ShopifySharp/Entities/DiscountCode.cs
@@ -1,25 +1,24 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DiscountCode : ShopifyObject
{
- public class DiscountCode : ShopifyObject
- {
- ///
- /// The amount of the discount.
- ///
- [JsonProperty("amount")]
- public string Amount { get; set; }
+ ///
+ /// The amount of the discount.
+ ///
+ [JsonProperty("amount")]
+ public string Amount { get; set; }
- ///
- /// The discount code.
- ///
- [JsonProperty("code")]
- public string Code { get; set; }
+ ///
+ /// The discount code.
+ ///
+ [JsonProperty("code")]
+ public string Code { get; set; }
- ///
- /// The type of discount. Known values are 'percentage', 'shipping', 'fixed_amount' and 'none'.
- ///
- [JsonProperty("type")]
- public string Type { get; set; }
- }
-}
+ ///
+ /// The type of discount. Known values are 'percentage', 'shipping', 'fixed_amount' and 'none'.
+ ///
+ [JsonProperty("type")]
+ public string Type { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DraftLineItem.cs b/ShopifySharp/Entities/DraftLineItem.cs
index 9f2e4501..8b9e96fc 100644
--- a/ShopifySharp/Entities/DraftLineItem.cs
+++ b/ShopifySharp/Entities/DraftLineItem.cs
@@ -1,19 +1,18 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DraftLineItem : LineItem
{
- public class DraftLineItem : LineItem
- {
- ///
- /// Indicates if this is a product variant line item, or a custom line item. If set to true indicates a custom line item. If set to false indicates a product variant line item. This is a read only field.
- ///
- [JsonProperty("custom")]
- public bool? Custom { get; set; }
+ ///
+ /// Indicates if this is a product variant line item, or a custom line item. If set to true indicates a custom line item. If set to false indicates a product variant line item. This is a read only field.
+ ///
+ [JsonProperty("custom")]
+ public bool? Custom { get; set; }
- ///
- /// Discount which will be applied to the line item or the overall order.
- ///
- [JsonProperty("applied_discount")]
- public AppliedDiscount AppliedDiscount { get; set; }
- }
+ ///
+ /// Discount which will be applied to the line item or the overall order.
+ ///
+ [JsonProperty("applied_discount")]
+ public AppliedDiscount AppliedDiscount { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DraftOrder.cs b/ShopifySharp/Entities/DraftOrder.cs
index 7895dca4..ec837362 100644
--- a/ShopifySharp/Entities/DraftOrder.cs
+++ b/ShopifySharp/Entities/DraftOrder.cs
@@ -2,185 +2,184 @@
using System.Collections.Generic;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DraftOrder : ShopifyObject
{
- public class DraftOrder : ShopifyObject
- {
- ///
- /// The unique numeric identifier for the order associated to the draft order, once created.
- ///
- [JsonProperty("order_id")]
- public long? OrderId { get; set; }
-
- ///
- /// Name of the draft order.
- ///
- [JsonProperty("name")]
- public string Name { get; set; }
-
- ///
- /// Customer associated with the draft order. Customer associated with the draft order. Used to load/remove the associated customer with customer id. When a customer is loaded, the customer’s email address is also assocaited.
- ///
- [JsonProperty("customer")]
- public Customer Customer { get; set; }
-
- ///
- /// The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require one.
- ///
- [JsonProperty("shipping_address")]
- public Address ShippingAddress { get; set; }
-
- ///
- /// The mailing address associated with the payment method. This address is an optional field that will not be available on orders that do not require one.
- ///
- [JsonProperty("billing_address")]
- public Address BillingAddress { get; set; }
-
- ///
- /// The text of an optional note that a shop owner can attach to the draft order.
- ///
- [JsonProperty("note")]
- public string Note { get; set; }
-
- ///
- /// Extra information that is added to the order.
- ///
- [JsonProperty("note_attributes")]
- public IEnumerable NoteAttributes { get; set; }
-
- ///
- /// The customer's email address.
- ///
- [JsonProperty("email")]
- public string Email { get; set; }
-
- ///
- /// The three letter code (ISO 4217) for the currency used for the payment.
- ///
- [JsonProperty("currency")]
- public string Currency { get; set; }
-
- ///
- /// This auto-generated property is the date and time when the invoice was emailed to the customer, in ISO 8601 format.
- ///
- [JsonProperty("invoice_sent_at")]
- public DateTimeOffset? InvoiceSentAt { get; set; }
-
- ///
- /// The URL for the invoice.
- ///
- [JsonProperty("invoice_url")]
- public string InvoiceUrl { get; set; }
-
- ///
- /// Product variant line item or custom line item associated to the draft order. Each draft order must include at least one line_item.
- ///
- [JsonProperty("line_items")]
- public IEnumerable LineItems { get; set; }
-
- ///
- /// Details the shipping method used.
- ///
- [JsonProperty("shipping_line")]
- public DraftShippingLine ShippingLine { get; set; }
-
- ///
- /// Tags are additional short descriptors, commonly used for filtering and searching, formatted as a string of comma-separated values.
- ///
- [JsonProperty("tags")]
- public string Tags { get; set; }
-
- ///
- /// Sets whether or not taxes are exempt for the draft order. If this field is set to false, then Shopify will refer to the taxable field for each line_item. If a customer is applied to the draft order, then Shopify will use the customer's tax_exempt field instead.
- ///
- [JsonProperty("tax_exempt")]
- public bool? TaxExempt { get; set; }
-
- ///
- /// Whether the customer is exempt from paying specific taxes on their order
- ///
- [JsonProperty("tax_exemptions")]
- public IEnumerable TaxExemptions { get; set; }
-
- ///
- /// An array of tax_line objects, each of which details the total taxes applicable to the order. When creating an order through the API, tax lines may be specified on the order or the line items but not both. Tax lines specified on the order are split on the taxable line items in the created order.
- ///
- [JsonProperty("tax_lines")]
- public IEnumerable TaxLines { get; set; }
-
- ///
- /// Discount which will be applied to the line item or the overall order. A draft order line_item can have one discount. A draft order can have one order-level discount.
- ///
- [JsonProperty("applied_discount")]
- public AppliedDiscount AppliedDiscount { get; set; }
-
- ///
- /// States whether or not taxes are included in the order subtotal.
- ///
- [JsonProperty("taxes_included")]
- public bool? TaxesIncluded { get; set; }
-
- ///
- /// The sum of all the taxes applied to the order (must be positive).
- ///
- [JsonProperty("total_tax")]
- public decimal? TotalTax { get; set; }
-
- ///
- /// Price of the order before shipping and taxes
- ///
- [JsonProperty("subtotal_price")]
- public decimal? SubtotalPrice { get; set; }
-
- ///
- /// The sum of all the prices of all the items in the order, taxes and discounts included (must be positive).
- ///
- [JsonProperty("total_price")]
- public decimal? TotalPrice { get; set; }
-
- ///
- /// Date at which order is created and the draft order changes to completed status. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("completed_at")]
- public DateTimeOffset? CompletedAt { get; set; }
-
- ///
- /// This auto-generated property is the date and time when the draft order was created in Shopify, in ISO 8601 format.
- ///
- [JsonProperty("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
-
- ///
- /// The date and time when the order was last modified. The API returns this value in ISO 8601 format.
- ///
- [JsonProperty("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
-
- ///
- /// Once a draft order is set to status completed the only further draft order modifications that can be made are adding tags or metafields. No other draft order actions are permitted.
- /// Known values are "open", "invoice_sent", and "completed".
- ///
- [JsonProperty("status")]
- public string Status { get; set; }
-
- ///
- /// Additional metadata about the . Note: This is not naturally returned with a response, as
- /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
- /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
- ///
- [JsonProperty("metafields")]
- public IEnumerable Metafields { get; set; }
-
- ///
- /// An optional boolean that you can send as part of a draft order object to load customer shipping information.
- ///
- [JsonProperty("use_customer_default_address")]
- public bool? UseCustomerDefaultAddress { get; set; }
-
- ///
- /// The terms and conditions under which a payment should be processed.
- ///
- [JsonProperty("payment_terms")]
- public PaymentTerms PaymentTerms { get; set; }
- }
-}
+ ///
+ /// The unique numeric identifier for the order associated to the draft order, once created.
+ ///
+ [JsonProperty("order_id")]
+ public long? OrderId { get; set; }
+
+ ///
+ /// Name of the draft order.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// Customer associated with the draft order. Customer associated with the draft order. Used to load/remove the associated customer with customer id. When a customer is loaded, the customer’s email address is also assocaited.
+ ///
+ [JsonProperty("customer")]
+ public Customer Customer { get; set; }
+
+ ///
+ /// The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require one.
+ ///
+ [JsonProperty("shipping_address")]
+ public Address ShippingAddress { get; set; }
+
+ ///
+ /// The mailing address associated with the payment method. This address is an optional field that will not be available on orders that do not require one.
+ ///
+ [JsonProperty("billing_address")]
+ public Address BillingAddress { get; set; }
+
+ ///
+ /// The text of an optional note that a shop owner can attach to the draft order.
+ ///
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ ///
+ /// Extra information that is added to the order.
+ ///
+ [JsonProperty("note_attributes")]
+ public IEnumerable NoteAttributes { get; set; }
+
+ ///
+ /// The customer's email address.
+ ///
+ [JsonProperty("email")]
+ public string Email { get; set; }
+
+ ///
+ /// The three letter code (ISO 4217) for the currency used for the payment.
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
+
+ ///
+ /// This auto-generated property is the date and time when the invoice was emailed to the customer, in ISO 8601 format.
+ ///
+ [JsonProperty("invoice_sent_at")]
+ public DateTimeOffset? InvoiceSentAt { get; set; }
+
+ ///
+ /// The URL for the invoice.
+ ///
+ [JsonProperty("invoice_url")]
+ public string InvoiceUrl { get; set; }
+
+ ///
+ /// Product variant line item or custom line item associated to the draft order. Each draft order must include at least one line_item.
+ ///
+ [JsonProperty("line_items")]
+ public IEnumerable LineItems { get; set; }
+
+ ///
+ /// Details the shipping method used.
+ ///
+ [JsonProperty("shipping_line")]
+ public DraftShippingLine ShippingLine { get; set; }
+
+ ///
+ /// Tags are additional short descriptors, commonly used for filtering and searching, formatted as a string of comma-separated values.
+ ///
+ [JsonProperty("tags")]
+ public string Tags { get; set; }
+
+ ///
+ /// Sets whether or not taxes are exempt for the draft order. If this field is set to false, then Shopify will refer to the taxable field for each line_item. If a customer is applied to the draft order, then Shopify will use the customer's tax_exempt field instead.
+ ///
+ [JsonProperty("tax_exempt")]
+ public bool? TaxExempt { get; set; }
+
+ ///
+ /// Whether the customer is exempt from paying specific taxes on their order
+ ///
+ [JsonProperty("tax_exemptions")]
+ public IEnumerable TaxExemptions { get; set; }
+
+ ///
+ /// An array of tax_line objects, each of which details the total taxes applicable to the order. When creating an order through the API, tax lines may be specified on the order or the line items but not both. Tax lines specified on the order are split on the taxable line items in the created order.
+ ///
+ [JsonProperty("tax_lines")]
+ public IEnumerable TaxLines { get; set; }
+
+ ///
+ /// Discount which will be applied to the line item or the overall order. A draft order line_item can have one discount. A draft order can have one order-level discount.
+ ///
+ [JsonProperty("applied_discount")]
+ public AppliedDiscount AppliedDiscount { get; set; }
+
+ ///
+ /// States whether or not taxes are included in the order subtotal.
+ ///
+ [JsonProperty("taxes_included")]
+ public bool? TaxesIncluded { get; set; }
+
+ ///
+ /// The sum of all the taxes applied to the order (must be positive).
+ ///
+ [JsonProperty("total_tax")]
+ public decimal? TotalTax { get; set; }
+
+ ///
+ /// Price of the order before shipping and taxes
+ ///
+ [JsonProperty("subtotal_price")]
+ public decimal? SubtotalPrice { get; set; }
+
+ ///
+ /// The sum of all the prices of all the items in the order, taxes and discounts included (must be positive).
+ ///
+ [JsonProperty("total_price")]
+ public decimal? TotalPrice { get; set; }
+
+ ///
+ /// Date at which order is created and the draft order changes to completed status. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("completed_at")]
+ public DateTimeOffset? CompletedAt { get; set; }
+
+ ///
+ /// This auto-generated property is the date and time when the draft order was created in Shopify, in ISO 8601 format.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ ///
+ /// The date and time when the order was last modified. The API returns this value in ISO 8601 format.
+ ///
+ [JsonProperty("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+
+ ///
+ /// Once a draft order is set to status completed the only further draft order modifications that can be made are adding tags or metafields. No other draft order actions are permitted.
+ /// Known values are "open", "invoice_sent", and "completed".
+ ///
+ [JsonProperty("status")]
+ public string Status { get; set; }
+
+ ///
+ /// Additional metadata about the . Note: This is not naturally returned with a response, as
+ /// Shopify will not return metafields unless specified. Instead, you need to query metafields with .
+ /// Uses include: Creating, updating, & deserializing webhook bodies that include them.
+ ///
+ [JsonProperty("metafields")]
+ public IEnumerable Metafields { get; set; }
+
+ ///
+ /// An optional boolean that you can send as part of a draft order object to load customer shipping information.
+ ///
+ [JsonProperty("use_customer_default_address")]
+ public bool? UseCustomerDefaultAddress { get; set; }
+
+ ///
+ /// The terms and conditions under which a payment should be processed.
+ ///
+ [JsonProperty("payment_terms")]
+ public PaymentTerms PaymentTerms { get; set; }
+}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DraftOrderInvoice.cs b/ShopifySharp/Entities/DraftOrderInvoice.cs
index 199fea26..9b23a70e 100644
--- a/ShopifySharp/Entities/DraftOrderInvoice.cs
+++ b/ShopifySharp/Entities/DraftOrderInvoice.cs
@@ -1,23 +1,22 @@
using System.Collections.Generic;
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DraftOrderInvoice : Parameterizable
{
- public class DraftOrderInvoice : Parameterizable
- {
- [JsonProperty("to")]
- public string To { get; set; }
+ [JsonProperty("to")]
+ public string To { get; set; }
- [JsonProperty("from")]
- public string From { get; set; }
+ [JsonProperty("from")]
+ public string From { get; set; }
- [JsonProperty("bcc")]
- public IEnumerable BCC { get; set; }
+ [JsonProperty("bcc")]
+ public IEnumerable BCC { get; set; }
- [JsonProperty("subject")]
- public string Subject { get; set; }
+ [JsonProperty("subject")]
+ public string Subject { get; set; }
- [JsonProperty("custom_message")]
- public string CustomMessage { get; set; }
- }
+ [JsonProperty("custom_message")]
+ public string CustomMessage { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/DraftShippingLine.cs b/ShopifySharp/Entities/DraftShippingLine.cs
index c5d4386a..bc57fdb7 100644
--- a/ShopifySharp/Entities/DraftShippingLine.cs
+++ b/ShopifySharp/Entities/DraftShippingLine.cs
@@ -1,31 +1,30 @@
using Newtonsoft.Json;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+public class DraftShippingLine
{
- public class DraftShippingLine
- {
- ///
- /// Whether this is a regular shipping line or custom shipping line.
- ///
- [JsonProperty("custom")]
- public bool? Custom { get; set; }
+ ///
+ /// Whether this is a regular shipping line or custom shipping line.
+ ///
+ [JsonProperty("custom")]
+ public bool? Custom { get; set; }
- ///
- /// The handle of the shipping rate which was selected and applied. Required for regular shipping lines.
- ///
- [JsonProperty("handle")]
- public string Handle { get; set; }
+ ///
+ /// The handle of the shipping rate which was selected and applied. Required for regular shipping lines.
+ ///
+ [JsonProperty("handle")]
+ public string Handle { get; set; }
- ///
- /// The title of the shipping method. Required for custom shipping lines. (maximum: 255 characters)
- ///
- [JsonProperty("title")]
- public string Title { get; set; }
+ ///
+ /// The title of the shipping method. Required for custom shipping lines. (maximum: 255 characters)
+ ///
+ [JsonProperty("title")]
+ public string Title { get; set; }
- ///
- /// The price of the shipping method. Required for custom shipping lines.
- ///
- [JsonProperty("price")]
- public decimal? Price { get; set; }
- }
+ ///
+ /// The price of the shipping method. Required for custom shipping lines.
+ ///
+ [JsonProperty("price")]
+ public decimal? Price { get; set; }
}
\ No newline at end of file
diff --git a/ShopifySharp/Entities/Event.cs b/ShopifySharp/Entities/Event.cs
index 5116da4f..b9032432 100644
--- a/ShopifySharp/Entities/Event.cs
+++ b/ShopifySharp/Entities/Event.cs
@@ -2,65 +2,64 @@
using System;
using System.Collections.Generic;
-namespace ShopifySharp
+namespace ShopifySharp;
+
+///
+/// An object representing a Shopify event.
+///
+public class Event : ShopifyObject
{
///
- /// An object representing a Shopify event.
+ /// Refers to a certain event and its resources.
///
- public class Event : ShopifyObject
- {
- ///
- /// Refers to a certain event and its resources.
- ///
- [JsonProperty("arguments")]
- public IEnumerable