Skip to content
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
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c6c496e5daed61b9bb5504a4af318c46e722f783
25e6bd225852aa44d783e9fb3b9895af39479331
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2205
v2206
25 changes: 25 additions & 0 deletions src/Stripe.net/Services/Accounts/AccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Stripe
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -208,6 +209,30 @@ public virtual Task<Account> RejectAsync(string id, AccountRejectOptions options
return this.RequestAsync<Account>(BaseAddress.Api, HttpMethod.Post, $"/v1/accounts/{WebUtility.UrlEncode(id)}/reject", options, requestOptions, cancellationToken);
}

/// <summary>
/// Serializes an Account update request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchUpdate(string account, AccountUpdateOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", new Dictionary<string, string> { { "account", account } } },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// <p>Updates a <a href="https://stripe.com/connect/accounts">connected account</a> by
/// setting the values of the parameters passed. Any parameters not provided are left
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class AccountSettingsPayoutsScheduleDelayDays : StringEnum
{
public static readonly AccountSettingsPayoutsScheduleDelayDays Minimum = new AccountSettingsPayoutsScheduleDelayDays("minimum");
Expand Down
25 changes: 25 additions & 0 deletions src/Stripe.net/Services/Customers/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Stripe
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -213,6 +214,30 @@ public virtual IAsyncEnumerable<Customer> SearchAutoPagingAsync(CustomerSearchOp
return this.SearchRequestAutoPagingAsync<Customer>($"/v1/customers/search", options, requestOptions, cancellationToken);
}

/// <summary>
/// Serializes a Customer update request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchUpdate(string customer, CustomerUpdateOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", new Dictionary<string, string> { { "customer", customer } } },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// <p>Updates the specified customer by setting the values of the parameters passed. Any
/// parameters not provided are left unchanged. For example, if you pass the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceScheduleDetailsPhaseEndDate : StringEnum
{
public static readonly InvoiceScheduleDetailsPhaseEndDate Now = new InvoiceScheduleDetailsPhaseEndDate("now");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceScheduleDetailsPhaseStartDate : StringEnum
{
public static readonly InvoiceScheduleDetailsPhaseStartDate Now = new InvoiceScheduleDetailsPhaseStartDate("now");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceScheduleDetailsPhaseTrialEnd : StringEnum
{
public static readonly InvoiceScheduleDetailsPhaseTrialEnd Now = new InvoiceScheduleDetailsPhaseTrialEnd("now");
Expand Down
49 changes: 49 additions & 0 deletions src/Stripe.net/Services/Invoices/InvoiceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Stripe
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -431,6 +432,54 @@ public virtual Task<Invoice> SendInvoiceAsync(string id, InvoiceSendOptions opti
return this.RequestAsync<Invoice>(BaseAddress.Api, HttpMethod.Post, $"/v1/invoices/{WebUtility.UrlEncode(id)}/send", options, requestOptions, cancellationToken);
}

/// <summary>
/// Serializes an Invoice pay request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchPay(string invoice, InvoicePayOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", new Dictionary<string, string> { { "invoice", invoice } } },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// Serializes an Invoice update request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchUpdate(string invoice, InvoiceUpdateOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", new Dictionary<string, string> { { "invoice", invoice } } },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// <p>Draft invoices are fully editable. Once an invoice is <a
/// href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceSubscriptionDetailsBillingCycleAnchor : StringEnum
{
public static readonly InvoiceSubscriptionDetailsBillingCycleAnchor Now = new InvoiceSubscriptionDetailsBillingCycleAnchor("now");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceSubscriptionDetailsCancelAt : StringEnum
{
public static readonly InvoiceSubscriptionDetailsCancelAt MaxPeriodEnd = new InvoiceSubscriptionDetailsCancelAt("max_period_end");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class InvoiceSubscriptionDetailsTrialEnd : StringEnum
{
public static readonly InvoiceSubscriptionDetailsTrialEnd Now = new InvoiceSubscriptionDetailsTrialEnd("now");
Expand Down
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Plans/PlanTierUpTo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class PlanTierUpTo : StringEnum
{
public static readonly PlanTierUpTo Inf = new PlanTierUpTo("inf");
Expand Down
3 changes: 3 additions & 0 deletions src/Stripe.net/Services/Prices/PriceTierUpTo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class PriceTierUpTo : StringEnum
{
public static readonly PriceTierUpTo Inf = new PriceTierUpTo("inf");
Expand Down
49 changes: 49 additions & 0 deletions src/Stripe.net/Services/PromotionCodes/PromotionCodeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Stripe
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -100,6 +101,54 @@ public virtual IAsyncEnumerable<PromotionCode> ListAutoPagingAsync(PromotionCode
return this.ListRequestAutoPagingAsync<PromotionCode>($"/v1/promotion_codes", options, requestOptions, cancellationToken);
}

/// <summary>
/// Serializes a PromotionCode create request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchCreate(PromotionCodeCreateOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", null },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// Serializes a PromotionCode update request into a batch job JSONL line.
/// </summary>
public virtual string SerializeBatchUpdate(string promotionCode, PromotionCodeUpdateOptions options = null, RequestOptions requestOptions = null)
{
var itemId = Guid.NewGuid().ToString();
var stripeVersion = StripeConfiguration.ApiVersion;
var stripeContext = requestOptions?.StripeContext;

var item = new Dictionary<string, object>
{
{ "id", itemId },
{ "path_params", new Dictionary<string, string> { { "promotion_code", promotionCode } } },
{ "params", options },
{ "stripe_version", stripeVersion },
};
if (stripeContext != null)
{
item["context"] = stripeContext;
}

return JsonSerializer.Serialize(item, new JsonSerializerOptions(StripeConfiguration.SerializerOptions) { DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull });
}

/// <summary>
/// <p>Updates the specified promotion code by setting the values of the parameters passed.
/// Most fields are, by design, not editable.</p>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class QuoteSubscriptionDataEffectiveDate : StringEnum
{
public static readonly QuoteSubscriptionDataEffectiveDate CurrentPeriodEnd = new QuoteSubscriptionDataEffectiveDate("current_period_end");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class SubscriptionSchedulePhaseEndDate : StringEnum
{
public static readonly SubscriptionSchedulePhaseEndDate Now = new SubscriptionSchedulePhaseEndDate("now");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class SubscriptionSchedulePhaseStartDate : StringEnum
{
public static readonly SubscriptionSchedulePhaseStartDate Now = new SubscriptionSchedulePhaseStartDate("now");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))]
public class SubscriptionSchedulePhaseTrialEnd : StringEnum
{
public static readonly SubscriptionSchedulePhaseTrialEnd Now = new SubscriptionSchedulePhaseTrialEnd("now");
Expand Down
Loading
Loading