Skip to content

Commit db22f27

Browse files
authored
System.Text.Json Serialization Support release to GA (#3074)
1 parent 4912624 commit db22f27

File tree

3,099 files changed

+50342
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,099 files changed

+50342
-228
lines changed

src/Stripe.net/Entities/AccountLinks/AccountLink.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ namespace Stripe
44
using System;
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
7+
#if NET6_0_OR_GREATER
8+
using STJS = System.Text.Json.Serialization;
9+
#endif
710

811
/// <summary>
912
/// Account Links are the means by which a Connect platform grants a connected account
@@ -18,26 +21,40 @@ public class AccountLink : StripeEntity<AccountLink>, IHasObject
1821
/// String representing the object's type. Objects of the same type share the same value.
1922
/// </summary>
2023
[JsonProperty("object")]
24+
#if NET6_0_OR_GREATER
25+
[STJS.JsonPropertyName("object")]
26+
#endif
2127
public string Object { get; set; }
2228

2329
/// <summary>
2430
/// Time at which the object was created. Measured in seconds since the Unix epoch.
2531
/// </summary>
2632
[JsonProperty("created")]
2733
[JsonConverter(typeof(UnixDateTimeConverter))]
34+
#if NET6_0_OR_GREATER
35+
[STJS.JsonPropertyName("created")]
36+
[STJS.JsonConverter(typeof(STJUnixDateTimeConverter))]
37+
#endif
2838
public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
2939

3040
/// <summary>
3141
/// The timestamp at which this account link will expire.
3242
/// </summary>
3343
[JsonProperty("expires_at")]
3444
[JsonConverter(typeof(UnixDateTimeConverter))]
45+
#if NET6_0_OR_GREATER
46+
[STJS.JsonPropertyName("expires_at")]
47+
[STJS.JsonConverter(typeof(STJUnixDateTimeConverter))]
48+
#endif
3549
public DateTime ExpiresAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
3650

3751
/// <summary>
3852
/// The URL for the account link.
3953
/// </summary>
4054
[JsonProperty("url")]
55+
#if NET6_0_OR_GREATER
56+
[STJS.JsonPropertyName("url")]
57+
#endif
4158
public string Url { get; set; }
4259
}
4360
}

src/Stripe.net/Entities/AccountSessions/AccountSession.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ namespace Stripe
44
using System;
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
7+
#if NET6_0_OR_GREATER
8+
using STJS = System.Text.Json.Serialization;
9+
#endif
710

811
/// <summary>
912
/// An AccountSession allows a Connect platform to grant access to a connected account in
@@ -23,12 +26,18 @@ public class AccountSession : StripeEntity<AccountSession>, IHasObject
2326
/// String representing the object's type. Objects of the same type share the same value.
2427
/// </summary>
2528
[JsonProperty("object")]
29+
#if NET6_0_OR_GREATER
30+
[STJS.JsonPropertyName("object")]
31+
#endif
2632
public string Object { get; set; }
2733

2834
/// <summary>
2935
/// The ID of the account the AccountSession was created for.
3036
/// </summary>
3137
[JsonProperty("account")]
38+
#if NET6_0_OR_GREATER
39+
[STJS.JsonPropertyName("account")]
40+
#endif
3241
public string Account { get; set; }
3342

3443
/// <summary>
@@ -45,23 +54,36 @@ public class AccountSession : StripeEntity<AccountSession>, IHasObject
4554
/// handled.
4655
/// </summary>
4756
[JsonProperty("client_secret")]
57+
#if NET6_0_OR_GREATER
58+
[STJS.JsonPropertyName("client_secret")]
59+
#endif
4860
public string ClientSecret { get; set; }
4961

5062
[JsonProperty("components")]
63+
#if NET6_0_OR_GREATER
64+
[STJS.JsonPropertyName("components")]
65+
#endif
5166
public AccountSessionComponents Components { get; set; }
5267

5368
/// <summary>
5469
/// The timestamp at which this AccountSession will expire.
5570
/// </summary>
5671
[JsonProperty("expires_at")]
5772
[JsonConverter(typeof(UnixDateTimeConverter))]
73+
#if NET6_0_OR_GREATER
74+
[STJS.JsonPropertyName("expires_at")]
75+
[STJS.JsonConverter(typeof(STJUnixDateTimeConverter))]
76+
#endif
5877
public DateTime ExpiresAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
5978

