Skip to content

Commit

Permalink
Deprecate Expand properties on services (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored Jun 6, 2019
1 parent 17a1c2b commit a0587cd
Show file tree
Hide file tree
Showing 26 changed files with 94 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/Account/AccountService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -24,6 +25,7 @@ public AccountService(IStripeClient client)

public override string BasePath => "/v1/accounts";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBusinessLogo { get; set; }

public virtual Account Create(AccountCreateOptions options, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -22,8 +23,10 @@ public ApplicationFeeRefundService(IStripeClient client)

public override string BasePath => "/v1/application_fees/{PARENT_ID}/refunds";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandFee { get; set; }

public virtual ApplicationFeeRefund Create(string applicationFeeId, ApplicationFeeRefundCreateOptions options = null, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -20,14 +21,19 @@ public ApplicationFeeService(IStripeClient client)

public override string BasePath => "/v1/application_fees";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandAccount { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandApplication { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCharge { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandOriginatingTransaction { get; set; }

public virtual ApplicationFee Get(string applicationFeeId, ApplicationFeeGetOptions options = null, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -20,6 +21,7 @@ public BalanceTransactionService(IStripeClient client)

public override string BasePath => "/v1/balance/history";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandSource { get; set; }

public virtual BalanceTransaction Get(string balanceTransactionId, BalanceTransactionGetOptions options = null, RequestOptions requestOptions = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/BankAccounts/BankAccountService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -24,6 +25,7 @@ public BankAccountService(IStripeClient client)

public override string BasePath => "/v1/customers/{PARENT_ID}/sources";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

public virtual BankAccount Create(string customerId, BankAccountCreateOptions options, RequestOptions requestOptions = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/Capabilities/CapabilityService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -21,6 +22,7 @@ public CapabilityService(IStripeClient client)

public override string BasePath => "/v1/accounts/{PARENT_ID}/capabilities";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandAccount { get; set; }

public virtual Capability Get(string accountId, string capabilityId, CapabilityGetOptions options = null, RequestOptions requestOptions = null)
Expand Down
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Cards/CardService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -23,8 +24,10 @@ public CardService(IStripeClient client)

public override string BasePath => "/v1/customers/{PARENT_ID}/sources";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandRecipient { get; set; }

public virtual Card Create(string customerId, CardCreateOptions options, RequestOptions requestOptions = null)
Expand Down
14 changes: 14 additions & 0 deletions src/Stripe.net/Services/Charges/ChargeService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,30 +24,43 @@ public ChargeService(IStripeClient client)

public override string BasePath => "/v1/charges";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandApplication { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandApplicationFee { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandDestination { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandDispute { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandInvoice { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandOnBehalfOf { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandOrder { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandReview { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandSourceTransfer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandTransfer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBusinessLogo { get; set; }

public virtual Charge Capture(string chargeId, ChargeCaptureOptions options, RequestOptions requestOptions = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/Customers/CustomerService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -23,6 +24,7 @@ public CustomerService(IStripeClient client)

public override string BasePath => "/v1/customers";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandDefaultSource { get; set; }

public bool ExpandDefaultCustomerBankAccount { get; set; } // TODO: remove in next major version
Expand Down
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/Disputes/DisputeService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -22,6 +23,7 @@ public DisputeService(IStripeClient client)

public override string BasePath => "/v1/disputes";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCharge { get; set; }

public virtual Dispute Close(string disputeId, RequestOptions requestOptions = null)
Expand Down
4 changes: 4 additions & 0 deletions src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -23,10 +24,13 @@ public InvoiceItemService(IStripeClient client)

public override string BasePath => "/v1/invoiceitems";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandInvoice { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandSubscription { get; set; }

public virtual InvoiceItem Create(InvoiceItemCreateOptions options, RequestOptions requestOptions = null)
Expand Down
5 changes: 5 additions & 0 deletions src/Stripe.net/Services/Invoices/InvoiceService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,12 +24,16 @@ public InvoiceService(IStripeClient client)

public override string BasePath => "/v1/invoices";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCharge { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandDefaultPaymentMethod { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandSubscription { get; set; }

public virtual Invoice Create(InvoiceCreateOptions options, RequestOptions requestOptions = null)
Expand Down
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Orders/OrderService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,8 +24,10 @@ public OrderService(IStripeClient client)

public override string BasePath => "/v1/orders";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCharge { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

public virtual Order Create(OrderCreateOptions options, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,16 +24,22 @@ public PaymentIntentService(IStripeClient client)

public override string BasePath => "/v1/payment_intents";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandApplication { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandOnBehalfOf { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandPaymentMethod { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandReview { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandSource { get; set; }

public virtual PaymentIntent Cancel(string paymentIntentId, PaymentIntentCancelOptions options, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,6 +24,7 @@ public PaymentMethodService(IStripeClient client)

public override string BasePath => "/v1/payment_methods";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCustomer { get; set; }

public virtual PaymentMethod Attach(string paymentMethodId, PaymentMethodAttachOptions options, RequestOptions requestOptions = null)
Expand Down
4 changes: 4 additions & 0 deletions src/Stripe.net/Services/Payouts/PayoutService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
Expand All @@ -23,10 +24,13 @@ public PayoutService(IStripeClient client)

public override string BasePath => "/v1/payouts";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandDestination { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandFailureBalanceTransaction { get; set; }

public virtual Payout Cancel(string payoutId, RequestOptions requestOptions = null)
Expand Down
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Persons/PersonService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -22,8 +23,10 @@ public PersonService(IStripeClient client)

public override string BasePath => "/v1/accounts/{PARENT_ID}/persons";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandTransfer { get; set; }

public virtual Person Create(string accountId, PersonCreateOptions options = null, RequestOptions requestOptions = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Stripe.net/Services/Plans/PlanService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -23,6 +24,7 @@ public PlanService(IStripeClient client)

public override string BasePath => "/v1/plans";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandProduct { get; set; }

public virtual Plan Create(PlanCreateOptions options, RequestOptions requestOptions = null)
Expand Down
4 changes: 4 additions & 0 deletions src/Stripe.net/Services/Refunds/RefundService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -22,10 +23,13 @@ public RefundService(IStripeClient client)

public override string BasePath => "/v1/refunds";

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandBalanceTransaction { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandCharge { get; set; }

[Obsolete("Use BaseOptions.AddExpand instead.")]
public bool ExpandFailureBalanceTransaction { get; set; }

public virtual Refund Create(RefundCreateOptions options, RequestOptions requestOptions = null)
Expand Down
Loading

0 comments on commit a0587cd

Please sign in to comment.