Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing IHas* interfaces everywhere #1733

Merged
merged 5 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Stripe
{
using Newtonsoft.Json;

public class EphemeralKeyAssociatedObject : StripeEntity<EphemeralKeyAssociatedObject>
public class EphemeralKeyAssociatedObject : StripeEntity<EphemeralKeyAssociatedObject>, IHasId
{
[JsonProperty("id")]
public string Id { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Entities/Events/EventRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Stripe
{
using Newtonsoft.Json;

public class EventRequest : StripeEntity<EventRequest>
public class EventRequest : StripeEntity<EventRequest>, IHasId
{
/// <summary>
/// ID of the API request that caused the event. If null, the event was automatic (e.g.,
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Entities/Orders/ShippingMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Stripe
{
using Newtonsoft.Json;

public class ShippingMethod : StripeEntity<ShippingMethod>
public class ShippingMethod : StripeEntity<ShippingMethod>, IHasId
{
[JsonProperty("id")]
public string Id { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Entities/Persons/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class Person : StripeEntity<Person>, IHasId, IHasObject
public class Person : StripeEntity<Person>, IHasId, IHasObject, IHasMetadata
{
/// <summary>
/// Unique identifier for the object.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Account/AccountCardOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class AccountCardOptions : INestedOptions
public class AccountCardOptions : INestedOptions, IHasMetadata
{
[JsonProperty("object")]
internal string Object => "card";
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Account/AccountSharedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public abstract class AccountSharedOptions : BaseOptions
public abstract class AccountSharedOptions : BaseOptions, IHasMetadata
{
[JsonProperty("account_token")]
public string AccountToken { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class ApplicationFeeRefundCreateOptions : BaseOptions
public class ApplicationFeeRefundCreateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class ApplicationFeeRefundUpdateOptions : BaseOptions
public class ApplicationFeeRefundUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class BankAccountUpdateOptions : BaseOptions
public class BankAccountUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("account_holder_name")]
public string AccountHolderName { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Cards/CardCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class CardCreateOptions : BaseOptions
public class CardCreateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("default_for_currency")]
public bool? DefaultForCurrency { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Cards/CardUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class CardUpdateOptions : BaseOptions
public class CardUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("address_city")]
public string AddressCity { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Charges/ChargeCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class ChargeCreateOptions : BaseOptions
public class ChargeCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// 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.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Charges/ChargeSourceListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Stripe
{
using Newtonsoft.Json;

public class ChargeSourceListOptions : INestedOptions
public class ChargeSourceListOptions : INestedOptions, IHasObject
{
[JsonProperty("object")]
public string Object { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class ChargeUpdateOptions : BaseOptions
public class ChargeUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("description")]
public string Description { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Checkout
using System.Collections.Generic;
using Newtonsoft.Json;

public class SessionPaymentIntentDataOptions : INestedOptions
public class SessionPaymentIntentDataOptions : INestedOptions, IHasMetadata
{
/// <summary>
/// The amount of the application fee (if any) that will be applied to the payment and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe.Checkout
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class SessionSubscriptionDataOptions : INestedOptions
public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata
{
/// <summary>
/// List of items, each with an attached plan.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Coupons/CouponCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class CouponCreateOptions : BaseOptions
public class CouponCreateOptions : BaseOptions, IHasId, IHasMetadata
{
[JsonProperty("id")]
public string Id { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class CouponUpdateOptions : BaseOptions
public class CouponUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class CreditNoteCreateOptions : BaseOptions
public class CreditNoteCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// Credit note amount.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class CreditNoteUpdateOptions : BaseOptions
public class CreditNoteUpdateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// Credit note memo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class CustomerBalanceTransactionCreateOptions : BaseOptions
public class CustomerBalanceTransactionCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// The amount to apply to the customer’s balance. Pass a negative amount to credit the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class CustomerBalanceTransactionUpdateOptions : BaseOptions
public class CustomerBalanceTransactionUpdateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// An arbitrary string attached to the object. Often useful for displaying to users.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Customers/CustomerCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class CustomerCreateOptions : BaseOptions
public class CustomerCreateOptions : BaseOptions, IHasMetadata
{
[Obsolete("Use Balance")]
[JsonProperty("account_balance")]
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class CustomerUpdateOptions : BaseOptions
public class CustomerUpdateOptions : BaseOptions, IHasMetadata
{
[Obsolete("Use Balance")]
[JsonProperty("account_balance")]
Expand Down
8 changes: 4 additions & 4 deletions src/Stripe.net/Services/Disputes/DisputeEvidenceOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class DisputeEvidenceOptions : INestedOptions
public class DisputeEvidenceOptions : INestedOptions, IHasMetadata
{
[JsonProperty("access_activity_log")]
public string AccessActivityLog { get; set; }
Expand Down Expand Up @@ -44,6 +44,9 @@ public class DisputeEvidenceOptions : INestedOptions
[JsonProperty("duplicate_charge_id")]
public string DuplicateChargeFileId { get; set; }

[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

[JsonProperty("product_description")]
public string ProductDescription { get; set; }

Expand Down Expand Up @@ -85,8 +88,5 @@ public class DisputeEvidenceOptions : INestedOptions

[JsonProperty("uncategorized_text")]
public string UncategorizedText { get; set; }

[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class DisputeUpdateOptions : BaseOptions
public class DisputeUpdateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// Evidence to upload, to respond to a dispute. Updating any field in the hash will submit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class ExternalAccountCardUpdateOptions : INestedOptions
public class ExternalAccountCardUpdateOptions : INestedOptions, IHasMetadata
{
[JsonProperty("default_for_currency")]
public bool? DefaultForCurrency { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class ExternalAccountCreateOptions : BaseOptions
public class ExternalAccountCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// REQUIRED. Either a token, like the ones returned by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class ExternalAccountUpdateOptions : BaseOptions
public class ExternalAccountUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class FileLinkSharedOptions : BaseOptions
public class FileLinkSharedOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// A future timestamp after which the link will no longer be usable.
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Files/FileLinkDataOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class FileLinkDataOptions : BaseOptions
public class FileLinkDataOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// Set this to <c>true</c> to create a file link for the newly created file. Creating a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class InvoiceItemCreateOptions : BaseOptions
public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class InvoiceItemUpdateOptions : BaseOptions
public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class InvoiceCreateOptions : BaseOptions
public class InvoiceCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// A fee in cents that will be applied to the invoice and transferred to the application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class InvoiceSubscriptionItemOptions : BaseOptions
public class InvoiceSubscriptionItemOptions : BaseOptions, IHasId
{
[JsonProperty("id")]
public string Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe
using System.Collections.Generic;
using Newtonsoft.Json;

public class InvoiceUpcomingInvoiceItemOption : INestedOptions
public class InvoiceUpcomingInvoiceItemOption : INestedOptions, IHasMetadata
{
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class InvoiceUpdateOptions : BaseOptions
public class InvoiceUpdateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// A fee in cents that will be applied to the invoice and transferred to the application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Issuing
using System.Collections.Generic;
using Newtonsoft.Json;

public class AuthorizationUpdateOptions : BaseOptions
public class AuthorizationUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Issuing
using System.Collections.Generic;
using Newtonsoft.Json;

public class CardholderSharedOptions : BaseOptions
public class CardholderSharedOptions : BaseOptions, IHasMetadata
{
[JsonProperty("billing")]
public BillingOptions Billing { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Issuing
using System.Collections.Generic;
using Newtonsoft.Json;

public class CardSharedOptions : BaseOptions
public class CardSharedOptions : BaseOptions, IHasMetadata
{
[JsonProperty("authorization_controls")]
public AuthorizationControlsOptions AuthorizationControls { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Issuing
using System.Collections.Generic;
using Newtonsoft.Json;

public class DisputeSharedOptions : BaseOptions
public class DisputeSharedOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Stripe.Issuing
using System.Collections.Generic;
using Newtonsoft.Json;

public class TransactionUpdateOptions : BaseOptions
public class TransactionUpdateOptions : BaseOptions, IHasMetadata
{
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand Down
Loading