6079
/// <summary>
6180
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
6281
/// the object exists in test mode.
6382
/// </summary>
6483
[JsonProperty("livemode")]
84+
#if NET6_0_OR_GREATER
85+
[STJS.JsonPropertyName("livemode")]
86+
#endif
6587
public bool Livemode { get; set; }
6688
}
6789
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponents.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,100 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponents : StripeEntity<AccountSessionComponents>
710
{
811
[JsonProperty("account_management")]
12+
#if NET6_0_OR_GREATER
13+
[STJS.JsonPropertyName("account_management")]
14+
#endif
915
public AccountSessionComponentsAccountManagement AccountManagement { get; set; }
1016

1117
[JsonProperty("account_onboarding")]
18+
#if NET6_0_OR_GREATER
19+
[STJS.JsonPropertyName("account_onboarding")]
20+
#endif
1221
public AccountSessionComponentsAccountOnboarding AccountOnboarding { get; set; }
1322

1423
[JsonProperty("balances")]
24+
#if NET6_0_OR_GREATER
25+
[STJS.JsonPropertyName("balances")]
26+
#endif
1527
public AccountSessionComponentsBalances Balances { get; set; }
1628

1729
[JsonProperty("documents")]
30+
#if NET6_0_OR_GREATER
31+
[STJS.JsonPropertyName("documents")]
32+
#endif
1833
public AccountSessionComponentsDocuments Documents { get; set; }
1934

2035
[JsonProperty("financial_account")]
36+
#if NET6_0_OR_GREATER
37+
[STJS.JsonPropertyName("financial_account")]
38+
#endif
2139
public AccountSessionComponentsFinancialAccount FinancialAccount { get; set; }
2240

2341
[JsonProperty("financial_account_transactions")]
42+
#if NET6_0_OR_GREATER
43+
[STJS.JsonPropertyName("financial_account_transactions")]
44+
#endif
2445
public AccountSessionComponentsFinancialAccountTransactions FinancialAccountTransactions { get; set; }
2546

2647
[JsonProperty("issuing_card")]
48+
#if NET6_0_OR_GREATER
49+
[STJS.JsonPropertyName("issuing_card")]
50+
#endif
2751
public AccountSessionComponentsIssuingCard IssuingCard { get; set; }
2852

2953
[JsonProperty("issuing_cards_list")]
54+
#if NET6_0_OR_GREATER
55+
[STJS.JsonPropertyName("issuing_cards_list")]
56+
#endif
3057
public AccountSessionComponentsIssuingCardsList IssuingCardsList { get; set; }
3158

3259
[JsonProperty("notification_banner")]
60+
#if NET6_0_OR_GREATER
61+
[STJS.JsonPropertyName("notification_banner")]
62+
#endif
3363
public AccountSessionComponentsNotificationBanner NotificationBanner { get; set; }
3464

3565
[JsonProperty("payment_details")]
66+
#if NET6_0_OR_GREATER
67+
[STJS.JsonPropertyName("payment_details")]
68+
#endif
3669
public AccountSessionComponentsPaymentDetails PaymentDetails { get; set; }
3770

3871
[JsonProperty("payments")]
72+
#if NET6_0_OR_GREATER
73+
[STJS.JsonPropertyName("payments")]
74+
#endif
3975
public AccountSessionComponentsPayments Payments { get; set; }
4076

4177
[JsonProperty("payouts")]
78+
#if NET6_0_OR_GREATER
79+
[STJS.JsonPropertyName("payouts")]
80+
#endif
4281
public AccountSessionComponentsPayouts Payouts { get; set; }
4382

4483
[JsonProperty("payouts_list")]
84+
#if NET6_0_OR_GREATER
85+
[STJS.JsonPropertyName("payouts_list")]
86+
#endif
4587
public AccountSessionComponentsPayoutsList PayoutsList { get; set; }
4688

4789
[JsonProperty("tax_registrations")]
90+
#if NET6_0_OR_GREATER
91+
[STJS.JsonPropertyName("tax_registrations")]
92+
#endif
4893
public AccountSessionComponentsTaxRegistrations TaxRegistrations { get; set; }
4994

5095
[JsonProperty("tax_settings")]
96+
#if NET6_0_OR_GREATER
97+
[STJS.JsonPropertyName("tax_settings")]
98+
#endif
5199
public AccountSessionComponentsTaxSettings TaxSettings { get; set; }
52100
}
53101
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsAccountManagement.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponentsAccountManagement : StripeEntity<AccountSessionComponentsAccountManagement>
710
{
811
/// <summary>
912
/// Whether the embedded component is enabled.
1013
/// </summary>
1114
[JsonProperty("enabled")]
15+
#if NET6_0_OR_GREATER
16+
[STJS.JsonPropertyName("enabled")]
17+
#endif
1218
public bool Enabled { get; set; }
1319

1420
[JsonProperty("features")]
21+
#if NET6_0_OR_GREATER
22+
[STJS.JsonPropertyName("features")]
23+
#endif
1524
public AccountSessionComponentsAccountManagementFeatures Features { get; set; }
1625
}
1726
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsAccountManagementFeatures.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponentsAccountManagementFeatures : StripeEntity<AccountSessionComponentsAccountManagementFeatures>
710
{
@@ -13,6 +16,9 @@ public class AccountSessionComponentsAccountManagementFeatures : StripeEntity<Ac
1316
/// <c>disable_stripe_user_authentication</c> defaults to false.
1417
/// </summary>
1518
[JsonProperty("disable_stripe_user_authentication")]
19+
#if NET6_0_OR_GREATER
20+
[STJS.JsonPropertyName("disable_stripe_user_authentication")]
21+
#endif
1622
public bool DisableStripeUserAuthentication { get; set; }
1723

1824
/// <summary>
@@ -23,6 +29,9 @@ public class AccountSessionComponentsAccountManagementFeatures : StripeEntity<Ac
2329
/// The default value for this feature is <c>true</c>.
2430
/// </summary>
2531
[JsonProperty("external_account_collection")]
32+
#if NET6_0_OR_GREATER
33+
[STJS.JsonPropertyName("external_account_collection")]
34+
#endif
2635
public bool ExternalAccountCollection { get; set; }
2736
}
2837
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsAccountOnboarding.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponentsAccountOnboarding : StripeEntity<AccountSessionComponentsAccountOnboarding>
710
{
811
/// <summary>
912
/// Whether the embedded component is enabled.
1013
/// </summary>
1114
[JsonProperty("enabled")]
15+
#if NET6_0_OR_GREATER
16+
[STJS.JsonPropertyName("enabled")]
17+
#endif
1218
public bool Enabled { get; set; }
1319

1420
[JsonProperty("features")]
21+
#if NET6_0_OR_GREATER
22+
[STJS.JsonPropertyName("features")]
23+
#endif
1524
public AccountSessionComponentsAccountOnboardingFeatures Features { get; set; }
1625
}
1726
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsAccountOnboardingFeatures.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponentsAccountOnboardingFeatures : StripeEntity<AccountSessionComponentsAccountOnboardingFeatures>
710
{
@@ -13,6 +16,9 @@ public class AccountSessionComponentsAccountOnboardingFeatures : StripeEntity<Ac
1316
/// <c>disable_stripe_user_authentication</c> defaults to false.
1417
/// </summary>
1518
[JsonProperty("disable_stripe_user_authentication")]
19+
#if NET6_0_OR_GREATER
20+
[STJS.JsonPropertyName("disable_stripe_user_authentication")]
21+
#endif
1622
public bool DisableStripeUserAuthentication { get; set; }
1723

1824
/// <summary>
@@ -23,6 +29,9 @@ public class AccountSessionComponentsAccountOnboardingFeatures : StripeEntity<Ac
2329
/// The default value for this feature is <c>true</c>.
2430
/// </summary>
2531
[JsonProperty("external_account_collection")]
32+
#if NET6_0_OR_GREATER
33+
[STJS.JsonPropertyName("external_account_collection")]
34+
#endif
2635
public bool ExternalAccountCollection { get; set; }
2736
}
2837
}

src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalances.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
namespace Stripe
33
{
44
using Newtonsoft.Json;
5+
#if NET6_0_OR_GREATER
6+
using STJS = System.Text.Json.Serialization;
7+
#endif
58

69
public class AccountSessionComponentsBalances : StripeEntity<AccountSessionComponentsBalances>
710
{
811
/// <summary>
912
/// Whether the embedded component is enabled.
1013
/// </summary>
1114
[JsonProperty("enabled")]
15+
#if NET6_0_OR_GREATER
16+
[STJS.JsonPropertyName("enabled")]
17+
#endif
1218
public bool Enabled { get; set; }
1319

1420
[JsonProperty("features")]
21+
#if NET6_0_OR_GREATER
22+
[STJS.JsonPropertyName("features")]
23+
#endif
1524
public AccountSessionComponentsBalancesFeatures Features { get; set; }
1625
}
1726
}

0 commit comments

Comments
 (0)