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

Update generated code for beta #2784

Merged
merged 20 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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 OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v605
v627
2 changes: 1 addition & 1 deletion src/Stripe.net/Constants/ApiVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace Stripe
internal class ApiVersion
{
public const string Current = "2023-10-16";
public const string CurrentPreview = "2023-09-15.preview-v2";
public const string CurrentPreview = "2023-10-26.preview-v2";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public class AccountFutureRequirements : StripeEntity<AccountFutureRequirements>
public List<string> CurrentlyDue { get; set; }

/// <summary>
/// This is typed as a string for consistency with <c>requirements.disabled_reason</c>, but
/// it safe to assume <c>future_requirements.disabled_reason</c> is empty because fields in
/// <c>future_requirements</c> will never disable the account.
/// This is typed as a string for consistency with <c>requirements.disabled_reason</c>.
/// </summary>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }
Expand Down
10 changes: 6 additions & 4 deletions src/Stripe.net/Entities/Accounts/AccountRequirements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public class AccountRequirements : StripeEntity<AccountRequirements>
public List<string> CurrentlyDue { get; set; }

/// <summary>
/// If the account is disabled, this string describes why. Can be
/// If the account is disabled, this string describes why. <a
/// href="https://stripe.com/docs/connect/handling-api-verification">Learn more about
/// handling verification issues</a>. Can be <c>action_required.requested_capabilities</c>,
/// <c>requirements.past_due</c>, <c>requirements.pending_verification</c>, <c>listed</c>,
/// <c>platform_paused</c>, <c>rejected.fraud</c>, <c>rejected.listed</c>,
/// <c>rejected.terms_of_service</c>, <c>rejected.other</c>, <c>under_review</c>, or
/// <c>other</c>.
/// <c>platform_paused</c>, <c>rejected.fraud</c>, <c>rejected.incomplete_verification</c>,
/// <c>rejected.listed</c>, <c>rejected.other</c>, <c>rejected.terms_of_service</c>,
/// <c>under_review</c>, or <c>other</c>.
/// </summary>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace Stripe

public class FundingInstructionsBankTransferFinancialAddress : StripeEntity<FundingInstructionsBankTransferFinancialAddress>
{
/// <summary>
/// ABA Records contain U.S. bank account details per the ABA format.
/// </summary>
[JsonProperty("aba")]
public FundingInstructionsBankTransferFinancialAddressAba Aba { get; set; }

/// <summary>
/// Iban Records contain E.U. bank account details per the SEPA format.
/// </summary>
Expand All @@ -30,9 +36,16 @@ public class FundingInstructionsBankTransferFinancialAddress : StripeEntity<Fund
[JsonProperty("supported_networks")]
public List<string> SupportedNetworks { get; set; }

/// <summary>
/// SWIFT Records contain U.S. bank account details per the SWIFT format.
/// </summary>
[JsonProperty("swift")]
public FundingInstructionsBankTransferFinancialAddressSwift Swift { get; set; }

/// <summary>
/// The type of financial address.
/// One of: <c>iban</c>, <c>sort_code</c>, <c>spei</c>, or <c>zengin</c>.
/// One of: <c>aba</c>, <c>iban</c>, <c>sort_code</c>, <c>spei</c>, <c>swift</c>, or
/// <c>zengin</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class FundingInstructionsBankTransferFinancialAddressAba : StripeEntity<FundingInstructionsBankTransferFinancialAddressAba>
{
/// <summary>
/// The ABA account number.
/// </summary>
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

/// <summary>
/// The bank name.
/// </summary>
[JsonProperty("bank_name")]
public string BankName { get; set; }

/// <summary>
/// The ABA routing number.
/// </summary>
[JsonProperty("routing_number")]
public string RoutingNumber { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class FundingInstructionsBankTransferFinancialAddressSwift : StripeEntity<FundingInstructionsBankTransferFinancialAddressSwift>
{
/// <summary>
/// The account number.
/// </summary>
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

/// <summary>
/// The bank name.
/// </summary>
[JsonProperty("bank_name")]
public string BankName { get; set; }

/// <summary>
/// The SWIFT code.
/// </summary>
[JsonProperty("swift_code")]
public string SwiftCode { get; set; }
}
}
32 changes: 32 additions & 0 deletions src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,38 @@ public Invoice Invoice
[JsonProperty("livemode")]
public bool Livemode { get; set; }

#region Expandable Margins

/// <summary>
/// (IDs of the Margins)
/// The margins which apply to the invoice item. When set, the <c>default_margins</c> on the
/// invoice do not apply to this invoice item.
/// </summary>
[JsonIgnore]
public List<string> MarginIds
{
get => this.InternalMargins?.Select((x) => x.Id).ToList();
set => this.InternalMargins = SetExpandableArrayIds<Margin>(value);
}

/// <summary>
/// (Expanded)
/// The margins which apply to the invoice item. When set, the <c>default_margins</c> on the
/// invoice do not apply to this invoice item.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public List<Margin> Margins
{
get => this.InternalMargins?.Select((x) => x.ExpandedObject).ToList();
set => this.InternalMargins = SetExpandableArrayObjects(value);
}

[JsonProperty("margins", ItemConverterType = typeof(ExpandableFieldConverter<Margin>))]
internal List<ExpandableField<Margin>> InternalMargins { get; set; }
#endregion

/// <summary>
/// Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
/// attach to an object. This can be useful for storing additional information about the
Expand Down
40 changes: 40 additions & 0 deletions src/Stripe.net/Entities/InvoiceLineItems/InvoiceLineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,46 @@ public InvoiceItem InvoiceItem
[JsonProperty("livemode")]
public bool Livemode { get; set; }

/// <summary>
/// The amount of margin calculated per margin for this line item.
/// </summary>
[JsonProperty("margin_amounts")]
public List<InvoiceLineItemMarginAmount> MarginAmounts { get; set; }

#region Expandable Margins

/// <summary>
/// (IDs of the Margins)
/// The margins applied to the line item. When set, the <c>default_margins</c> on the
/// invoice do not apply to the line item. Use <c>expand[]=margins</c> to expand each
/// margin.
/// </summary>
[JsonIgnore]
public List<string> MarginIds
{
get => this.InternalMargins?.Select((x) => x.Id).ToList();
set => this.InternalMargins = SetExpandableArrayIds<Margin>(value);
}

/// <summary>
/// (Expanded)
/// The margins applied to the line item. When set, the <c>default_margins</c> on the
/// invoice do not apply to the line item. Use <c>expand[]=margins</c> to expand each
/// margin.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public List<Margin> Margins
{
get => this.InternalMargins?.Select((x) => x.ExpandedObject).ToList();
set => this.InternalMargins = SetExpandableArrayObjects(value);
}

[JsonProperty("margins", ItemConverterType = typeof(ExpandableFieldConverter<Margin>))]
internal List<ExpandableField<Margin>> InternalMargins { get; set; }
#endregion

/// <summary>
/// Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
/// attach to an object. This can be useful for storing additional information about the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class InvoiceLineItemMarginAmount : StripeEntity<InvoiceLineItemMarginAmount>
{
/// <summary>
/// The amount, in cents (or local equivalent), of the reduction in line item amount.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

#region Expandable Margin

/// <summary>
/// (ID of the Margin)
/// The margin that was applied to get this margin amount.
/// </summary>
[JsonIgnore]
public string MarginId
{
get => this.InternalMargin?.Id;
set => this.InternalMargin = SetExpandableFieldId(value, this.InternalMargin);
}

/// <summary>
/// (Expanded)
/// The margin that was applied to get this margin amount.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Margin Margin
{
get => this.InternalMargin?.ExpandedObject;
set => this.InternalMargin = SetExpandableFieldObject(value, this.InternalMargin);
}

[JsonProperty("margin")]
[JsonConverter(typeof(ExpandableFieldConverter<Margin>))]
internal ExpandableField<Margin> InternalMargin { get; set; }
#endregion
}
}
38 changes: 38 additions & 0 deletions src/Stripe.net/Entities/Invoices/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,38 @@ public Customer Customer
[JsonProperty("customer_tax_ids")]
public List<InvoiceCustomerTaxId> CustomerTaxIds { get; set; }

#region Expandable DefaultMargins

/// <summary>
/// (IDs of the DefaultMargins)
/// The margins applied to the invoice. Can be overridden by line item <c>margins</c>. Use
/// <c>expand[]=default_margins</c> to expand each margin.
/// </summary>
[JsonIgnore]
public List<string> DefaultMarginIds
{
get => this.InternalDefaultMargins?.Select((x) => x.Id).ToList();
set => this.InternalDefaultMargins = SetExpandableArrayIds<Margin>(value);
}

/// <summary>
/// (Expanded)
/// The margins applied to the invoice. Can be overridden by line item <c>margins</c>. Use
/// <c>expand[]=default_margins</c> to expand each margin.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public List<Margin> DefaultMargins
{
get => this.InternalDefaultMargins?.Select((x) => x.ExpandedObject).ToList();
set => this.InternalDefaultMargins = SetExpandableArrayObjects(value);
}

[JsonProperty("default_margins", ItemConverterType = typeof(ExpandableFieldConverter<Margin>))]
internal List<ExpandableField<Margin>> InternalDefaultMargins { get; set; }
#endregion

#region Expandable DefaultPaymentMethod

/// <summary>
Expand Down Expand Up @@ -964,6 +996,12 @@ public TestHelpers.TestClock TestClock
[JsonProperty("total_excluding_tax")]
public long? TotalExcludingTax { get; set; }

/// <summary>
/// The aggregate amounts calculated per margin across all line items.
/// </summary>
[JsonProperty("total_margin_amounts")]
public List<InvoiceTotalMarginAmount> TotalMarginAmounts { get; set; }

/// <summary>
/// The aggregate amounts calculated per tax rate for all line items.
/// </summary>
Expand Down
46 changes: 46 additions & 0 deletions src/Stripe.net/Entities/Invoices/InvoiceTotalMarginAmount.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class InvoiceTotalMarginAmount : StripeEntity<InvoiceTotalMarginAmount>
{
/// <summary>
/// The amount, in cents (or local equivalent), of the reduction in line item amount.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

#region Expandable Margin

/// <summary>
/// (ID of the Margin)
/// The margin that was applied to get this margin amount.
/// </summary>
[JsonIgnore]
public string MarginId
{
get => this.InternalMargin?.Id;
set => this.InternalMargin = SetExpandableFieldId(value, this.InternalMargin);
}

/// <summary>
/// (Expanded)
/// The margin that was applied to get this margin amount.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Margin Margin
{
get => this.InternalMargin?.ExpandedObject;
set => this.InternalMargin = SetExpandableFieldObject(value, this.InternalMargin);
}

[JsonProperty("margin")]
[JsonConverter(typeof(ExpandableFieldConverter<Margin>))]
internal ExpandableField<Margin> InternalMargin { get; set; }
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ namespace Stripe.Issuing
using Stripe.Infrastructure;

/// <summary>
/// Every time an applicant submits an application for a Charge Card product your Platform
/// offers, or every time your Platform takes a proactive credit decision on an existing
/// account, you must record the decision by creating a new CreditUnderwritingRecord object
/// on a Connected account.
/// Every time an applicant submits an application for a Charge Card product your platform
/// offers, or every time your platform takes a proactive credit decision on an existing
/// account, you must record the decision by creating a new <c>CreditUnderwritingRecord</c>
/// object on a connected account.
///
/// <a href="https://stripe.com/docs/issuing/coming_soon">Follow the guide</a> to learn
/// about your requirements as a Platform.
/// <a
/// href="https://stripe.com/docs/issuing/credit/report-credit-decisions-and-manage-aans">Follow
/// the guide</a> to learn about your requirements as a platform.
/// </summary>
public class CreditUnderwritingRecord : StripeEntity<CreditUnderwritingRecord>, IHasId, IHasMetadata, IHasObject
{
Expand Down
Loading
Loading