From 79e52896b9721eda03807151b15f14faf6f8baad Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Tue, 2 Oct 2018 23:00:45 +0200 Subject: [PATCH] Revamp interfaces on Stripe model classes --- src/Stripe.net/Entities/Accounts/Account.cs | 5 +++- ...AdditionalOwners.cs => AdditionalOwner.cs} | 2 +- .../Entities/Accounts/LegalEntity.cs | 2 +- .../ApplePayDomains/ApplePayDomain.cs | 5 +++- .../ApplicationFeeRefund.cs | 5 +++- .../ApplicationFees/ApplicationFee.cs | 5 +++- src/Stripe.net/Entities/Balance/Balance.cs | 2 +- .../BalanceTransactions/BalanceTransaction.cs | 5 +++- .../BalanceTransactionSource.cs | 5 +++- .../Entities/BankAccounts/BankAccount.cs | 5 +++- src/Stripe.net/Entities/Cards/Card.cs | 5 +++- src/Stripe.net/Entities/Charges/Charge.cs | 5 +++- src/Stripe.net/Entities/Charges/Outcome.cs | 2 +- .../Entities/Charges/OutcomeRule.cs | 5 +++- src/Stripe.net/Entities/Common/Application.cs | 5 +++- .../Entities/Common/PaymentSource.cs | 5 +++- src/Stripe.net/Entities/Common/Review.cs | 5 +++- .../Entities/CountrySpecs/CountrySpec.cs | 5 +++- src/Stripe.net/Entities/Coupons/Coupon.cs | 5 +++- src/Stripe.net/Entities/Customers/Customer.cs | 5 +++- src/Stripe.net/Entities/Discounts/Discount.cs | 2 +- src/Stripe.net/Entities/Disputes/Dispute.cs | 5 +++- .../Entities/EphemeralKeys/EphemeralKey.cs | 5 +++- .../EphemeralkeyAssociatedObject.cs | 5 +++- src/Stripe.net/Entities/Events/Event.cs | 26 ++++--------------- .../Entities/Events/EventRequest.cs | 5 +++- .../Entities/ExchangeRates/ExchangeRate.cs | 5 +++- .../ExternalAccounts/ExternalAccount.cs | 5 +++- src/Stripe.net/Entities/FileLinks/FileLink.cs | 8 +++--- src/Stripe.net/Entities/Files/File.cs | 5 +++- .../Entities/InvoiceItems/InvoiceItem.cs | 5 +++- src/Stripe.net/Entities/Invoices/Invoice.cs | 5 +++- .../Entities/Invoices/InvoiceLineItem.cs | 5 +++- .../Issuing/Authorizations/Authorization.cs | 5 +++- .../Issuing/Cardholders/Cardholder.cs | 5 +++- src/Stripe.net/Entities/Issuing/Cards/Card.cs | 5 +++- .../Entities/Issuing/Cards/CardDetails.cs | 2 +- .../Entities/Issuing/Disputes/Dispute.cs | 5 +++- .../Issuing/Transactions/Transaction.cs | 5 +++- .../Entities/LoginLinks/LoginLink.cs | 2 +- src/Stripe.net/Entities/Orders/Order.cs | 5 +++- src/Stripe.net/Entities/Orders/OrderReturn.cs | 5 +++- .../Entities/Orders/ShippingMethod.cs | 5 +++- .../Entities/PaymentIntents/PaymentIntent.cs | 5 +++- src/Stripe.net/Entities/Payouts/Payout.cs | 5 +++- src/Stripe.net/Entities/Plans/Plan.cs | 5 +++- src/Stripe.net/Entities/Plans/PlanTier.cs | 2 +- .../Entities/Plans/PlanTransformUsage.cs | 2 +- .../Entities/Products/PackageDimensions.cs | 2 +- src/Stripe.net/Entities/Products/Product.cs | 5 +++- .../Entities/Recipients/Recipient.cs | 5 +++- .../Recipients/RecipientActiveAccount.cs | 5 +++- src/Stripe.net/Entities/Refunds/Refund.cs | 5 +++- .../Reporting/ReportRuns/ReportRun.cs | 5 +++- .../Reporting/ReportTypes/ReportType.cs | 5 +++- .../Entities/Sigma/ScheduledQueryRun.cs | 5 +++- src/Stripe.net/Entities/Skus/Sku.cs | 5 +++- .../SourceMandateNotification.cs | 5 +++- .../SourceTransactions/SourceTransaction.cs | 5 +++- src/Stripe.net/Entities/Sources/Source.cs | 5 +++- src/Stripe.net/Entities/StripeList.cs | 2 +- .../SubscriptionItems/SubscriptionItem.cs | 5 +++- .../Entities/Subscriptions/Subscription.cs | 5 +++- .../Entities/ThreeDSecure/ThreeDSecure.cs | 5 +++- src/Stripe.net/Entities/Tokens/Token.cs | 5 +++- src/Stripe.net/Entities/Topups/Topup.cs | 5 +++- .../TransferReversals/TransferReversal.cs | 5 +++- src/Stripe.net/Entities/Transfers/Transfer.cs | 5 +++- .../UsageRecordSummary.cs | 5 +++- .../Entities/UsageRecords/UsageRecord.cs | 5 +++- src/Stripe.net/Entities/_base/StripeEntity.cs | 2 +- .../Entities/_base/StripeEntityWithId.cs | 10 ------- .../Entities/_contracts/ISupportMetadata.cs | 12 --------- src/Stripe.net/Entities/_interfaces/IHasId.cs | 12 +++++++++ .../Entities/_interfaces/IHasObject.cs | 12 +++++++++ .../Entities/_interfaces/IStripeEntity.cs | 12 +++++++++ .../Infrastructure/ParameterBuilder.cs | 2 +- .../Infrastructure/StringOrObject.cs | 7 +++-- .../Services/Account/AccountCardOptions.cs | 2 +- .../Services/Account/AccountSharedOptions.cs | 2 +- .../ApplicationFeeRefundCreateOptions.cs | 2 +- .../ApplicationFeeRefundUpdateOptions.cs | 2 +- .../BankAccounts/BankAccountUpdateOptions.cs | 2 +- .../Services/Cards/CardCreateOptions.cs | 2 +- .../Services/Cards/CardUpdateOptions.cs | 2 +- .../Services/Charges/ChargeCreateOptions.cs | 2 +- .../Services/Charges/ChargeUpdateOptions.cs | 2 +- .../Services/Coupons/CouponCreateOptions.cs | 2 +- .../Services/Coupons/CouponUpdateOptions.cs | 2 +- .../Customers/CustomerCreateOptions.cs | 2 +- .../Customers/CustomerUpdateOptions.cs | 2 +- .../Services/Disputes/DisputeUpdateOptions.cs | 2 +- .../ExternalAccountCardUpdateOptions.cs | 2 +- .../ExternalAccountCreateOptions.cs | 2 +- .../ExternalAccountUpdateOptions.cs | 2 +- .../FileLinks/FileLinkSharedOptions.cs | 2 +- .../InvoiceItems/InvoiceItemCreateOptions.cs | 2 +- .../InvoiceItems/InvoiceItemUpdateOptions.cs | 2 +- .../Services/Invoices/InvoiceCreateOptions.cs | 2 +- .../Services/Invoices/InvoiceUpdateOptions.cs | 2 +- .../AuthorizationUpdateOptions.cs | 2 +- .../Cardholders/CardholderSharedOptions.cs | 2 +- .../Issuing/Cards/CardSharedOptions.cs | 2 +- .../Issuing/Disputes/DisputeSharedOptions.cs | 2 +- .../Transactions/TransactionUpdateOptions.cs | 2 +- .../Services/Orders/OrderCreateOptions.cs | 2 +- .../Services/Orders/OrderPayOptions.cs | 2 +- .../Services/Orders/OrderUpdateOptions.cs | 2 +- .../PaymentIntentSharedOptions.cs | 2 +- .../Services/Payouts/PayoutCreateOptions.cs | 2 +- .../Services/Payouts/PayoutUpdateOptions.cs | 2 +- .../Services/Plans/PlanCreateOptions.cs | 2 +- .../Services/Plans/PlanUpdateOptions.cs | 2 +- .../Products/PlanProductCreateOptions.cs | 2 +- .../Services/Products/ProductSharedOptions.cs | 2 +- .../Services/Refunds/RefundCreateOptions.cs | 2 +- .../Services/Refunds/RefundUpdateOptions.cs | 2 +- src/Stripe.net/Services/Service.cs | 2 +- src/Stripe.net/Services/ServiceNested.cs | 2 +- .../Services/Skus/SkuSharedOptions.cs | 2 +- .../Services/Sources/SourceCreateOptions.cs | 2 +- .../Services/Sources/SourceUpdateOptions.cs | 2 +- .../SubscriptionItemCreateOptions.cs | 2 +- .../SubscriptionItemUpdateOptions.cs | 2 +- .../SubscriptionSharedOptions.cs | 2 +- .../TransferReversalCreateOptions.cs | 2 +- .../TransferReversalUpdateOptions.cs | 2 +- .../Transfers/TransferCreateOptions.cs | 2 +- .../Transfers/TransferUpdateOptions.cs | 2 +- .../Services/_interfaces/ICreatable.cs | 2 +- .../Services/_interfaces/IDeletable.cs | 2 +- .../Services/_interfaces/IListable.cs | 2 +- .../Services/_interfaces/INestedCreatable.cs | 2 +- .../Services/_interfaces/INestedDeletable.cs | 2 +- .../Services/_interfaces/INestedListable.cs | 2 +- .../_interfaces/INestedRetrievable.cs | 2 +- .../Services/_interfaces/INestedUpdatable.cs | 2 +- .../Services/_interfaces/IRetrievable.cs | 2 +- .../_interfaces/ISingletonRetrievable.cs | 2 +- .../Services/_interfaces/IUpdatable.cs | 2 +- .../_refactor/CardCreateNestedOptions.cs | 2 +- .../Services/_refactor/SourceBankAccount.cs | 2 +- 142 files changed, 355 insertions(+), 183 deletions(-) rename src/Stripe.net/Entities/Accounts/{AdditionalOwners.cs => AdditionalOwner.cs} (93%) delete mode 100644 src/Stripe.net/Entities/_base/StripeEntityWithId.cs delete mode 100644 src/Stripe.net/Entities/_contracts/ISupportMetadata.cs create mode 100644 src/Stripe.net/Entities/_interfaces/IHasId.cs create mode 100644 src/Stripe.net/Entities/_interfaces/IHasObject.cs create mode 100644 src/Stripe.net/Entities/_interfaces/IStripeEntity.cs diff --git a/src/Stripe.net/Entities/Accounts/Account.cs b/src/Stripe.net/Entities/Accounts/Account.cs index 9ac33e103d..007c09cb5c 100644 --- a/src/Stripe.net/Entities/Accounts/Account.cs +++ b/src/Stripe.net/Entities/Accounts/Account.cs @@ -6,8 +6,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Account : StripeEntityWithId, ISupportMetadata + public class Account : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Accounts/AdditionalOwners.cs b/src/Stripe.net/Entities/Accounts/AdditionalOwner.cs similarity index 93% rename from src/Stripe.net/Entities/Accounts/AdditionalOwners.cs rename to src/Stripe.net/Entities/Accounts/AdditionalOwner.cs index 20e4afdb81..a13c6aaf02 100644 --- a/src/Stripe.net/Entities/Accounts/AdditionalOwners.cs +++ b/src/Stripe.net/Entities/Accounts/AdditionalOwner.cs @@ -2,7 +2,7 @@ namespace Stripe { using Newtonsoft.Json; - public class AdditionalOwners : StripeEntity + public class AdditionalOwner : StripeEntity { [JsonProperty("address")] public Address Address { get; set; } diff --git a/src/Stripe.net/Entities/Accounts/LegalEntity.cs b/src/Stripe.net/Entities/Accounts/LegalEntity.cs index bc7aadafd5..a59a3ebc92 100644 --- a/src/Stripe.net/Entities/Accounts/LegalEntity.cs +++ b/src/Stripe.net/Entities/Accounts/LegalEntity.cs @@ -6,7 +6,7 @@ namespace Stripe public class LegalEntity : StripeEntity { [JsonProperty("additional_owners")] - public List AdditionalOwners { get; set; } + public List AdditionalOwners { get; set; } [JsonProperty("address")] public Address Address { get; set; } diff --git a/src/Stripe.net/Entities/ApplePayDomains/ApplePayDomain.cs b/src/Stripe.net/Entities/ApplePayDomains/ApplePayDomain.cs index 781c3dafc5..afc442d985 100644 --- a/src/Stripe.net/Entities/ApplePayDomains/ApplePayDomain.cs +++ b/src/Stripe.net/Entities/ApplePayDomains/ApplePayDomain.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class ApplePayDomain : StripeEntityWithId + public class ApplePayDomain : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/ApplicationFeeRefunds/ApplicationFeeRefund.cs b/src/Stripe.net/Entities/ApplicationFeeRefunds/ApplicationFeeRefund.cs index c47e1e4f1a..2bdf27da9f 100644 --- a/src/Stripe.net/Entities/ApplicationFeeRefunds/ApplicationFeeRefund.cs +++ b/src/Stripe.net/Entities/ApplicationFeeRefunds/ApplicationFeeRefund.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class ApplicationFeeRefund : StripeEntityWithId, ISupportMetadata + public class ApplicationFeeRefund : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/ApplicationFees/ApplicationFee.cs b/src/Stripe.net/Entities/ApplicationFees/ApplicationFee.cs index 11d8870e64..ebad640936 100644 --- a/src/Stripe.net/Entities/ApplicationFees/ApplicationFee.cs +++ b/src/Stripe.net/Entities/ApplicationFees/ApplicationFee.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class ApplicationFee : StripeEntityWithId + public class ApplicationFee : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Balance/Balance.cs b/src/Stripe.net/Entities/Balance/Balance.cs index 071b2ac47a..797d4dd21a 100644 --- a/src/Stripe.net/Entities/Balance/Balance.cs +++ b/src/Stripe.net/Entities/Balance/Balance.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class Balance : StripeEntity + public class Balance : StripeEntity, IHasObject { [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs b/src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs index 4b5fcef147..b78401552f 100644 --- a/src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs +++ b/src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class BalanceTransaction : StripeEntityWithId + public class BalanceTransaction : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/BalanceTransactions/BalanceTransactionSource.cs b/src/Stripe.net/Entities/BalanceTransactions/BalanceTransactionSource.cs index a4d859117d..a2459c4f3f 100644 --- a/src/Stripe.net/Entities/BalanceTransactions/BalanceTransactionSource.cs +++ b/src/Stripe.net/Entities/BalanceTransactions/BalanceTransactionSource.cs @@ -19,8 +19,11 @@ public enum BalanceTransactionSourceType } [JsonConverter(typeof(BalanceTransactionSourceConverter))] - public class BalanceTransactionSource : StripeEntityWithId + public class BalanceTransactionSource : StripeEntity, IHasId { + [JsonProperty("id")] + public string Id { get; set; } + public BalanceTransactionSourceType Type { get; set; } public ApplicationFee ApplicationFee { get; set; } diff --git a/src/Stripe.net/Entities/BankAccounts/BankAccount.cs b/src/Stripe.net/Entities/BankAccounts/BankAccount.cs index 315fd2b409..5b707bd320 100644 --- a/src/Stripe.net/Entities/BankAccounts/BankAccount.cs +++ b/src/Stripe.net/Entities/BankAccounts/BankAccount.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class BankAccount : StripeEntityWithId, ISupportMetadata + public class BankAccount : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Cards/Card.cs b/src/Stripe.net/Entities/Cards/Card.cs index a88455f148..5af6d82c78 100644 --- a/src/Stripe.net/Entities/Cards/Card.cs +++ b/src/Stripe.net/Entities/Cards/Card.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Card : StripeEntityWithId, ISupportMetadata + public class Card : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Charges/Charge.cs b/src/Stripe.net/Entities/Charges/Charge.cs index c40654988b..4e3a648c8a 100644 --- a/src/Stripe.net/Entities/Charges/Charge.cs +++ b/src/Stripe.net/Entities/Charges/Charge.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Charge : StripeEntityWithId, ISupportMetadata + public class Charge : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Charges/Outcome.cs b/src/Stripe.net/Entities/Charges/Outcome.cs index c1ff053b31..fbdfce4ea3 100644 --- a/src/Stripe.net/Entities/Charges/Outcome.cs +++ b/src/Stripe.net/Entities/Charges/Outcome.cs @@ -3,7 +3,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Outcome : StripeEntityWithId + public class Outcome : StripeEntity { /// /// Possible values are approved_by_network, declined_by_network, not_sent_to_network, and reversed_after_approval. The value reversed_after_approval indicates the payment was blocked by Stripe after bank authorization, and may temporarily appear as “pending” on a cardholder’s statement. diff --git a/src/Stripe.net/Entities/Charges/OutcomeRule.cs b/src/Stripe.net/Entities/Charges/OutcomeRule.cs index 721f045def..9137a9cfa7 100644 --- a/src/Stripe.net/Entities/Charges/OutcomeRule.cs +++ b/src/Stripe.net/Entities/Charges/OutcomeRule.cs @@ -2,8 +2,11 @@ namespace Stripe { using Newtonsoft.Json; - public class OutcomeRule : StripeEntityWithId + public class OutcomeRule : StripeEntity, IHasId { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("action")] public string Action { get; set; } diff --git a/src/Stripe.net/Entities/Common/Application.cs b/src/Stripe.net/Entities/Common/Application.cs index a1057ddece..2c86c0dd95 100644 --- a/src/Stripe.net/Entities/Common/Application.cs +++ b/src/Stripe.net/Entities/Common/Application.cs @@ -2,8 +2,11 @@ namespace Stripe { using Newtonsoft.Json; - public class Application : StripeEntityWithId + public class Application : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Common/PaymentSource.cs b/src/Stripe.net/Entities/Common/PaymentSource.cs index b51b71325d..cde0aa5ad4 100644 --- a/src/Stripe.net/Entities/Common/PaymentSource.cs +++ b/src/Stripe.net/Entities/Common/PaymentSource.cs @@ -12,8 +12,11 @@ public enum PaymentSourceType } [JsonConverter(typeof(PaymentSourceConverter))] - public class PaymentSource : StripeEntityWithId + public class PaymentSource : StripeEntity, IHasId { + [JsonProperty("id")] + public string Id { get; set; } + public PaymentSourceType Type { get; set; } public Account Account { get; set; } diff --git a/src/Stripe.net/Entities/Common/Review.cs b/src/Stripe.net/Entities/Common/Review.cs index 97e5a08640..b2c15a5b7e 100644 --- a/src/Stripe.net/Entities/Common/Review.cs +++ b/src/Stripe.net/Entities/Common/Review.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Review : StripeEntityWithId + public class Review : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/CountrySpecs/CountrySpec.cs b/src/Stripe.net/Entities/CountrySpecs/CountrySpec.cs index 499994c6dc..28e517e26a 100644 --- a/src/Stripe.net/Entities/CountrySpecs/CountrySpec.cs +++ b/src/Stripe.net/Entities/CountrySpecs/CountrySpec.cs @@ -3,8 +3,11 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CountrySpec : StripeEntityWithId + public class CountrySpec : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Coupons/Coupon.cs b/src/Stripe.net/Entities/Coupons/Coupon.cs index 4275ca419a..a40b9d0d50 100644 --- a/src/Stripe.net/Entities/Coupons/Coupon.cs +++ b/src/Stripe.net/Entities/Coupons/Coupon.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Coupon : StripeEntityWithId, ISupportMetadata + public class Coupon : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Customers/Customer.cs b/src/Stripe.net/Entities/Customers/Customer.cs index 0d738a05d9..39c31b89c3 100644 --- a/src/Stripe.net/Entities/Customers/Customer.cs +++ b/src/Stripe.net/Entities/Customers/Customer.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Customer : StripeEntityWithId, ISupportMetadata + public class Customer : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Discounts/Discount.cs b/src/Stripe.net/Entities/Discounts/Discount.cs index 833399de90..c423cd59b5 100644 --- a/src/Stripe.net/Entities/Discounts/Discount.cs +++ b/src/Stripe.net/Entities/Discounts/Discount.cs @@ -4,7 +4,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Discount : StripeEntityWithId + public class Discount : StripeEntity, IHasObject { [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Disputes/Dispute.cs b/src/Stripe.net/Entities/Disputes/Dispute.cs index e63b745c83..74a6042fa2 100644 --- a/src/Stripe.net/Entities/Disputes/Dispute.cs +++ b/src/Stripe.net/Entities/Disputes/Dispute.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Dispute : StripeEntityWithId, ISupportMetadata + public class Dispute : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/EphemeralKeys/EphemeralKey.cs b/src/Stripe.net/Entities/EphemeralKeys/EphemeralKey.cs index 11ed898875..3c40cd11df 100644 --- a/src/Stripe.net/Entities/EphemeralKeys/EphemeralKey.cs +++ b/src/Stripe.net/Entities/EphemeralKeys/EphemeralKey.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class EphemeralKey : StripeEntityWithId + public class EphemeralKey : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/EphemeralKeys/EphemeralkeyAssociatedObject.cs b/src/Stripe.net/Entities/EphemeralKeys/EphemeralkeyAssociatedObject.cs index 776b63c220..1265dcde33 100644 --- a/src/Stripe.net/Entities/EphemeralKeys/EphemeralkeyAssociatedObject.cs +++ b/src/Stripe.net/Entities/EphemeralKeys/EphemeralkeyAssociatedObject.cs @@ -2,8 +2,11 @@ namespace Stripe { using Newtonsoft.Json; - public class EphemeralKeyAssociatedObject : StripeEntityWithId + public class EphemeralKeyAssociatedObject : StripeEntity { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("type")] public string Type { get; set; } } diff --git a/src/Stripe.net/Entities/Events/Event.cs b/src/Stripe.net/Entities/Events/Event.cs index 43e9ab8ed0..b48b0cfcaa 100644 --- a/src/Stripe.net/Entities/Events/Event.cs +++ b/src/Stripe.net/Entities/Events/Event.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Event : StripeEntityWithId + public class Event : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } @@ -27,27 +30,8 @@ public class Event : StripeEntityWithId [JsonProperty("pending_webhooks")] public int PendingWebhooks { get; set; } - #region Request - - /* - * This works like expandable properties. it's used for the event having just a string for the request id or - * the Request object for requests after the 2017-05-25 api release - */ - - public string RequestId { get; set; } - - [JsonIgnore] - public EventRequest Request { get; set; } - [JsonProperty("request")] - internal object InternalRequest - { - set - { - StringOrObject.Map(value, s => this.RequestId = s, o => this.Request = o); - } - } - #endregion + public EventRequest Request { get; set; } [JsonProperty("type")] public string Type { get; set; } diff --git a/src/Stripe.net/Entities/Events/EventRequest.cs b/src/Stripe.net/Entities/Events/EventRequest.cs index be0fcf6b03..5a603760bb 100644 --- a/src/Stripe.net/Entities/Events/EventRequest.cs +++ b/src/Stripe.net/Entities/Events/EventRequest.cs @@ -2,8 +2,11 @@ namespace Stripe { using Newtonsoft.Json; - public class EventRequest : StripeEntityWithId + public class EventRequest : StripeEntity { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("idempotency_key")] public string IdempotencyKey { get; set; } } diff --git a/src/Stripe.net/Entities/ExchangeRates/ExchangeRate.cs b/src/Stripe.net/Entities/ExchangeRates/ExchangeRate.cs index 3c42a6b1e9..2cf3b9e196 100644 --- a/src/Stripe.net/Entities/ExchangeRates/ExchangeRate.cs +++ b/src/Stripe.net/Entities/ExchangeRates/ExchangeRate.cs @@ -3,8 +3,11 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ExchangeRate : StripeEntityWithId + public class ExchangeRate : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/ExternalAccounts/ExternalAccount.cs b/src/Stripe.net/Entities/ExternalAccounts/ExternalAccount.cs index a28580b2c7..2daa7aadf8 100644 --- a/src/Stripe.net/Entities/ExternalAccounts/ExternalAccount.cs +++ b/src/Stripe.net/Entities/ExternalAccounts/ExternalAccount.cs @@ -10,8 +10,11 @@ public enum ExternalAccountType } [JsonConverter(typeof(ExternalAccountConverter))] - public class ExternalAccount : StripeEntityWithId + public class ExternalAccount : StripeEntity, IHasId { + [JsonProperty("id")] + public string Id { get; set; } + public ExternalAccountType Type { get; set; } public Card Card { get; set; } diff --git a/src/Stripe.net/Entities/FileLinks/FileLink.cs b/src/Stripe.net/Entities/FileLinks/FileLink.cs index 92e5f02c01..09e60dc6fe 100644 --- a/src/Stripe.net/Entities/FileLinks/FileLink.cs +++ b/src/Stripe.net/Entities/FileLinks/FileLink.cs @@ -5,11 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class FileLink : StripeEntityWithId, ISupportMetadata + public class FileLink : StripeEntity, IHasId, IHasObject { - /// - /// String representing the object’s type. Objects of the same type share the same value. - /// + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Files/File.cs b/src/Stripe.net/Entities/Files/File.cs index 2a2f04fa58..5843c521de 100644 --- a/src/Stripe.net/Entities/Files/File.cs +++ b/src/Stripe.net/Entities/Files/File.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class File : StripeEntityWithId + public class File : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs b/src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs index ad9d0ed112..066f231d09 100644 --- a/src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs +++ b/src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class InvoiceItem : StripeEntityWithId, ISupportMetadata + public class InvoiceItem : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Invoices/Invoice.cs b/src/Stripe.net/Entities/Invoices/Invoice.cs index 7a0daeace6..5f321955c5 100644 --- a/src/Stripe.net/Entities/Invoices/Invoice.cs +++ b/src/Stripe.net/Entities/Invoices/Invoice.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Invoice : StripeEntityWithId, ISupportMetadata + public class Invoice : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Invoices/InvoiceLineItem.cs b/src/Stripe.net/Entities/Invoices/InvoiceLineItem.cs index 804e8672d5..3a8cceeff1 100644 --- a/src/Stripe.net/Entities/Invoices/InvoiceLineItem.cs +++ b/src/Stripe.net/Entities/Invoices/InvoiceLineItem.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class InvoiceLineItem : StripeEntityWithId, ISupportMetadata + public class InvoiceLineItem : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Authorizations/Authorization.cs b/src/Stripe.net/Entities/Issuing/Authorizations/Authorization.cs index 10a5e5961a..d6dcf6890e 100644 --- a/src/Stripe.net/Entities/Issuing/Authorizations/Authorization.cs +++ b/src/Stripe.net/Entities/Issuing/Authorizations/Authorization.cs @@ -5,8 +5,11 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class Authorization : StripeEntityWithId, ISupportMetadata + public class Authorization : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs b/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs index 36364aa146..93ecb7e141 100644 --- a/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs +++ b/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs @@ -5,8 +5,11 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class Cardholder : StripeEntityWithId, ISupportMetadata + public class Cardholder : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Cards/Card.cs b/src/Stripe.net/Entities/Issuing/Cards/Card.cs index 3166043f35..47be5b0efb 100644 --- a/src/Stripe.net/Entities/Issuing/Cards/Card.cs +++ b/src/Stripe.net/Entities/Issuing/Cards/Card.cs @@ -5,8 +5,11 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class Card : StripeEntityWithId, ISupportMetadata + public class Card : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Cards/CardDetails.cs b/src/Stripe.net/Entities/Issuing/Cards/CardDetails.cs index 0605e0e650..248b16f9d6 100644 --- a/src/Stripe.net/Entities/Issuing/Cards/CardDetails.cs +++ b/src/Stripe.net/Entities/Issuing/Cards/CardDetails.cs @@ -5,7 +5,7 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class CardDetails : StripeEntity + public class CardDetails : StripeEntity, IHasObject { [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs b/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs index 767fd27e1a..9e0ebbfcb3 100644 --- a/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs +++ b/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs @@ -5,8 +5,11 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class Dispute : StripeEntityWithId, ISupportMetadata + public class Dispute : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Issuing/Transactions/Transaction.cs b/src/Stripe.net/Entities/Issuing/Transactions/Transaction.cs index 7e83bb492f..a50350c1e2 100644 --- a/src/Stripe.net/Entities/Issuing/Transactions/Transaction.cs +++ b/src/Stripe.net/Entities/Issuing/Transactions/Transaction.cs @@ -5,8 +5,11 @@ namespace Stripe.Issuing using Newtonsoft.Json; using Stripe.Infrastructure; - public class Transaction : StripeEntityWithId, ISupportMetadata + public class Transaction : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/LoginLinks/LoginLink.cs b/src/Stripe.net/Entities/LoginLinks/LoginLink.cs index 691af81bd3..50606f1734 100644 --- a/src/Stripe.net/Entities/LoginLinks/LoginLink.cs +++ b/src/Stripe.net/Entities/LoginLinks/LoginLink.cs @@ -4,7 +4,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class LoginLink : StripeEntity + public class LoginLink : StripeEntity, IHasObject { [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Orders/Order.cs b/src/Stripe.net/Entities/Orders/Order.cs index f1dcf23441..baa0fa9627 100644 --- a/src/Stripe.net/Entities/Orders/Order.cs +++ b/src/Stripe.net/Entities/Orders/Order.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Order : StripeEntityWithId, ISupportMetadata + public class Order : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Orders/OrderReturn.cs b/src/Stripe.net/Entities/Orders/OrderReturn.cs index 4fea47f322..c0707520d7 100644 --- a/src/Stripe.net/Entities/Orders/OrderReturn.cs +++ b/src/Stripe.net/Entities/Orders/OrderReturn.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class OrderReturn : StripeEntityWithId + public class OrderReturn : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Orders/ShippingMethod.cs b/src/Stripe.net/Entities/Orders/ShippingMethod.cs index 4c1625297f..6b04bc7a16 100644 --- a/src/Stripe.net/Entities/Orders/ShippingMethod.cs +++ b/src/Stripe.net/Entities/Orders/ShippingMethod.cs @@ -2,8 +2,11 @@ namespace Stripe { using Newtonsoft.Json; - public class ShippingMethod : StripeEntityWithId + public class ShippingMethod : StripeEntity { + [JsonProperty("id")] + public string Id { get; set; } + /// /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a 0-decimal currency) representing the total amount for the line item. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs index 1fdaca0342..bff53cbbff 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class PaymentIntent : StripeEntityWithId, ISupportMetadata + public class PaymentIntent : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Payouts/Payout.cs b/src/Stripe.net/Entities/Payouts/Payout.cs index d6f7143434..d898a6ed51 100644 --- a/src/Stripe.net/Entities/Payouts/Payout.cs +++ b/src/Stripe.net/Entities/Payouts/Payout.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Payout : StripeEntityWithId, ISupportMetadata + public class Payout : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Plans/Plan.cs b/src/Stripe.net/Entities/Plans/Plan.cs index de7afd940f..ec18a32ce1 100644 --- a/src/Stripe.net/Entities/Plans/Plan.cs +++ b/src/Stripe.net/Entities/Plans/Plan.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Plan : StripeEntityWithId, ISupportMetadata + public class Plan : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Plans/PlanTier.cs b/src/Stripe.net/Entities/Plans/PlanTier.cs index 586ece2a1c..3ce8e0305c 100644 --- a/src/Stripe.net/Entities/Plans/PlanTier.cs +++ b/src/Stripe.net/Entities/Plans/PlanTier.cs @@ -2,7 +2,7 @@ namespace Stripe { using Newtonsoft.Json; - public class PlanTier + public class PlanTier : StripeEntity { [JsonProperty("unit_amount")] public int UnitAmount { get; set; } diff --git a/src/Stripe.net/Entities/Plans/PlanTransformUsage.cs b/src/Stripe.net/Entities/Plans/PlanTransformUsage.cs index 5095df5fad..39aaec7645 100644 --- a/src/Stripe.net/Entities/Plans/PlanTransformUsage.cs +++ b/src/Stripe.net/Entities/Plans/PlanTransformUsage.cs @@ -2,7 +2,7 @@ namespace Stripe { using Newtonsoft.Json; - public class PlanTransformUsage + public class PlanTransformUsage : StripeEntity { [JsonProperty("divide_by")] public int DivideBy { get; set; } diff --git a/src/Stripe.net/Entities/Products/PackageDimensions.cs b/src/Stripe.net/Entities/Products/PackageDimensions.cs index 3778ff9520..ca7e8486be 100644 --- a/src/Stripe.net/Entities/Products/PackageDimensions.cs +++ b/src/Stripe.net/Entities/Products/PackageDimensions.cs @@ -3,7 +3,7 @@ namespace Stripe using System; using Newtonsoft.Json; - public class PackageDimensions + public class PackageDimensions : StripeEntity { [JsonProperty("height")] public decimal? Height { get; set; } diff --git a/src/Stripe.net/Entities/Products/Product.cs b/src/Stripe.net/Entities/Products/Product.cs index a6ac9d742b..40c25141ff 100644 --- a/src/Stripe.net/Entities/Products/Product.cs +++ b/src/Stripe.net/Entities/Products/Product.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Product : StripeEntityWithId, ISupportMetadata + public class Product : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Recipients/Recipient.cs b/src/Stripe.net/Entities/Recipients/Recipient.cs index 1171cd3fd1..c5fe926a39 100644 --- a/src/Stripe.net/Entities/Recipients/Recipient.cs +++ b/src/Stripe.net/Entities/Recipients/Recipient.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Recipient : StripeEntityWithId, ISupportMetadata + public class Recipient : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Recipients/RecipientActiveAccount.cs b/src/Stripe.net/Entities/Recipients/RecipientActiveAccount.cs index 4c60f9ded8..3b1d00884d 100644 --- a/src/Stripe.net/Entities/Recipients/RecipientActiveAccount.cs +++ b/src/Stripe.net/Entities/Recipients/RecipientActiveAccount.cs @@ -3,8 +3,11 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class RecipientActiveAccount : StripeEntityWithId, ISupportMetadata + public class RecipientActiveAccount : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Refunds/Refund.cs b/src/Stripe.net/Entities/Refunds/Refund.cs index 3e1a2f3732..f011a14d85 100644 --- a/src/Stripe.net/Entities/Refunds/Refund.cs +++ b/src/Stripe.net/Entities/Refunds/Refund.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Refund : StripeEntityWithId, ISupportMetadata + public class Refund : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Reporting/ReportRuns/ReportRun.cs b/src/Stripe.net/Entities/Reporting/ReportRuns/ReportRun.cs index 3a060358dc..6bb906b100 100644 --- a/src/Stripe.net/Entities/Reporting/ReportRuns/ReportRun.cs +++ b/src/Stripe.net/Entities/Reporting/ReportRuns/ReportRun.cs @@ -5,8 +5,11 @@ namespace Stripe.Reporting using Newtonsoft.Json; using Stripe.Infrastructure; - public class ReportRun : StripeEntityWithId + public class ReportRun : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Reporting/ReportTypes/ReportType.cs b/src/Stripe.net/Entities/Reporting/ReportTypes/ReportType.cs index 7c0a1f62ee..d9b249d3dd 100644 --- a/src/Stripe.net/Entities/Reporting/ReportTypes/ReportType.cs +++ b/src/Stripe.net/Entities/Reporting/ReportTypes/ReportType.cs @@ -5,8 +5,11 @@ namespace Stripe.Reporting using Newtonsoft.Json; using Stripe.Infrastructure; - public class ReportType : StripeEntityWithId + public class ReportType : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Sigma/ScheduledQueryRun.cs b/src/Stripe.net/Entities/Sigma/ScheduledQueryRun.cs index 76b80b94dc..bd27baa014 100644 --- a/src/Stripe.net/Entities/Sigma/ScheduledQueryRun.cs +++ b/src/Stripe.net/Entities/Sigma/ScheduledQueryRun.cs @@ -4,8 +4,11 @@ namespace Stripe.Sigma using Newtonsoft.Json; using Stripe.Infrastructure; - public class ScheduledQueryRun : StripeEntityWithId + public class ScheduledQueryRun : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Skus/Sku.cs b/src/Stripe.net/Entities/Skus/Sku.cs index 58aa2d0646..e32a0d3e88 100644 --- a/src/Stripe.net/Entities/Skus/Sku.cs +++ b/src/Stripe.net/Entities/Skus/Sku.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Sku : StripeEntityWithId, ISupportMetadata + public class Sku : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/SourceMandateNotifications/SourceMandateNotification.cs b/src/Stripe.net/Entities/SourceMandateNotifications/SourceMandateNotification.cs index 6900d6de51..5ff7b32298 100644 --- a/src/Stripe.net/Entities/SourceMandateNotifications/SourceMandateNotification.cs +++ b/src/Stripe.net/Entities/SourceMandateNotifications/SourceMandateNotification.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SourceMandateNotification : StripeEntityWithId + public class SourceMandateNotification : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/SourceTransactions/SourceTransaction.cs b/src/Stripe.net/Entities/SourceTransactions/SourceTransaction.cs index e806a1d632..9fb9eb4206 100644 --- a/src/Stripe.net/Entities/SourceTransactions/SourceTransaction.cs +++ b/src/Stripe.net/Entities/SourceTransactions/SourceTransaction.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SourceTransaction : StripeEntityWithId + public class SourceTransaction : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Sources/Source.cs b/src/Stripe.net/Entities/Sources/Source.cs index cca535250f..0867d2f1d7 100644 --- a/src/Stripe.net/Entities/Sources/Source.cs +++ b/src/Stripe.net/Entities/Sources/Source.cs @@ -8,8 +8,11 @@ namespace Stripe /// /// Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument and can be used with the Source API just like a card object: once chargeable, they can be charged, or attached to customers. /// - public class Source : StripeEntityWithId, ISupportMetadata + public class Source : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/StripeList.cs b/src/Stripe.net/Entities/StripeList.cs index 2a56a8d1f6..79e039164f 100644 --- a/src/Stripe.net/Entities/StripeList.cs +++ b/src/Stripe.net/Entities/StripeList.cs @@ -6,7 +6,7 @@ namespace Stripe using Newtonsoft.Json; [JsonObject] - public class StripeList : StripeEntity, IEnumerable + public class StripeList : StripeEntity, IHasObject, IEnumerable { [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/SubscriptionItems/SubscriptionItem.cs b/src/Stripe.net/Entities/SubscriptionItems/SubscriptionItem.cs index f742037aa7..604898662f 100644 --- a/src/Stripe.net/Entities/SubscriptionItems/SubscriptionItem.cs +++ b/src/Stripe.net/Entities/SubscriptionItems/SubscriptionItem.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SubscriptionItem : StripeEntityWithId, ISupportMetadata + public class SubscriptionItem : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Subscriptions/Subscription.cs b/src/Stripe.net/Entities/Subscriptions/Subscription.cs index 29b03ab1dd..7a4e6bad6a 100644 --- a/src/Stripe.net/Entities/Subscriptions/Subscription.cs +++ b/src/Stripe.net/Entities/Subscriptions/Subscription.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Subscription : StripeEntityWithId, ISupportMetadata + public class Subscription : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/ThreeDSecure/ThreeDSecure.cs b/src/Stripe.net/Entities/ThreeDSecure/ThreeDSecure.cs index 4a57d24b5e..fd051ae9c6 100644 --- a/src/Stripe.net/Entities/ThreeDSecure/ThreeDSecure.cs +++ b/src/Stripe.net/Entities/ThreeDSecure/ThreeDSecure.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class ThreeDSecure : StripeEntityWithId + public class ThreeDSecure : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Tokens/Token.cs b/src/Stripe.net/Entities/Tokens/Token.cs index 5ecf8d9c0a..43d3e46369 100644 --- a/src/Stripe.net/Entities/Tokens/Token.cs +++ b/src/Stripe.net/Entities/Tokens/Token.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Token : StripeEntityWithId + public class Token : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Topups/Topup.cs b/src/Stripe.net/Entities/Topups/Topup.cs index 5c30258510..a47fe2ef42 100644 --- a/src/Stripe.net/Entities/Topups/Topup.cs +++ b/src/Stripe.net/Entities/Topups/Topup.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Topup : StripeEntityWithId + public class Topup : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/TransferReversals/TransferReversal.cs b/src/Stripe.net/Entities/TransferReversals/TransferReversal.cs index 2e72569c1d..eb24387b11 100644 --- a/src/Stripe.net/Entities/TransferReversals/TransferReversal.cs +++ b/src/Stripe.net/Entities/TransferReversals/TransferReversal.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class TransferReversal : StripeEntityWithId, ISupportMetadata + public class TransferReversal : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/Transfers/Transfer.cs b/src/Stripe.net/Entities/Transfers/Transfer.cs index 5c4300d03e..6f330b5877 100644 --- a/src/Stripe.net/Entities/Transfers/Transfer.cs +++ b/src/Stripe.net/Entities/Transfers/Transfer.cs @@ -5,8 +5,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class Transfer : StripeEntityWithId, ISupportMetadata + public class Transfer : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/UsageRecordSummaries/UsageRecordSummary.cs b/src/Stripe.net/Entities/UsageRecordSummaries/UsageRecordSummary.cs index 5ff54d50ca..31b31dccbc 100644 --- a/src/Stripe.net/Entities/UsageRecordSummaries/UsageRecordSummary.cs +++ b/src/Stripe.net/Entities/UsageRecordSummaries/UsageRecordSummary.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class UsageRecordSummary : StripeEntityWithId + public class UsageRecordSummary : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/UsageRecords/UsageRecord.cs b/src/Stripe.net/Entities/UsageRecords/UsageRecord.cs index 1da42d830c..20ff00a15a 100644 --- a/src/Stripe.net/Entities/UsageRecords/UsageRecord.cs +++ b/src/Stripe.net/Entities/UsageRecords/UsageRecord.cs @@ -4,8 +4,11 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class UsageRecord : StripeEntityWithId + public class UsageRecord : StripeEntity, IHasId, IHasObject { + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("object")] public string Object { get; set; } diff --git a/src/Stripe.net/Entities/_base/StripeEntity.cs b/src/Stripe.net/Entities/_base/StripeEntity.cs index bf1975efc1..2763fcd82a 100644 --- a/src/Stripe.net/Entities/_base/StripeEntity.cs +++ b/src/Stripe.net/Entities/_base/StripeEntity.cs @@ -1,6 +1,6 @@ namespace Stripe { - public abstract class StripeEntity + public abstract class StripeEntity : IStripeEntity { public StripeResponse StripeResponse { get; set; } } diff --git a/src/Stripe.net/Entities/_base/StripeEntityWithId.cs b/src/Stripe.net/Entities/_base/StripeEntityWithId.cs deleted file mode 100644 index d946e33d43..0000000000 --- a/src/Stripe.net/Entities/_base/StripeEntityWithId.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Stripe -{ - using Newtonsoft.Json; - - public abstract class StripeEntityWithId : StripeEntity - { - [JsonProperty("id")] - public string Id { get; set; } - } -} diff --git a/src/Stripe.net/Entities/_contracts/ISupportMetadata.cs b/src/Stripe.net/Entities/_contracts/ISupportMetadata.cs deleted file mode 100644 index d02e075b83..0000000000 --- a/src/Stripe.net/Entities/_contracts/ISupportMetadata.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Stripe -{ - using System.Collections.Generic; - - /// - /// Interface that identifies entities with a Metadata property of type . - /// - public interface ISupportMetadata - { - Dictionary Metadata { get; set; } - } -} diff --git a/src/Stripe.net/Entities/_interfaces/IHasId.cs b/src/Stripe.net/Entities/_interfaces/IHasId.cs new file mode 100644 index 0000000000..ef026b7878 --- /dev/null +++ b/src/Stripe.net/Entities/_interfaces/IHasId.cs @@ -0,0 +1,12 @@ +namespace Stripe +{ + using System.Collections.Generic; + + /// + /// Interface that identifies entities returned by Stripe that have an `id` attribute. + /// + public interface IHasId + { + string Id { get; set; } + } +} diff --git a/src/Stripe.net/Entities/_interfaces/IHasObject.cs b/src/Stripe.net/Entities/_interfaces/IHasObject.cs new file mode 100644 index 0000000000..3e29d8b73d --- /dev/null +++ b/src/Stripe.net/Entities/_interfaces/IHasObject.cs @@ -0,0 +1,12 @@ +namespace Stripe +{ + using System.Collections.Generic; + + /// + /// Interface that identifies entities returned by Stripe that have an `object` attribute. + /// + public interface IHasObject + { + string Object { get; set; } + } +} diff --git a/src/Stripe.net/Entities/_interfaces/IStripeEntity.cs b/src/Stripe.net/Entities/_interfaces/IStripeEntity.cs new file mode 100644 index 0000000000..158151c6f7 --- /dev/null +++ b/src/Stripe.net/Entities/_interfaces/IStripeEntity.cs @@ -0,0 +1,12 @@ +namespace Stripe +{ + using System.Collections.Generic; + + /// + /// Interface that identifies all entities returned by Stripe. + /// + public interface IStripeEntity + { + StripeResponse StripeResponse { get; set; } + } +} diff --git a/src/Stripe.net/Infrastructure/ParameterBuilder.cs b/src/Stripe.net/Infrastructure/ParameterBuilder.cs index 4a890dddae..0fbe45c1dd 100644 --- a/src/Stripe.net/Infrastructure/ParameterBuilder.cs +++ b/src/Stripe.net/Infrastructure/ParameterBuilder.cs @@ -10,7 +10,7 @@ namespace Stripe.Infrastructure internal static class ParameterBuilder { public static string ApplyAllParameters(this Service service, BaseOptions obj, string url, bool isListMethod = false) - where T : StripeEntity + where T : IStripeEntity { // store the original url from the service call into requestString (e.g. https://api.stripe.com/v1/accounts/account_id) // before the stripe attributes get applied. all of the attributes that will get passed to stripe will be applied to this string, diff --git a/src/Stripe.net/Infrastructure/StringOrObject.cs b/src/Stripe.net/Infrastructure/StringOrObject.cs index cd6b777b91..32d53349a1 100644 --- a/src/Stripe.net/Infrastructure/StringOrObject.cs +++ b/src/Stripe.net/Infrastructure/StringOrObject.cs @@ -4,7 +4,7 @@ namespace Stripe.Infrastructure using Newtonsoft.Json.Linq; internal static class StringOrObject - where T : StripeEntityWithId + where T : IHasId { public static void Map(object value, Action updateId, Action updateObject) { @@ -22,7 +22,10 @@ public static void Map(object value, Action updateId, Action updateOb else if (value is string) { updateId((string)value); - updateObject(null); + + // The default value for a reference type is null, but `T` is constrained to an + // interface here so we have to use `default(T)`. + updateObject(default(T)); } } } diff --git a/src/Stripe.net/Services/Account/AccountCardOptions.cs b/src/Stripe.net/Services/Account/AccountCardOptions.cs index a4e419cd2a..d5174c9468 100644 --- a/src/Stripe.net/Services/Account/AccountCardOptions.cs +++ b/src/Stripe.net/Services/Account/AccountCardOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class AccountCardOptions : INestedOptions, ISupportMetadata + public class AccountCardOptions : INestedOptions { [JsonProperty("object")] internal string Object => "card"; diff --git a/src/Stripe.net/Services/Account/AccountSharedOptions.cs b/src/Stripe.net/Services/Account/AccountSharedOptions.cs index cdafe4fa53..a543557739 100644 --- a/src/Stripe.net/Services/Account/AccountSharedOptions.cs +++ b/src/Stripe.net/Services/Account/AccountSharedOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public abstract class AccountSharedOptions : BaseOptions, ISupportMetadata + public abstract class AccountSharedOptions : BaseOptions { [JsonProperty("account_token")] public string AccountToken { get; set; } diff --git a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundCreateOptions.cs b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundCreateOptions.cs index 06cb1ced74..d7a0b57085 100644 --- a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundCreateOptions.cs +++ b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ApplicationFeeRefundCreateOptions : BaseOptions, ISupportMetadata + public class ApplicationFeeRefundCreateOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundUpdateOptions.cs b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundUpdateOptions.cs index cbafa592d5..3f4b1e0dba 100644 --- a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundUpdateOptions.cs +++ b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ApplicationFeeRefundUpdateOptions : BaseOptions, ISupportMetadata + public class ApplicationFeeRefundUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs b/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs index 3f1cbd58e0..dd64dd986b 100644 --- a/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class BankAccountUpdateOptions : BaseOptions, ISupportMetadata + public class BankAccountUpdateOptions : BaseOptions { [JsonProperty("account_holder_name")] public string AccountHolderName { get; set; } diff --git a/src/Stripe.net/Services/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Cards/CardCreateOptions.cs index d144d5d4f5..414870f5a4 100644 --- a/src/Stripe.net/Services/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardCreateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CardCreateOptions : BaseOptions, ISupportMetadata + public class CardCreateOptions : BaseOptions { [JsonProperty("source")] public string SourceToken { get; set; } diff --git a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs index 7635db97bc..5cb2fb8d61 100644 --- a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CardUpdateOptions : BaseOptions, ISupportMetadata + public class CardUpdateOptions : BaseOptions { [JsonProperty("exp_month")] public int? ExpMonth { get; set; } diff --git a/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs b/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs index 72ec3d3da3..1b7cdabe0c 100644 --- a/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ChargeCreateOptions : BaseOptions, ISupportMetadata + public class ChargeCreateOptions : BaseOptions { /// /// A positive integer in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a 0-decimal currency) representing how much to charge the card. The minimum amount is $0.50 US or equivalent in charge currency. diff --git a/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs b/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs index c5008d2ff8..21b71d4b0f 100644 --- a/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ChargeUpdateOptions : BaseOptions, ISupportMetadata + public class ChargeUpdateOptions : BaseOptions { [JsonProperty("description")] public string Description { get; set; } diff --git a/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs b/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs index 8ccb29f1be..e4add32b56 100644 --- a/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs +++ b/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class CouponCreateOptions : BaseOptions, ISupportMetadata + public class CouponCreateOptions : BaseOptions { [JsonProperty("id")] public string Id { get; set; } diff --git a/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs b/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs index 37aee8b1b3..a60c6240e9 100644 --- a/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs +++ b/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CouponUpdateOptions : BaseOptions, ISupportMetadata + public class CouponUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs index 8ff9b9d5b6..127238576d 100644 --- a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class CustomerCreateOptions : BaseOptions, ISupportMetadata + public class CustomerCreateOptions : BaseOptions { [JsonProperty("account_balance")] public int? AccountBalance { get; set; } diff --git a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs index a3e5621c0a..40eca72d28 100644 --- a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CustomerUpdateOptions : BaseOptions, ISupportMetadata + public class CustomerUpdateOptions : BaseOptions { [JsonProperty("account_balance")] public int? AccountBalance { get; set; } diff --git a/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs b/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs index dad45c91c1..5a0388e9c5 100644 --- a/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs +++ b/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class DisputeUpdateOptions : BaseOptions, ISupportMetadata + public class DisputeUpdateOptions : BaseOptions { [JsonProperty("evidence")] public DisputeEvidenceOptions Evidence { get; set; } diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCardUpdateOptions.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCardUpdateOptions.cs index fee039d43a..1d3b14f104 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCardUpdateOptions.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCardUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ExternalAccountCardUpdateOptions : INestedOptions, ISupportMetadata + public class ExternalAccountCardUpdateOptions : INestedOptions { [JsonProperty("default_for_currency")] public bool? DefaultForCurrency { get; set; } diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCreateOptions.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCreateOptions.cs index 02cb7463e5..64127ace15 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCreateOptions.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ExternalAccountCreateOptions : BaseOptions, ISupportMetadata + public class ExternalAccountCreateOptions : BaseOptions { [JsonProperty("external_account")] public string ExternalAccountTokenId { get; set; } diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs index beab686688..e50815db7c 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class ExternalAccountUpdateOptions : BaseOptions, ISupportMetadata + public class ExternalAccountUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs index 4b32618610..7da79496e2 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class FileLinkSharedOptions : BaseOptions, ISupportMetadata + public class FileLinkSharedOptions : BaseOptions { /// /// A future timestamp after which the link will no longer be usable. diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs index e552505fbf..44a4042171 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class InvoiceItemCreateOptions : BaseOptions, ISupportMetadata + public class InvoiceItemCreateOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs index c0000576ba..071decc949 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class InvoiceItemUpdateOptions : BaseOptions, ISupportMetadata + public class InvoiceItemUpdateOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs index a5b72ae731..dad4343c85 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class InvoiceCreateOptions : BaseOptions, ISupportMetadata + public class InvoiceCreateOptions : BaseOptions { /// /// A fee in cents that will be applied to the invoice and transferred to the application diff --git a/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs index b229ab1132..e744ca08d2 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class InvoiceUpdateOptions : BaseOptions, ISupportMetadata + public class InvoiceUpdateOptions : BaseOptions { [JsonProperty("application_fee")] public int? ApplicationFee { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs index 2dc6397580..7eb9e7e0e0 100644 --- a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class AuthorizationUpdateOptions : BaseOptions, ISupportMetadata + public class AuthorizationUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs index aef3097ab5..b62aa7a0b5 100644 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardholderSharedOptions : BaseOptions, ISupportMetadata + public class CardholderSharedOptions : BaseOptions { [JsonProperty("billing")] public BillingOptions Billing { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs index b161b5de9a..d09553d777 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardSharedOptions : BaseOptions, ISupportMetadata + public class CardSharedOptions : BaseOptions { [JsonProperty("billing")] public BillingOptions Billing { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs index 94d68040f6..b6163a1985 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class DisputeSharedOptions : BaseOptions, ISupportMetadata + public class DisputeSharedOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs index 2ff1dea900..600397a45b 100644 --- a/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class TransactionUpdateOptions : BaseOptions, ISupportMetadata + public class TransactionUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Orders/OrderCreateOptions.cs b/src/Stripe.net/Services/Orders/OrderCreateOptions.cs index 7da5dc8599..10c6d0f74e 100644 --- a/src/Stripe.net/Services/Orders/OrderCreateOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class OrderCreateOptions : BaseOptions, ISupportMetadata + public class OrderCreateOptions : BaseOptions { /// /// REQUIRED: Three-letter ISO currency code, in lowercase. Must be a supported currency. diff --git a/src/Stripe.net/Services/Orders/OrderPayOptions.cs b/src/Stripe.net/Services/Orders/OrderPayOptions.cs index 2623a2aa63..f643c330f0 100644 --- a/src/Stripe.net/Services/Orders/OrderPayOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPayOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class OrderPayOptions : BaseOptions, ISupportMetadata + public class OrderPayOptions : BaseOptions { /// /// The ID of an existing customer that will be charged in this request. diff --git a/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs b/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs index 3924855557..6b503046aa 100644 --- a/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class OrderUpdateOptions : BaseOptions, ISupportMetadata + public class OrderUpdateOptions : BaseOptions { /// /// A coupon code that represents a discount to be applied to this order. Must be one-time duration and in tbe same currency as the order. diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentSharedOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentSharedOptions.cs index 5c901a25f1..360ab0e536 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentSharedOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PaymentIntentSharedOptions : BaseOptions, ISupportMetadata + public class PaymentIntentSharedOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs b/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs index 37733a7dbb..a0f01e9b61 100644 --- a/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs +++ b/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PayoutCreateOptions : BaseOptions, ISupportMetadata + public class PayoutCreateOptions : BaseOptions { /// /// REQUIRED diff --git a/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs b/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs index c6b9f9e47e..b57bf6c455 100644 --- a/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs +++ b/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PayoutUpdateOptions : BaseOptions, ISupportMetadata + public class PayoutUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Plans/PlanCreateOptions.cs b/src/Stripe.net/Services/Plans/PlanCreateOptions.cs index 8cd3f13b78..c4b198a438 100644 --- a/src/Stripe.net/Services/Plans/PlanCreateOptions.cs +++ b/src/Stripe.net/Services/Plans/PlanCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PlanCreateOptions : BaseOptions, ISupportMetadata + public class PlanCreateOptions : BaseOptions { [JsonProperty("id")] public string Id { get; set; } diff --git a/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs b/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs index 3aa28fd69a..2323f222e6 100644 --- a/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs +++ b/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PlanUpdateOptions : BaseOptions, ISupportMetadata + public class PlanUpdateOptions : BaseOptions { [JsonProperty("active")] public bool? Active { get; set; } diff --git a/src/Stripe.net/Services/Products/PlanProductCreateOptions.cs b/src/Stripe.net/Services/Products/PlanProductCreateOptions.cs index 931691842e..6b07dd7489 100644 --- a/src/Stripe.net/Services/Products/PlanProductCreateOptions.cs +++ b/src/Stripe.net/Services/Products/PlanProductCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class PlanProductCreateOptions : INestedOptions, ISupportMetadata + public class PlanProductCreateOptions : INestedOptions { [JsonProperty("id")] public string Id { get; set; } diff --git a/src/Stripe.net/Services/Products/ProductSharedOptions.cs b/src/Stripe.net/Services/Products/ProductSharedOptions.cs index 4b7e96d451..c09d2dcad9 100644 --- a/src/Stripe.net/Services/Products/ProductSharedOptions.cs +++ b/src/Stripe.net/Services/Products/ProductSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public abstract class ProductSharedOptions : BaseOptions, ISupportMetadata + public abstract class ProductSharedOptions : BaseOptions { /// /// Whether or not the product is currently available for purchase. Defaults to true. diff --git a/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs b/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs index 1ad0052e4b..1ed2a1d24f 100644 --- a/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs +++ b/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class RefundCreateOptions : BaseOptions, ISupportMetadata + public class RefundCreateOptions : BaseOptions { /// /// A positive integer in cents representing how much of this charge to refund. Can refund diff --git a/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs b/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs index e23a1d4946..060150b99b 100644 --- a/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs +++ b/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class RefundUpdateOptions : BaseOptions, ISupportMetadata + public class RefundUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Service.cs b/src/Stripe.net/Services/Service.cs index ccb9f5084c..87222f4477 100644 --- a/src/Stripe.net/Services/Service.cs +++ b/src/Stripe.net/Services/Service.cs @@ -8,7 +8,7 @@ namespace Stripe using Stripe.Infrastructure; public abstract class Service - where EntityReturned : StripeEntity + where EntityReturned : IStripeEntity { protected Service() { diff --git a/src/Stripe.net/Services/ServiceNested.cs b/src/Stripe.net/Services/ServiceNested.cs index 0f2b73468a..2c303fb53c 100644 --- a/src/Stripe.net/Services/ServiceNested.cs +++ b/src/Stripe.net/Services/ServiceNested.cs @@ -8,7 +8,7 @@ namespace Stripe using Stripe.Infrastructure; public abstract class ServiceNested : Service - where EntityReturned : StripeEntity + where EntityReturned : IStripeEntity { protected ServiceNested() : base(null) diff --git a/src/Stripe.net/Services/Skus/SkuSharedOptions.cs b/src/Stripe.net/Services/Skus/SkuSharedOptions.cs index 4428f68068..9dd50b6312 100644 --- a/src/Stripe.net/Services/Skus/SkuSharedOptions.cs +++ b/src/Stripe.net/Services/Skus/SkuSharedOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public abstract class SkuSharedOptions : BaseOptions, ISupportMetadata + public abstract class SkuSharedOptions : BaseOptions { /// /// Whether or not the SKU is currently available for purchase. Defaults to true. diff --git a/src/Stripe.net/Services/Sources/SourceCreateOptions.cs b/src/Stripe.net/Services/Sources/SourceCreateOptions.cs index c2c2b53dd3..091528f6e3 100644 --- a/src/Stripe.net/Services/Sources/SourceCreateOptions.cs +++ b/src/Stripe.net/Services/Sources/SourceCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class SourceCreateOptions : BaseOptions, ISupportMetadata + public class SourceCreateOptions : BaseOptions { /// /// REQUIRED: The type of the source to create. One of type diff --git a/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs b/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs index f27aa9bf10..1dd2a5e243 100644 --- a/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs +++ b/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class SourceUpdateOptions : BaseOptions, ISupportMetadata + public class SourceUpdateOptions : BaseOptions { /// /// Information about a mandate possiblity attached to a source object (generally for bank debits) as well as its acceptance status. diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs index 672c7f83f5..eb0923f124 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class SubscriptionItemCreateOptions : SubscriptionItemSharedOptions, ISupportMetadata + public class SubscriptionItemCreateOptions : SubscriptionItemSharedOptions { /// /// REQUIRED: The identifier of the subscription to modify. diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs index 14fdda2ca2..ad1b86db7c 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class SubscriptionItemUpdateOptions : SubscriptionItemSharedOptions, ISupportMetadata + public class SubscriptionItemUpdateOptions : SubscriptionItemSharedOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs index b0be531fd2..7b4d54fff4 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public abstract class SubscriptionSharedOptions : BaseOptions, ISupportMetadata + public abstract class SubscriptionSharedOptions : BaseOptions { /// /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. diff --git a/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs b/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs index f079f8b117..037c553c59 100644 --- a/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs +++ b/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class TransferReversalCreateOptions : BaseOptions, ISupportMetadata + public class TransferReversalCreateOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs b/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs index 162192b4d0..27ec4aaa8d 100644 --- a/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs +++ b/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class TransferReversalUpdateOptions : BaseOptions, ISupportMetadata + public class TransferReversalUpdateOptions : BaseOptions { [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Transfers/TransferCreateOptions.cs b/src/Stripe.net/Services/Transfers/TransferCreateOptions.cs index e635f7ae3c..dffd48f31b 100644 --- a/src/Stripe.net/Services/Transfers/TransferCreateOptions.cs +++ b/src/Stripe.net/Services/Transfers/TransferCreateOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class TransferCreateOptions : BaseOptions, ISupportMetadata + public class TransferCreateOptions : BaseOptions { [JsonProperty("amount")] public int? Amount { get; set; } diff --git a/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs b/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs index af83aa4807..1b0c9aedfe 100644 --- a/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs +++ b/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class TransferUpdateOptions : BaseOptions, ISupportMetadata + public class TransferUpdateOptions : BaseOptions { [JsonProperty("description")] public string Description { get; set; } diff --git a/src/Stripe.net/Services/_interfaces/ICreatable.cs b/src/Stripe.net/Services/_interfaces/ICreatable.cs index 28fbd5f6eb..27a0880a7a 100644 --- a/src/Stripe.net/Services/_interfaces/ICreatable.cs +++ b/src/Stripe.net/Services/_interfaces/ICreatable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface ICreatable - where T : StripeEntity + where T : IStripeEntity where O : BaseOptions { T Create(O createOptions, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/IDeletable.cs b/src/Stripe.net/Services/_interfaces/IDeletable.cs index f1405d393d..0cc82402f9 100644 --- a/src/Stripe.net/Services/_interfaces/IDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/IDeletable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface IDeletable - where T : StripeEntity + where T : IStripeEntity { T Delete(string id, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/IListable.cs b/src/Stripe.net/Services/_interfaces/IListable.cs index 2ca33f6dce..4e894be490 100644 --- a/src/Stripe.net/Services/_interfaces/IListable.cs +++ b/src/Stripe.net/Services/_interfaces/IListable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface IListable - where T : StripeEntity + where T : IStripeEntity where O : ListOptions { StripeList List(O listOptions = null, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/INestedCreatable.cs b/src/Stripe.net/Services/_interfaces/INestedCreatable.cs index 7229b804d3..b9612af580 100644 --- a/src/Stripe.net/Services/_interfaces/INestedCreatable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedCreatable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface INestedCreatable - where T : StripeEntity + where T : IStripeEntity where O : BaseOptions { T Create(string parentId, O createOptions, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs index 4f16b6f080..4a3bcec75d 100644 --- a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface INestedDeletable - where T : StripeEntity + where T : IStripeEntity { T Delete(string parentId, string id, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/INestedListable.cs b/src/Stripe.net/Services/_interfaces/INestedListable.cs index 6473b336c6..a5d35d3455 100644 --- a/src/Stripe.net/Services/_interfaces/INestedListable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedListable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface INestedListable - where T : StripeEntity + where T : IStripeEntity where O : ListOptions { StripeList List(string parentId, O listOptions = null, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs b/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs index 92a1964835..752154a9b5 100644 --- a/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface INestedRetrievable - where T : StripeEntity + where T : IStripeEntity { T Get(string parentId, string id, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/INestedUpdatable.cs b/src/Stripe.net/Services/_interfaces/INestedUpdatable.cs index adf43f9260..861965434f 100644 --- a/src/Stripe.net/Services/_interfaces/INestedUpdatable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedUpdatable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface INestedUpdatable - where T : StripeEntity + where T : IStripeEntity where O : BaseOptions { T Update(string parentId, string id, O updateOptions, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/IRetrievable.cs b/src/Stripe.net/Services/_interfaces/IRetrievable.cs index 4415e7ab9c..a8d4fcc30c 100644 --- a/src/Stripe.net/Services/_interfaces/IRetrievable.cs +++ b/src/Stripe.net/Services/_interfaces/IRetrievable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface IRetrievable - where T : StripeEntity + where T : IStripeEntity { T Get(string id, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/ISingletonRetrievable.cs b/src/Stripe.net/Services/_interfaces/ISingletonRetrievable.cs index 0c5cf81c59..a4adf65636 100644 --- a/src/Stripe.net/Services/_interfaces/ISingletonRetrievable.cs +++ b/src/Stripe.net/Services/_interfaces/ISingletonRetrievable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface ISingletonRetrievable - where T : StripeEntity + where T : IStripeEntity { T Get(RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_interfaces/IUpdatable.cs b/src/Stripe.net/Services/_interfaces/IUpdatable.cs index dcc885cfa3..5fcc5e57b7 100644 --- a/src/Stripe.net/Services/_interfaces/IUpdatable.cs +++ b/src/Stripe.net/Services/_interfaces/IUpdatable.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Threading.Tasks; public interface IUpdatable - where T : StripeEntity + where T : IStripeEntity where O : BaseOptions { T Update(string id, O updateOptions, RequestOptions requestOptions = null); diff --git a/src/Stripe.net/Services/_refactor/CardCreateNestedOptions.cs b/src/Stripe.net/Services/_refactor/CardCreateNestedOptions.cs index 196f08c527..f1e58e9308 100644 --- a/src/Stripe.net/Services/_refactor/CardCreateNestedOptions.cs +++ b/src/Stripe.net/Services/_refactor/CardCreateNestedOptions.cs @@ -4,7 +4,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class CardCreateNestedOptions : INestedOptions, ISupportMetadata + public class CardCreateNestedOptions : INestedOptions { /// /// The type of payment source. Should be "card". diff --git a/src/Stripe.net/Services/_refactor/SourceBankAccount.cs b/src/Stripe.net/Services/_refactor/SourceBankAccount.cs index 8048377540..fedc0db54f 100644 --- a/src/Stripe.net/Services/_refactor/SourceBankAccount.cs +++ b/src/Stripe.net/Services/_refactor/SourceBankAccount.cs @@ -3,7 +3,7 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class SourceBankAccount : INestedOptions, ISupportMetadata + public class SourceBankAccount : INestedOptions { [JsonProperty("object")] internal string Object => "bank_account";