diff --git a/invoicedapi/Entities/Coupon.cs b/invoicedapi/Entities/Coupon.cs index 5b10fc7..009c7ea 100644 --- a/invoicedapi/Entities/Coupon.cs +++ b/invoicedapi/Entities/Coupon.cs @@ -48,7 +48,7 @@ protected override string EntityId() // Conditional Serialisation public bool ShouldSerializeId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync);; } public bool ShouldSerializeObject() @@ -58,32 +58,32 @@ public bool ShouldSerializeObject() public bool ShouldSerializeCurrency() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeValue() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeIsPercent() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeExclusive() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeExpirationDate() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeMaxRedemptions() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCreatedAt() diff --git a/invoicedapi/Entities/Customer.cs b/invoicedapi/Entities/Customer.cs index 568e2cc..9318753 100644 --- a/invoicedapi/Entities/Customer.cs +++ b/invoicedapi/Entities/Customer.cs @@ -269,12 +269,12 @@ public bool ShouldSerializeNextChaseStep() public bool ShouldSerializeAutopayDelayDays() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializePaymentSource() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeSignUpUrl() diff --git a/invoicedapi/Entities/Item.cs b/invoicedapi/Entities/Item.cs index a9c9ee5..ce8263b 100644 --- a/invoicedapi/Entities/Item.cs +++ b/invoicedapi/Entities/Item.cs @@ -56,7 +56,7 @@ protected override string EntityId() // Conditional Serialisation public bool ShouldSerializeId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeObject() @@ -66,37 +66,37 @@ public bool ShouldSerializeObject() public bool ShouldSerializeCurrency() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeUnitCost() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeTaxable() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeTaxes() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeAvalaraTaxCode() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeGlAccount() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeDiscountable() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCreatedAt() diff --git a/invoicedapi/Entities/Note.cs b/invoicedapi/Entities/Note.cs index f734dc0..861383f 100644 --- a/invoicedapi/Entities/Note.cs +++ b/invoicedapi/Entities/Note.cs @@ -108,12 +108,12 @@ public bool ShouldSerializeCustomer() public bool ShouldSerializeCustomerId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeInvoiceId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCreatedAt() diff --git a/invoicedapi/Entities/PaymentPlan.cs b/invoicedapi/Entities/PaymentPlan.cs index a0dfdd5..d585b7f 100644 --- a/invoicedapi/Entities/PaymentPlan.cs +++ b/invoicedapi/Entities/PaymentPlan.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeStatus() public bool ShouldSerializeInstallments() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeApproval() diff --git a/invoicedapi/Entities/PendingLineItem.cs b/invoicedapi/Entities/PendingLineItem.cs index 7b69e6d..eb3cd6e 100644 --- a/invoicedapi/Entities/PendingLineItem.cs +++ b/invoicedapi/Entities/PendingLineItem.cs @@ -57,7 +57,7 @@ public bool ShouldSerializeId() public bool ShouldSerializeItem() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } } } \ No newline at end of file diff --git a/invoicedapi/Entities/Plan.cs b/invoicedapi/Entities/Plan.cs index 98c53b3..7832be2 100644 --- a/invoicedapi/Entities/Plan.cs +++ b/invoicedapi/Entities/Plan.cs @@ -55,7 +55,7 @@ public virtual bool HasStringId() // Conditional Serialisation public bool ShouldSerializeId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeObject() @@ -65,42 +65,42 @@ public bool ShouldSerializeObject() public bool ShouldSerializeItem() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCurrency() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeAmount() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializePricingMode() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeQuantityType() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeInterval() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeIntervalCount() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeTiers() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCreatedAt() diff --git a/invoicedapi/Entities/Subscription.cs b/invoicedapi/Entities/Subscription.cs index da74f08..111bde0 100644 --- a/invoicedapi/Entities/Subscription.cs +++ b/invoicedapi/Entities/Subscription.cs @@ -129,7 +129,7 @@ public async Task PreviewAsync() public bool ShouldSerializeId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeObject() @@ -139,27 +139,27 @@ public bool ShouldSerializeObject() public bool ShouldSerializeCustomer() { - return CurrentOperation != "SaveAll"; + return CurrentOperation != nameof(SaveAll) && CurrentOperation != nameof(SaveAllAsync); } public bool ShouldSerializePlan() { - return CurrentOperation != "SaveAll"; + return CurrentOperation != nameof(SaveAll) && CurrentOperation != nameof(SaveAllAsync); } public bool ShouldSerializeCycles() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeStartDate() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeBillIn() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializePeriodStart() @@ -174,7 +174,7 @@ public bool ShouldSerializePeriodEnd() public bool ShouldSerializeCancelAtPeriodEnd() { - return CurrentOperation != "Preview"; + return CurrentOperation != nameof(Preview) && CurrentOperation != nameof(PreviewAsync); } public bool ShouldSerializeCanceledAt() @@ -184,7 +184,7 @@ public bool ShouldSerializeCanceledAt() public bool ShouldSerializePaused() { - return CurrentOperation != "Preview"; + return CurrentOperation != nameof(Preview) && CurrentOperation != nameof(PreviewAsync); } public bool ShouldSerializeStatus() @@ -204,12 +204,12 @@ public bool ShouldSerializeContractPeriodEnd() public bool ShouldSerializeRenewalCycles() { - return CurrentOperation != "Preview"; + return CurrentOperation != nameof(Preview) && CurrentOperation != nameof(PreviewAsync); } public bool ShouldSerializeRenewalMode() { - return CurrentOperation != "Preview"; + return CurrentOperation != nameof(Preview) && CurrentOperation != nameof(PreviewAsync); } public bool ShouldSerializeRecurringTotal() @@ -239,12 +239,12 @@ public bool ShouldSerializeUpdatedAt() public bool ShouldSerializeMetadata() { - return CurrentOperation != "Preview"; + return CurrentOperation != nameof(Preview) && CurrentOperation != nameof(PreviewAsync); } public bool ShouldSerializePendingLineItems() { - return CurrentOperation == "Preview"; + return CurrentOperation == nameof(Preview) || CurrentOperation == nameof(PreviewAsync); } } } \ No newline at end of file diff --git a/invoicedapi/Entities/Task.cs b/invoicedapi/Entities/Task.cs index 310c560..a41a44c 100644 --- a/invoicedapi/Entities/Task.cs +++ b/invoicedapi/Entities/Task.cs @@ -51,7 +51,7 @@ public bool ShouldSerializeId() public bool ShouldSerializeCustomerId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeComplete() diff --git a/invoicedapi/Entities/TaxRate.cs b/invoicedapi/Entities/TaxRate.cs index d065e87..fc82f08 100644 --- a/invoicedapi/Entities/TaxRate.cs +++ b/invoicedapi/Entities/TaxRate.cs @@ -47,7 +47,7 @@ public virtual bool HasStringId() // Conditional Serialisation public bool ShouldSerializeId() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeObject() @@ -57,22 +57,22 @@ public bool ShouldSerializeObject() public bool ShouldSerializeCurrency() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeValue() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeIsPercent() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeInclusive() { - return CurrentOperation == "Create"; + return CurrentOperation == nameof(Create) || CurrentOperation == nameof(CreateAsync); } public bool ShouldSerializeCreatedAt()