diff --git a/CHANGELOG.md b/CHANGELOG.md index d852452cae..ee0dcc54b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,41 @@ This release changes the pinned API version to 2026-05-27.private. * Add support for snapshot event `PaymentIntentExpired` with resource `PaymentIntent` * Add support for event notifications `V2CoreHealthElementsErrorFiringEvent`, `V2CoreHealthElementsErrorResolvedEvent`, `V2CoreHealthInvoiceCountDroppedFiringEvent`, and `V2CoreHealthInvoiceCountDroppedResolvedEvent` +## 51.2.0 - 2026-05-27 +This release changes the pinned API version to 2026-05-27.dahlia. + +* [#3386](https://github.com/stripe/stripe-dotnet/pull/3386) Update generated code + * Add support for new resource `V2.Commerce.ProductCatalogImport` + * Add support for `Create` and `Get` methods on resource `V2.Commerce.ProductCatalogImport` + * Add support for `BizumPayments` and `ScalapayPayments` on `Account.Capabilities` and `AccountCapabilitiesOptions` + * Add support for `AutomaticTransferRulesByCurrency` on `BalanceSettings.Payments.Payouts` and `BalanceSettingsPaymentsPayoutsOptions` + * Add support for `StartOfDay` on `BalanceSettings.Payments.SettlementTiming` and `BalanceSettingsPaymentsSettlementTimingOptions` + * Add support for `Description` on `ChargeTransferDataOptions`, `PaymentIntent.TransferData`, and `PaymentIntentTransferDataOptions` + * Add support for `Bizum` on `Charge.PaymentMethodDetails`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenPaymentMethodDataOptions`, `PaymentAttemptRecord.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentPaymentMethodDataOptions`, `PaymentIntentPaymentMethodOptionsOptions`, `PaymentMethodConfigurationCreateOptions`, `PaymentMethodConfigurationUpdateOptions`, `PaymentMethodConfiguration`, `PaymentMethodCreateOptions`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetails`, `SetupIntent.PaymentMethodOptions`, `SetupIntentPaymentMethodDataOptions`, and `SetupIntentPaymentMethodOptionsOptions` + * Add support for `Scalapay` on `Charge.PaymentMethodDetails`, `Checkout.Session.PaymentMethodOptions`, `CheckoutSessionPaymentMethodOptionsOptions`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenPaymentMethodDataOptions`, `PaymentAttemptRecord.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentPaymentMethodDataOptions`, `PaymentIntentPaymentMethodOptionsOptions`, `PaymentMethodConfigurationCreateOptions`, `PaymentMethodConfigurationUpdateOptions`, `PaymentMethodConfiguration`, `PaymentMethodCreateOptions`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetails`, `Refund.DestinationDetails`, and `SetupIntentPaymentMethodDataOptions` + * Add support for `Mandate` on `Charge.PaymentMethodDetails.Twint`, `PaymentAttemptRecord.PaymentMethodDetails.Twint`, and `PaymentRecord.PaymentMethodDetails.Twint` + * Change type of `CheckoutSessionPaymentMethodOptionsTwintOptions.SetupFutureUsage` and `PaymentIntentPaymentMethodOptionsTwintOptions.SetupFutureUsage` from `literal('none')` to `enum('none'|'off_session')` + * ⚠️ Change type of `Checkout.Session.PaymentMethodOptions.Twint.SetupFutureUsage` and `PaymentIntent.PaymentMethodOptions.Twint.SetupFutureUsage` from `literal('none')` to `enum('none'|'off_session')` + * Add support for `CreditedItems` on `InvoiceItem.ProrationDetails` + * Add support for `Discountable` on `InvoiceScheduleDetailsPhaseAddInvoiceItemOptions`, `SubscriptionAddInvoiceItemOptions`, `SubscriptionSchedule.Phase.AddInvoiceItem`, and `SubscriptionSchedulePhaseAddInvoiceItemOptions` + * Add support for `BillingSchedules` on `InvoiceSubscriptionDetailsOptions`, `SubscriptionCreateOptions`, `SubscriptionUpdateOptions`, and `Subscription` + * Add support for `AmountPaidOffStripe` on `Invoice` + * Add support for `Twint` on `Mandate.PaymentMethodDetails` and `SetupAttempt.PaymentMethodDetails` + * Add support for `Metadata` on `PaymentIntent.TransferData`, `PaymentIntentTransferDataOptions`, and `Subscription.PendingUpdate` + * Add support for `PaymentData` on `PaymentIntent.TransferData` and `PaymentIntentTransferDataOptions` + * Add support for `BlikAuthorize` on `PaymentIntent.NextAction` and `SetupIntent.NextAction` + * Add support for `PaymentMethodOptions` on `PaymentLinkCreateOptions`, `PaymentLinkUpdateOptions`, and `PaymentLink` + * Add support for `Active` on `PaymentMethodConfigurationListOptions` + * Add support for `BilledUntil` on `SubscriptionItem` + * Add support for `Discount` and `Discounts` on `Subscription.PendingUpdate` + * Add support for `VerifoneM425`, `VerifoneP630`, `VerifoneUx700`, and `VerifoneV660p` on `Terminal.ConfigurationCreateOptions`, `Terminal.ConfigurationUpdateOptions`, and `Terminal.Configuration` + * Add support for `ApiError` and `PrintContent` on `Terminal.Reader.Action` + * Add support for `Customer` on `TestHelpers.TestClockCreateOptions` + * Add support for `Signer` on `V2.Core.Account.Identity.BusinessDetails.Documents.ProofOfRegistration`, `V2.Core.Account.Identity.BusinessDetails.Documents.ProofOfUltimateBeneficialOwnership`, `V2CoreAccountIdentityBusinessDetailsDocumentsProofOfRegistrationOptions`, `V2CoreAccountIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnershipOptions`, `V2CoreAccountTokenIdentityBusinessDetailsDocumentsProofOfRegistrationOptions`, and `V2CoreAccountTokenIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnershipOptions` + * Add support for `AzureEventGrid` on `V2.Core.EventDestinationCreateOptions` and `V2.Core.EventDestination` + * Add support for event notifications `V2CommerceProductCatalogImportsFailedEvent`, `V2CommerceProductCatalogImportsProcessingEvent`, `V2CommerceProductCatalogImportsSucceededEvent`, and `V2CommerceProductCatalogImportsSucceededWithErrorsEvent` with related object `V2.Commerce.ProductCatalogImport` +* [#3385](https://github.com/stripe/stripe-dotnet/pull/3385) Emit warning when `stripe-notify` header is present in response + ## 51.2.0-alpha.6 - 2026-05-20 * [#3384](https://github.com/stripe/stripe-dotnet/pull/3384) Update generated code for private-preview * Add support for new resource `PaymentLocationCapability` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 3e0fd8d327..759dc3b52e 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -1af5aa444ea8141a2d2b8d86e76c73f788f65e09 \ No newline at end of file +656489921ee220b536bc00fc1c8ee7ed528f24e2 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 30723023b8..bd44999eba 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2277 \ No newline at end of file +v2290 \ No newline at end of file diff --git a/src/Stripe.net/Constants/ApiVersion.cs b/src/Stripe.net/Constants/ApiVersion.cs index 4d8c8b7e15..07c2450002 100644 --- a/src/Stripe.net/Constants/ApiVersion.cs +++ b/src/Stripe.net/Constants/ApiVersion.cs @@ -3,6 +3,6 @@ namespace Stripe { internal class ApiVersion { - public const string Current = "2026-05-27.preview"; + public const string Current = "2026-06-03.preview"; } } \ No newline at end of file diff --git a/src/Stripe.net/Entities/Checkout/Sessions/SessionAutomaticSurcharge.cs b/src/Stripe.net/Entities/Checkout/Sessions/SessionAutomaticSurcharge.cs index 41d5125a4c..e104d69751 100644 --- a/src/Stripe.net/Entities/Checkout/Sessions/SessionAutomaticSurcharge.cs +++ b/src/Stripe.net/Entities/Checkout/Sessions/SessionAutomaticSurcharge.cs @@ -25,7 +25,7 @@ public class SessionAutomaticSurcharge : StripeEntity /// /// The surcharge provider used for this session. - /// One of: interpayments, or yeeld. + /// One of: interpayments, proserv, or yeeld. /// [JsonProperty("provider")] [STJS.JsonPropertyName("provider")] diff --git a/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEvent.cs b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEvent.cs new file mode 100644 index 0000000000..2f22b14ad7 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEvent.cs @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// An order event represents a change to a delegated checkout order. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderEvent : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// The adjustment details for this order event. + /// + [JsonProperty("adjustment")] + [STJS.JsonPropertyName("adjustment")] + public OrderEventAdjustment Adjustment { get; set; } + + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// + [JsonProperty("created")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("created")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The fulfillment details for this order event. + /// + [JsonProperty("fulfillment")] + [STJS.JsonPropertyName("fulfillment")] + public OrderEventFulfillment Fulfillment { get; set; } + + /// + /// If the object exists in live mode, the value is true. If the object exists in + /// test mode, the value is false. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// Time at which this event occurred. Measured in seconds since the Unix epoch. + /// + [JsonProperty("occurred_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("occurred_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime OccurredAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The delegated checkout order associated with this order event. + /// + [JsonProperty("order")] + [STJS.JsonPropertyName("order")] + public string Order { get; set; } + + /// + /// The requested session associated with this order event. + /// + [JsonProperty("requested_session")] + [STJS.JsonPropertyName("requested_session")] + public string RequestedSession { get; set; } + + /// + /// The type of order event. + /// One of: adjustment, or fulfillment. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustment.cs b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustment.cs new file mode 100644 index 0000000000..726033cedb --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustment.cs @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderEventAdjustment : StripeEntity + { + /// + /// The amount associated with the adjustment. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long? Amount { get; set; } + + /// + /// The currency associated with the adjustment amount. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// The description of the adjustment. + /// + [JsonProperty("description")] + [STJS.JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// The line items associated with the adjustment. + /// + [JsonProperty("line_items")] + [STJS.JsonPropertyName("line_items")] + public List LineItems { get; set; } + + /// + /// The status of the adjustment. + /// One of: completed, failed, or pending. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + + /// + /// The type of adjustment. + /// One of: cancellation, credit, dispute, + /// original_payment_refund, return, or store_credit_refund. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustmentLineItem.cs b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustmentLineItem.cs new file mode 100644 index 0000000000..c0743af4f6 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventAdjustmentLineItem.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderEventAdjustmentLineItem : StripeEntity + { + /// + /// The line item key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + /// + /// The quantity associated with the order event. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillment.cs b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillment.cs new file mode 100644 index 0000000000..16cf45ba23 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillment.cs @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderEventFulfillment : StripeEntity + { + /// + /// The carrier for the fulfillment. + /// + [JsonProperty("carrier")] + [STJS.JsonPropertyName("carrier")] + public string Carrier { get; set; } + + /// + /// Time at which the fulfillment was delivered. Measured in seconds since the Unix epoch. + /// + [JsonProperty("delivered_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("delivered_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? DeliveredAt { get; set; } + + /// + /// The line items associated with the fulfillment. + /// + [JsonProperty("line_items")] + [STJS.JsonPropertyName("line_items")] + public List LineItems { get; set; } + + /// + /// Time at which the fulfillment shipped. Measured in seconds since the Unix epoch. + /// + [JsonProperty("shipped_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("shipped_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? ShippedAt { get; set; } + + /// + /// The status of the fulfillment. + /// One of: confirmed, delivered, fulfilled, pending, + /// returned, or shipped. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + + /// + /// The tracking number for the fulfillment. + /// + [JsonProperty("tracking_number")] + [STJS.JsonPropertyName("tracking_number")] + public string TrackingNumber { get; set; } + + /// + /// The tracking URL for the fulfillment. + /// + [JsonProperty("tracking_url")] + [STJS.JsonPropertyName("tracking_url")] + public string TrackingUrl { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillmentLineItem.cs b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillmentLineItem.cs new file mode 100644 index 0000000000..212b26e064 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/OrderEvents/OrderEventFulfillmentLineItem.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderEventFulfillmentLineItem : StripeEntity + { + /// + /// The line item key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + /// + /// The quantity associated with the order event. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/Order.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/Order.cs new file mode 100644 index 0000000000..c1ec380088 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/Order.cs @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// An order represents the post-checkout lifecycle of a delegated checkout purchase. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class Order : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// + [JsonProperty("created")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("created")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Three-letter ISO currency + /// code, in lowercase. Must be a supported + /// currency. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// The latest order event for this order. + /// + [JsonProperty("latest_order_event")] + [STJS.JsonPropertyName("latest_order_event")] + public OrderEvent LatestOrderEvent { get; set; } + + /// + /// The line items in this order. + /// + [JsonProperty("line_items")] + [STJS.JsonPropertyName("line_items")] + public List LineItems { get; set; } + + /// + /// If the object exists in live mode, the value is true. If the object exists in + /// test mode, the value is false. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// The permalink URL for this order. + /// + [JsonProperty("permalink_url")] + [STJS.JsonPropertyName("permalink_url")] + public string PermalinkUrl { get; set; } + + /// + /// The requested session associated with this order. + /// + [JsonProperty("requested_session")] + [STJS.JsonPropertyName("requested_session")] + public string RequestedSession { get; set; } + + /// + /// The seller reference for this order. + /// + [JsonProperty("seller_reference")] + [STJS.JsonPropertyName("seller_reference")] + public string SellerReference { get; set; } + + /// + /// The totals for this order. + /// + [JsonProperty("totals")] + [STJS.JsonPropertyName("totals")] + public OrderTotals Totals { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItem.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItem.cs new file mode 100644 index 0000000000..3f2707c98e --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItem.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderLineItem : StripeEntity + { + /// + /// The order line item key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + [JsonProperty("product_details")] + [STJS.JsonPropertyName("product_details")] + public OrderLineItemProductDetails ProductDetails { get; set; } + + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public OrderLineItemQuantity Quantity { get; set; } + + /// + /// The SKU ID of the line item. + /// + [JsonProperty("sku_id")] + [STJS.JsonPropertyName("sku_id")] + public string SkuId { get; set; } + + /// + /// The totals for this line item. + /// + [JsonProperty("totals")] + [STJS.JsonPropertyName("totals")] + public OrderLineItemTotals Totals { get; set; } + + /// + /// The line item unit amount. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public long UnitAmount { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemProductDetails.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemProductDetails.cs new file mode 100644 index 0000000000..82952d74a1 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemProductDetails.cs @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderLineItemProductDetails : StripeEntity + { + /// + /// The item description. + /// + [JsonProperty("description")] + [STJS.JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// The item images. + /// + [JsonProperty("images")] + [STJS.JsonPropertyName("images")] + public List Images { get; set; } + + /// + /// The item title. + /// + [JsonProperty("title")] + [STJS.JsonPropertyName("title")] + public string Title { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemQuantity.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemQuantity.cs new file mode 100644 index 0000000000..dacbd4de08 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemQuantity.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderLineItemQuantity : StripeEntity + { + /// + /// The current quantity. + /// + [JsonProperty("current")] + [STJS.JsonPropertyName("current")] + public long Current { get; set; } + + /// + /// The ordered quantity. + /// + [JsonProperty("ordered")] + [STJS.JsonPropertyName("ordered")] + public long Ordered { get; set; } + + /// + /// The shipped quantity. + /// + [JsonProperty("shipped")] + [STJS.JsonPropertyName("shipped")] + public long Shipped { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemTotals.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemTotals.cs new file mode 100644 index 0000000000..7da3de27a5 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderLineItemTotals.cs @@ -0,0 +1,46 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderLineItemTotals : StripeEntity + { + /// + /// The base amount for the line item. + /// + [JsonProperty("base_amount")] + [STJS.JsonPropertyName("base_amount")] + public long? BaseAmount { get; set; } + + /// + /// The discount amount for the line item. + /// + [JsonProperty("discount")] + [STJS.JsonPropertyName("discount")] + public long? Discount { get; set; } + + /// + /// The subtotal amount for the line item. + /// + [JsonProperty("subtotal")] + [STJS.JsonPropertyName("subtotal")] + public long? Subtotal { get; set; } + + /// + /// The tax amount for the line item. + /// + [JsonProperty("tax")] + [STJS.JsonPropertyName("tax")] + public long? Tax { get; set; } + + /// + /// The total amount for the line item. + /// + [JsonProperty("total")] + [STJS.JsonPropertyName("total")] + public long? Total { get; set; } + } +} diff --git a/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderTotals.cs b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderTotals.cs new file mode 100644 index 0000000000..f68efe9483 --- /dev/null +++ b/src/Stripe.net/Entities/DelegatedCheckout/Orders/OrderTotals.cs @@ -0,0 +1,46 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class OrderTotals : StripeEntity + { + /// + /// The discount amount for the order. + /// + [JsonProperty("discount")] + [STJS.JsonPropertyName("discount")] + public long? Discount { get; set; } + + /// + /// The fulfillment amount for the order. + /// + [JsonProperty("fulfillment")] + [STJS.JsonPropertyName("fulfillment")] + public long? Fulfillment { get; set; } + + /// + /// The subtotal amount for the order. + /// + [JsonProperty("subtotal")] + [STJS.JsonPropertyName("subtotal")] + public long? Subtotal { get; set; } + + /// + /// The tax amount for the order. + /// + [JsonProperty("tax")] + [STJS.JsonPropertyName("tax")] + public long? Tax { get; set; } + + /// + /// The total amount for the order. + /// + [JsonProperty("total")] + [STJS.JsonPropertyName("total")] + public long? Total { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetails.cs b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetails.cs index e17a492567..7258300d6a 100644 --- a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetails.cs +++ b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetails.cs @@ -36,5 +36,22 @@ public class AuthorizationTokenDetails : StripeEntity [JsonProperty("network_data")] [STJS.JsonPropertyName("network_data")] public AuthorizationTokenDetailsNetworkData NetworkData { get; set; } + + /// + /// The decision made during token provisioning. + /// One of: approve, approve_pending_id_and_v, or decline. + /// + [JsonProperty("provisioning_decision")] + [STJS.JsonPropertyName("provisioning_decision")] + public string ProvisioningDecision { get; set; } + + /// + /// The type of the token, indicating how it is used. + /// One of: card_on_file, cloud_based, commerce_platform, + /// commercial_virtual_account, secure_element, or static_credential. + /// + [JsonProperty("token_type")] + [STJS.JsonPropertyName("token_type")] + public string TokenType { get; set; } } } diff --git a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs index 181b34c1dc..3dc44ca9c6 100644 --- a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs +++ b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs @@ -15,6 +15,15 @@ public class AuthorizationTokenDetailsNetworkDataVisa : StripeEntity + /// Stripe's recommendation to the network for this token activation request, derived from + /// the same risk signals used for the activation decision. + /// One of: approve, decline, or recommend_id_and_v. + /// + [JsonProperty("token_decision_recommendation")] + [STJS.JsonPropertyName("token_decision_recommendation")] + public string TokenDecisionRecommendation { get; set; } + /// /// The network-unique identifier for the token. /// diff --git a/src/Stripe.net/Entities/Issuing/Tokens/Token.cs b/src/Stripe.net/Entities/Issuing/Tokens/Token.cs index 2ea64226fe..eb182776f8 100644 --- a/src/Stripe.net/Entities/Issuing/Tokens/Token.cs +++ b/src/Stripe.net/Entities/Issuing/Tokens/Token.cs @@ -118,6 +118,14 @@ public Card Card [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] public DateTime NetworkUpdatedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + /// + /// The decision made during token provisioning. + /// One of: approve, approve_pending_id_and_v, or decline. + /// + [JsonProperty("provisioning_decision")] + [STJS.JsonPropertyName("provisioning_decision")] + public string ProvisioningDecision { get; set; } + /// /// The usage state of the token. /// One of: active, deleted, requested, or suspended. @@ -126,6 +134,15 @@ public Card Card [STJS.JsonPropertyName("status")] public string Status { get; set; } + /// + /// The type of the token, indicating how it is used. + /// One of: card_on_file, cloud_based, commerce_platform, + /// commercial_virtual_account, secure_element, or static_credential. + /// + [JsonProperty("token_type")] + [STJS.JsonPropertyName("token_type")] + public string TokenType { get; set; } + /// /// The digital wallet for this token, if one was used. /// One of: apple_pay, google_pay, or samsung_pay. diff --git a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataDevice.cs b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataDevice.cs index 4fe331ea78..97acf4c320 100644 --- a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataDevice.cs +++ b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataDevice.cs @@ -22,6 +22,37 @@ public class TokenNetworkDataDevice : StripeEntity [STJS.JsonPropertyName("ip_address")] public string IpAddress { get; set; } + /// + /// The ISO 639-1 language code of the device associated with the tokenization request. + /// One of: aa, ab, ae, af, ak, am, an, + /// ar, as, av, ay, az, ba, be, bg, + /// bi, bm, bn, bo, br, bs, ca, ce, + /// ch, co, cr, cs, cu, cv, cy, da, + /// de, dv, dz, ee, el, en, eo, es, + /// et, eu, fa, ff, fi, fj, fo, fr, + /// fy, ga, gd, gl, gn, gu, gv, ha, + /// he, hi, ho, hr, ht, hu, hy, hz, + /// ia, id, ie, ig, ii, ik, io, is, + /// it, iu, ja, jv, ka, kg, ki, kj, + /// kk, kl, km, kn, ko, kr, ks, ku, + /// kv, kw, ky, la, lb, lg, li, ln, + /// lo, lt, lu, lv, mg, mh, mi, mk, + /// ml, mn, mr, ms, mt, my, na, nb, + /// nd, ne, ng, nl, nn, no, nr, nv, + /// ny, oc, oj, om, or, os, pa, pi, + /// pl, ps, pt, qu, rm, rn, ro, ru, + /// rw, sa, sc, sd, se, sg, si, sk, + /// sl, sm, sn, so, sq, sr, ss, st, + /// su, sv, sw, ta, te, tg, th, ti, + /// tk, tl, tn, to, tr, ts, tt, tw, + /// ty, ug, uk, ur, uz, ve, vi, vo, + /// wa, wo, xh, yi, yo, za, zh, or + /// zu. + /// + [JsonProperty("language")] + [STJS.JsonPropertyName("language")] + public string Language { get; set; } + /// /// The geographic latitude/longitude coordinates of the device at provisioning time. The /// format is [+-]decimal/[+-]decimal. diff --git a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs index f710575041..743cf711f6 100644 --- a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs +++ b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs @@ -15,6 +15,15 @@ public class TokenNetworkDataVisa : StripeEntity [STJS.JsonPropertyName("card_reference_id")] public string CardReferenceId { get; set; } + /// + /// Stripe's recommendation to the network for this token activation request, derived from + /// the same risk signals used for the activation decision. + /// One of: approve, decline, or recommend_id_and_v. + /// + [JsonProperty("token_decision_recommendation")] + [STJS.JsonPropertyName("token_decision_recommendation")] + public string TokenDecisionRecommendation { get; set; } + /// /// The network-unique identifier for the token. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetailsMoneyServices.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetailsMoneyServices.cs index 669db23cdf..2db6f1ff66 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetailsMoneyServices.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetailsMoneyServices.cs @@ -14,6 +14,7 @@ public class PaymentIntentPaymentDetailsMoneyServices : StripeEntity /// The type of money services transaction. + /// One of: account_funding, or debt_repayment. /// [JsonProperty("transaction_type")] [STJS.JsonPropertyName("transaction_type")] diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs index 304037551a..9b1fb5b652 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs @@ -18,5 +18,13 @@ public class PaymentIntentPaymentMethodOptionsCryptoDepositOptions : StripeEntit [JsonProperty("networks")] [STJS.JsonPropertyName("networks")] public List Networks { get; set; } + + /// + /// If true, provisions a permanent per-customer deposit address reused across + /// PaymentIntents. + /// + [JsonProperty("static_address")] + [STJS.JsonPropertyName("static_address")] + public bool StaticAddress { get; set; } } } diff --git a/src/Stripe.net/Entities/PaymentLinks/PaymentLinkAutomaticSurcharge.cs b/src/Stripe.net/Entities/PaymentLinks/PaymentLinkAutomaticSurcharge.cs index 484b1bbce7..9858e16d95 100644 --- a/src/Stripe.net/Entities/PaymentLinks/PaymentLinkAutomaticSurcharge.cs +++ b/src/Stripe.net/Entities/PaymentLinks/PaymentLinkAutomaticSurcharge.cs @@ -25,7 +25,7 @@ public class PaymentLinkAutomaticSurcharge : StripeEntity /// The surcharge provider used for this payment link. - /// One of: interpayments, or yeeld. + /// One of: interpayments, proserv, or yeeld. /// [JsonProperty("provider")] [STJS.JsonPropertyName("provider")] diff --git a/src/Stripe.net/Entities/PaymentLocationCapabilities/PaymentLocationCapability.cs b/src/Stripe.net/Entities/PaymentLocationCapabilities/PaymentLocationCapability.cs index 42060b8382..96856e13bf 100644 --- a/src/Stripe.net/Entities/PaymentLocationCapabilities/PaymentLocationCapability.cs +++ b/src/Stripe.net/Entities/PaymentLocationCapabilities/PaymentLocationCapability.cs @@ -7,8 +7,8 @@ namespace Stripe using STJS = System.Text.Json.Serialization; /// - /// A Payment Location Capability represents a capability for a Stripe account at a Payment - /// Location. + /// A payment_location capability represents a capability for a Stripe account at a + /// payment location. /// [STJS.JsonConverter(typeof(STJStripeEntityConverter))] public class PaymentLocationCapability : StripeEntity, IHasObject, IHasId @@ -21,7 +21,7 @@ public class PaymentLocationCapability : StripeEntity public string Object { get; set; } /// - /// The account for which the capability enables functionality. + /// The account that the capability enables functionality for. /// [JsonProperty("account")] [STJS.JsonPropertyName("account")] @@ -43,7 +43,7 @@ public class PaymentLocationCapability : StripeEntity public bool Livemode { get; set; } /// - /// The payment location for which the capability enables functionality. + /// The payment location that the capability enables functionality for. /// [JsonProperty("location")] [STJS.JsonPropertyName("location")] @@ -57,7 +57,7 @@ public class PaymentLocationCapability : StripeEntity public bool Requested { get; set; } /// - /// Time at which the capability was requested. Measured in seconds since the Unix epoch. + /// Time when the capability was requested. Measured in seconds since the Unix epoch. /// [JsonProperty("requested_at")] [JsonConverter(typeof(UnixDateTimeConverter))] diff --git a/src/Stripe.net/Entities/PaymentLocations/PaymentLocation.cs b/src/Stripe.net/Entities/PaymentLocations/PaymentLocation.cs index 4d16168959..fb2a290844 100644 --- a/src/Stripe.net/Entities/PaymentLocations/PaymentLocation.cs +++ b/src/Stripe.net/Entities/PaymentLocations/PaymentLocation.cs @@ -38,7 +38,7 @@ public class PaymentLocation : StripeEntity, IHasId, IHasObject /// /// The capability settings for the location. Only applicable for locations with requested - /// Payment Location Capabilities. + /// payment location capabilities. /// [JsonProperty("capability_settings")] [STJS.JsonPropertyName("capability_settings")] diff --git a/src/Stripe.net/Entities/Persons/Person.cs b/src/Stripe.net/Entities/Persons/Person.cs index 484aba5e32..c1190d201f 100644 --- a/src/Stripe.net/Entities/Persons/Person.cs +++ b/src/Stripe.net/Entities/Persons/Person.cs @@ -68,6 +68,10 @@ public class Person : StripeEntity, IHasId, IHasMetadata, IHasObject [STJS.JsonPropertyName("address_kanji")] public AddressJapan AddressKanji { get; set; } + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public Address BirthAddress { get; set; } + /// /// Time at which the object was created. Measured in seconds since the Unix epoch. /// diff --git a/src/Stripe.net/Entities/V2/Billing/ContractLicensePricingQuantityChanges/ContractLicensePricingQuantityChange.cs b/src/Stripe.net/Entities/V2/Billing/ContractLicensePricingQuantityChanges/ContractLicensePricingQuantityChange.cs new file mode 100644 index 0000000000..230e74e630 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/ContractLicensePricingQuantityChanges/ContractLicensePricingQuantityChange.cs @@ -0,0 +1,81 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// A license pricing quantity change object returned by ListContractLicenseQuantityChanges. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractLicensePricingQuantityChange : StripeEntity, IHasId, IHasObject + { + /// + /// The ID of the quantity change object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value of + /// the object field. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// The timestamp when this quantity change object was created. + /// + [JsonProperty("created")] + [STJS.JsonPropertyName("created")] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The timestamp when this quantity change takes effect. + /// + [JsonProperty("effective_at")] + [STJS.JsonPropertyName("effective_at")] + public DateTime EffectiveAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The ID of the license pricing. + /// + [JsonProperty("license_pricing_id")] + [STJS.JsonPropertyName("license_pricing_id")] + public string LicensePricingId { get; set; } + + /// + /// The type of the license pricing. + /// One of: license_fee, or price. + /// + [JsonProperty("license_pricing_type")] + [STJS.JsonPropertyName("license_pricing_type")] + public string LicensePricingType { get; set; } + + /// + /// Has the value true if the object exists in live mode or the value false if + /// the object exists in test mode. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// The ID of the pricing line associated with this quantity change. + /// + [JsonProperty("pricing_line")] + [STJS.JsonPropertyName("pricing_line")] + public string PricingLine { get; set; } + + /// + /// The quantity at the effective time. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/Contract.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/Contract.cs new file mode 100644 index 0000000000..c4878663df --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/Contract.cs @@ -0,0 +1,143 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// Main Contract resource representing a comprehensive billing agreement. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class Contract : StripeEntity, IHasId, IHasMetadata, IHasObject + { + /// + /// The ID of the contract object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value of + /// the object field. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// The billing settings for the contract. + /// + [JsonProperty("billing_settings")] + [STJS.JsonPropertyName("billing_settings")] + public ContractBillingSettings BillingSettings { get; set; } + + /// + /// The contract line details of the contract. Only populated when + /// contract_line_details is passed in the include parameter. + /// + [JsonProperty("contract_line_details")] + [STJS.JsonPropertyName("contract_line_details")] + public List ContractLineDetails { get; set; } + + /// + /// A unique user-provided contract number e.g. C-2026-0001. + /// + [JsonProperty("contract_number")] + [STJS.JsonPropertyName("contract_number")] + public string ContractNumber { get; set; } + + /// + /// The computed total value of all contract lines. + /// + [JsonProperty("contract_value_details")] + [STJS.JsonPropertyName("contract_value_details")] + public ContractContractValueDetails ContractValueDetails { get; set; } + + /// + /// Timestamp of when the object was created. + /// + [JsonProperty("created")] + [STJS.JsonPropertyName("created")] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The currency of the contract. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// The ID of the customer associated with the contract. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + + /// + /// The license quantities of the contract. Only populated when license_quantities is + /// passed in the include parameter. + /// + [JsonProperty("license_quantities")] + [STJS.JsonPropertyName("license_quantities")] + public List LicenseQuantities { get; set; } + + /// + /// Has the value true if the object exists in live mode or the value false if + /// the object exists in test mode. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The one-time fees of the contract. Only populated when one_time_fees is passed in + /// the include parameter. + /// + [JsonProperty("one_time_fees")] + [STJS.JsonPropertyName("one_time_fees")] + public List OneTimeFees { get; set; } + + /// + /// The pricing lines of the contract. Only populated when pricing_lines is passed in + /// the include parameter. + /// + [JsonProperty("pricing_lines")] + [STJS.JsonPropertyName("pricing_lines")] + public List PricingLines { get; set; } + + /// + /// The pricing overrides of the contract. Only populated when pricing_overrides is + /// passed in the include parameter. + /// + [JsonProperty("pricing_overrides")] + [STJS.JsonPropertyName("pricing_overrides")] + public List PricingOverrides { get; set; } + + /// + /// The current status of the contract. + /// One of: active, canceled, draft, or ended. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + + /// + /// Information about the contract status transitions. + /// + [JsonProperty("status_details")] + [STJS.JsonPropertyName("status_details")] + public ContractStatusDetails StatusDetails { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettings.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettings.cs new file mode 100644 index 0000000000..be89c8c9c7 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettings.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettings : StripeEntity + { + /// + /// Billing settings details for the contract. + /// + [JsonProperty("contract_billing_details")] + [STJS.JsonPropertyName("contract_billing_details")] + public ContractBillingSettingsContractBillingDetails ContractBillingDetails { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetails.cs new file mode 100644 index 0000000000..26c1ea48c4 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetails.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetails : StripeEntity + { + /// + /// The bill settings details. + /// + [JsonProperty("bill_settings_details")] + [STJS.JsonPropertyName("bill_settings_details")] + public ContractBillingSettingsContractBillingDetailsBillSettingsDetails BillSettingsDetails { get; set; } + + /// + /// The billing profile details. + /// + [JsonProperty("billing_profile_details")] + [STJS.JsonPropertyName("billing_profile_details")] + public ContractBillingSettingsContractBillingDetailsBillingProfileDetails BillingProfileDetails { get; set; } + + /// + /// The collection settings details. + /// + [JsonProperty("collection_settings_details")] + [STJS.JsonPropertyName("collection_settings_details")] + public ContractBillingSettingsContractBillingDetailsCollectionSettingsDetails CollectionSettingsDetails { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetails.cs new file mode 100644 index 0000000000..c9e0bf0bb4 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetails.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillSettingsDetails : StripeEntity + { + /// + /// Calculation settings. + /// + [JsonProperty("calculation")] + [STJS.JsonPropertyName("calculation")] + public ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation Calculation { get; set; } + + /// + /// Invoice settings. + /// + [JsonProperty("invoice")] + [STJS.JsonPropertyName("invoice")] + public ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice Invoice { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation.cs new file mode 100644 index 0000000000..abc97e93cf --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation : StripeEntity + { + /// + /// Tax calculation settings. + /// + [JsonProperty("tax")] + [STJS.JsonPropertyName("tax")] + public ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax Tax { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax.cs new file mode 100644 index 0000000000..42a64c96fe --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax : StripeEntity + { + /// + /// The type of tax calculation. + /// One of: automatic, or manual. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice.cs new file mode 100644 index 0000000000..e898507314 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice : StripeEntity + { + /// + /// The number of time units before the invoice is past due. + /// + [JsonProperty("time_until_due")] + [STJS.JsonPropertyName("time_until_due")] + public ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue TimeUntilDue { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue.cs new file mode 100644 index 0000000000..c70ecdc1e2 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue : StripeEntity + { + /// + /// The interval unit. + /// One of: day, month, week, or year. + /// + [JsonProperty("interval")] + [STJS.JsonPropertyName("interval")] + public string Interval { get; set; } + + /// + /// The number of intervals. + /// + [JsonProperty("interval_count")] + [STJS.JsonPropertyName("interval_count")] + public long IntervalCount { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillingProfileDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillingProfileDetails.cs new file mode 100644 index 0000000000..e36d668af9 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsBillingProfileDetails.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsBillingProfileDetails : StripeEntity + { + /// + /// The customer who pays for the contract invoice. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + + /// + /// The default payment method for the contract. + /// + [JsonProperty("default_payment_method")] + [STJS.JsonPropertyName("default_payment_method")] + public string DefaultPaymentMethod { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsCollectionSettingsDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsCollectionSettingsDetails.cs new file mode 100644 index 0000000000..76cd270d97 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractBillingSettingsContractBillingDetailsCollectionSettingsDetails.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractBillingSettingsContractBillingDetailsCollectionSettingsDetails : StripeEntity + { + /// + /// The collection method. + /// One of: charge_automatically, or send_invoice. + /// + [JsonProperty("collection_method")] + [STJS.JsonPropertyName("collection_method")] + public string CollectionMethod { get; set; } + + /// + /// The payment method configuration. + /// + [JsonProperty("payment_method_configuration")] + [STJS.JsonPropertyName("payment_method_configuration")] + public string PaymentMethodConfiguration { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetail.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetail.cs new file mode 100644 index 0000000000..3fe5a525b1 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetail.cs @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetail : StripeEntity, IHasMetadata + { + /// + /// The ID of the contract line. + /// + [JsonProperty("contract_line")] + [STJS.JsonPropertyName("contract_line")] + public string ContractLine { get; set; } + + /// + /// The computed value details for the contract line. + /// + [JsonProperty("contract_line_value_details")] + [STJS.JsonPropertyName("contract_line_value_details")] + public ContractContractLineDetailContractLineValueDetails ContractLineValueDetails { get; set; } + + /// + /// Timestamp of when the object was created. + /// + [JsonProperty("created")] + [STJS.JsonPropertyName("created")] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Timestamp to indicate when the contract line ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractContractLineDetailEndsAt EndsAt { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// List of overrides applied to the contract line. + /// + [JsonProperty("overrides")] + [STJS.JsonPropertyName("overrides")] + public List Overrides { get; set; } + + /// + /// The pricing configuration for the contract line. + /// + [JsonProperty("pricing")] + [STJS.JsonPropertyName("pricing")] + public ContractContractLineDetailPricing Pricing { get; set; } + + /// + /// Timestamp to indicate when the contract line starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractContractLineDetailStartsAt StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailContractLineValueDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailContractLineValueDetails.cs new file mode 100644 index 0000000000..e5fd9809e9 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailContractLineValueDetails.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailContractLineValueDetails : StripeEntity + { + /// + /// Computed sum of all licensed fees. Represented as a decimal string in minor currency + /// units. + /// + [JsonProperty("total")] + [STJS.JsonPropertyName("total")] + public string Total { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailEndsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailEndsAt.cs new file mode 100644 index 0000000000..37855b04a5 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailEndsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailEndsAt : StripeEntity + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverride.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverride.cs new file mode 100644 index 0000000000..847feca4e3 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverride.cs @@ -0,0 +1,39 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverride : StripeEntity + { + /// + /// Timestamp to indicate when the override ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractContractLineDetailOverrideEndsAt EndsAt { get; set; } + + /// + /// Service action override details. + /// + [JsonProperty("service_action")] + [STJS.JsonPropertyName("service_action")] + public ContractContractLineDetailOverrideServiceAction ServiceAction { get; set; } + + /// + /// Timestamp to indicate when the override starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractContractLineDetailOverrideStartsAt StartsAt { get; set; } + + /// + /// The type of the override. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideEndsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideEndsAt.cs new file mode 100644 index 0000000000..cd59b61462 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideEndsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideEndsAt : StripeEntity + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceAction.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceAction.cs new file mode 100644 index 0000000000..42f319ce6e --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceAction.cs @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceAction : StripeEntity + { + /// + /// Parameters for adding a new service action. + /// + [JsonProperty("add")] + [STJS.JsonPropertyName("add")] + public ContractContractLineDetailOverrideServiceActionAdd Add { get; set; } + + /// + /// Parameters for replacing an existing service action. + /// + [JsonProperty("replace")] + [STJS.JsonPropertyName("replace")] + public ContractContractLineDetailOverrideServiceActionReplace Replace { get; set; } + + /// + /// The type of service action override. + /// One of: add, or replace. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAdd.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAdd.cs new file mode 100644 index 0000000000..345ed6e986 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAdd.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAdd : StripeEntity + { + /// + /// Details for the credit grant. Required if type is credit_grant. + /// + [JsonProperty("credit_grant")] + [STJS.JsonPropertyName("credit_grant")] + public ContractContractLineDetailOverrideServiceActionAddCreditGrant CreditGrant { get; set; } + + /// + /// The interval for assessing service. + /// One of: day, month, week, or year. + /// + [JsonProperty("service_interval")] + [STJS.JsonPropertyName("service_interval")] + public string ServiceInterval { get; set; } + + /// + /// The length of the interval for assessing service. + /// + [JsonProperty("service_interval_count")] + [STJS.JsonPropertyName("service_interval_count")] + public long ServiceIntervalCount { get; set; } + + /// + /// The type of the service action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrant.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrant.cs new file mode 100644 index 0000000000..f68feabf36 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrant.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAddCreditGrant : StripeEntity + { + /// + /// The amount of the credit grant. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public ContractContractLineDetailOverrideServiceActionAddCreditGrantAmount Amount { get; set; } + + /// + /// Defines the scope where the credit grant is applicable. + /// + [JsonProperty("applicability_config")] + [STJS.JsonPropertyName("applicability_config")] + public ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfig ApplicabilityConfig { get; set; } + + /// + /// The category of the credit grant. + /// One of: paid, or promotional. + /// + [JsonProperty("category")] + [STJS.JsonPropertyName("category")] + public string Category { get; set; } + + /// + /// The expiry configuration for the credit grant. + /// + [JsonProperty("expiry_config")] + [STJS.JsonPropertyName("expiry_config")] + public ContractContractLineDetailOverrideServiceActionAddCreditGrantExpiryConfig ExpiryConfig { get; set; } + + /// + /// A descriptive name. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The desired priority for applying this credit grant. The highest priority is 0 and the + /// lowest is 100. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantAmount.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantAmount.cs new file mode 100644 index 0000000000..7913cc0846 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantAmount.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAddCreditGrantAmount : StripeEntity + { + /// + /// The monetary amount of the credit grant. Required if type is monetary. + /// + [JsonProperty("monetary")] + [STJS.JsonPropertyName("monetary")] + public V2.Amount Monetary { get; set; } + + /// + /// The type of the credit grant amount. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfig.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfig.cs new file mode 100644 index 0000000000..ba131bd6c9 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfig.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfig : StripeEntity + { + /// + /// The applicability scope of the credit grant. + /// + [JsonProperty("scope")] + [STJS.JsonPropertyName("scope")] + public ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfigScope Scope { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfigScope.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfigScope.cs new file mode 100644 index 0000000000..ded290a7d5 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfigScope.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAddCreditGrantApplicabilityConfigScope : StripeEntity + { + /// + /// The billable items to apply the credit grant to. + /// + [JsonProperty("billable_items")] + [STJS.JsonPropertyName("billable_items")] + public List BillableItems { get; set; } + + /// + /// The price type that credit grants can apply to. + /// + [JsonProperty("price_type")] + [STJS.JsonPropertyName("price_type")] + public string PriceType { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantExpiryConfig.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantExpiryConfig.cs new file mode 100644 index 0000000000..90b0e46b38 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionAddCreditGrantExpiryConfig.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionAddCreditGrantExpiryConfig : StripeEntity + { + /// + /// The type of the expiry configuration. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplace.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplace.cs new file mode 100644 index 0000000000..88ee7e5863 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplace.cs @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplace : StripeEntity, IHasId + { + /// + /// Details for the credit grant. Required if type is credit_grant. + /// + [JsonProperty("credit_grant")] + [STJS.JsonPropertyName("credit_grant")] + public ContractContractLineDetailOverrideServiceActionReplaceCreditGrant CreditGrant { get; set; } + + /// + /// The ID of the service action to replace. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// The lookup key for the service action to replace. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// The interval for assessing service. + /// One of: day, month, week, or year. + /// + [JsonProperty("service_interval")] + [STJS.JsonPropertyName("service_interval")] + public string ServiceInterval { get; set; } + + /// + /// The length of the interval for assessing service. + /// + [JsonProperty("service_interval_count")] + [STJS.JsonPropertyName("service_interval_count")] + public long ServiceIntervalCount { get; set; } + + /// + /// The type of the service action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrant.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrant.cs new file mode 100644 index 0000000000..395dd84a93 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrant.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplaceCreditGrant : StripeEntity + { + /// + /// The amount of the credit grant. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public ContractContractLineDetailOverrideServiceActionReplaceCreditGrantAmount Amount { get; set; } + + /// + /// Defines the scope where the credit grant is applicable. + /// + [JsonProperty("applicability_config")] + [STJS.JsonPropertyName("applicability_config")] + public ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfig ApplicabilityConfig { get; set; } + + /// + /// The category of the credit grant. + /// One of: paid, or promotional. + /// + [JsonProperty("category")] + [STJS.JsonPropertyName("category")] + public string Category { get; set; } + + /// + /// The expiry configuration for the credit grant. + /// + [JsonProperty("expiry_config")] + [STJS.JsonPropertyName("expiry_config")] + public ContractContractLineDetailOverrideServiceActionReplaceCreditGrantExpiryConfig ExpiryConfig { get; set; } + + /// + /// A descriptive name. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The desired priority for applying this credit grant. The highest priority is 0 and the + /// lowest is 100. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantAmount.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantAmount.cs new file mode 100644 index 0000000000..64e862150f --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantAmount.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplaceCreditGrantAmount : StripeEntity + { + /// + /// The monetary amount of the credit grant. Required if type is monetary. + /// + [JsonProperty("monetary")] + [STJS.JsonPropertyName("monetary")] + public V2.Amount Monetary { get; set; } + + /// + /// The type of the credit grant amount. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfig.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfig.cs new file mode 100644 index 0000000000..fdb4f71ae2 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfig.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfig : StripeEntity + { + /// + /// The applicability scope of the credit grant. + /// + [JsonProperty("scope")] + [STJS.JsonPropertyName("scope")] + public ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope Scope { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope.cs new file mode 100644 index 0000000000..9b2ebfd5db --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope : StripeEntity + { + /// + /// The billable items to apply the credit grant to. + /// + [JsonProperty("billable_items")] + [STJS.JsonPropertyName("billable_items")] + public List BillableItems { get; set; } + + /// + /// The price type that credit grants can apply to. + /// + [JsonProperty("price_type")] + [STJS.JsonPropertyName("price_type")] + public string PriceType { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantExpiryConfig.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantExpiryConfig.cs new file mode 100644 index 0000000000..897bbbfe7e --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideServiceActionReplaceCreditGrantExpiryConfig.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideServiceActionReplaceCreditGrantExpiryConfig : StripeEntity + { + /// + /// The type of the expiry configuration. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideStartsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideStartsAt.cs new file mode 100644 index 0000000000..a911d5a4fd --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailOverrideStartsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailOverrideStartsAt : StripeEntity + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailPricing.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailPricing.cs new file mode 100644 index 0000000000..03947ca690 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailPricing.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailPricing : StripeEntity + { + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailStartsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailStartsAt.cs new file mode 100644 index 0000000000..d780244bc9 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractLineDetailStartsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractLineDetailStartsAt : StripeEntity + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractValueDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractValueDetails.cs new file mode 100644 index 0000000000..58f1e089cd --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractContractValueDetails.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractContractValueDetails : StripeEntity + { + /// + /// The total value represented as a decimal string in minor currency units. + /// + [JsonProperty("total")] + [STJS.JsonPropertyName("total")] + public string Total { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractLicenseQuantity.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractLicenseQuantity.cs new file mode 100644 index 0000000000..524e8017a2 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractLicenseQuantity.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractLicenseQuantity : StripeEntity + { + /// + /// The ID of the license pricing. + /// + [JsonProperty("license_pricing_id")] + [STJS.JsonPropertyName("license_pricing_id")] + public string LicensePricingId { get; set; } + + /// + /// The type of the license pricing. + /// One of: license_fee, or price. + /// + [JsonProperty("license_pricing_type")] + [STJS.JsonPropertyName("license_pricing_type")] + public string LicensePricingType { get; set; } + + /// + /// The ID of the pricing line associated with this license quantity. + /// + [JsonProperty("pricing_line")] + [STJS.JsonPropertyName("pricing_line")] + public string PricingLine { get; set; } + + /// + /// The current quantity of the license. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFee.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFee.cs new file mode 100644 index 0000000000..5332f8bdd8 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFee.cs @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractOneTimeFee : StripeEntity + { + /// + /// The resolved bill schedule for the fee. + /// + [JsonProperty("bill_schedule")] + [STJS.JsonPropertyName("bill_schedule")] + public List BillSchedule { get; set; } + + /// + /// The type of billable item that this fee references. + /// + [JsonProperty("billable_item_type")] + [STJS.JsonPropertyName("billable_item_type")] + public string BillableItemType { get; set; } + + /// + /// Details for a product billable target. Set when billable_item_type is + /// product. + /// + [JsonProperty("product_details")] + [STJS.JsonPropertyName("product_details")] + public ContractOneTimeFeeProductDetails ProductDetails { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillSchedule.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillSchedule.cs new file mode 100644 index 0000000000..1e7bb90ad7 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillSchedule.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractOneTimeFeeBillSchedule : StripeEntity + { + /// + /// When this entry will be billed. + /// + [JsonProperty("bill_at")] + [STJS.JsonPropertyName("bill_at")] + public ContractOneTimeFeeBillScheduleBillAt BillAt { get; set; } + + /// + /// The amount to bill for this entry, in the smallest currency unit. + /// + [JsonProperty("value")] + [JsonConverter(typeof(Int64StringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("value")] + public long Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillScheduleBillAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillScheduleBillAt.cs new file mode 100644 index 0000000000..7648a74396 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeBillScheduleBillAt.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractOneTimeFeeBillScheduleBillAt : StripeEntity + { + /// + /// The datetime at which the entry will be billed. Set when type is datetime. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// The type of the bill_at. + /// One of: contract_start, or datetime. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeProductDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeProductDetails.cs new file mode 100644 index 0000000000..d6fddc2867 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractOneTimeFeeProductDetails.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractOneTimeFeeProductDetails : StripeEntity + { + /// + /// The ID of the v1 Product. + /// + [JsonProperty("product")] + [STJS.JsonPropertyName("product")] + public string Product { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLine.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLine.cs new file mode 100644 index 0000000000..ba2283d31c --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLine.cs @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingLine : StripeEntity, IHasMetadata + { + /// + /// Resolved timestamp when the pricing line ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractPricingLineEndsAt EndsAt { get; set; } + + /// + /// The user-provided lookup key for the pricing line. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The pricing configuration for the pricing line. + /// + [JsonProperty("pricing")] + [STJS.JsonPropertyName("pricing")] + public ContractPricingLinePricing Pricing { get; set; } + + /// + /// The ID of the pricing line. + /// + [JsonProperty("pricing_line")] + [STJS.JsonPropertyName("pricing_line")] + public string PricingLine { get; set; } + + /// + /// Resolved timestamp when the pricing line starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractPricingLineStartsAt StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineEndsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineEndsAt.cs new file mode 100644 index 0000000000..08e39719ba --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineEndsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingLineEndsAt : StripeEntity + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricing.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricing.cs new file mode 100644 index 0000000000..24d875ccb7 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricing.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingLinePricing : StripeEntity + { + /// + /// V1 price details. Present when type is price. + /// + [JsonProperty("price_details")] + [STJS.JsonPropertyName("price_details")] + public ContractPricingLinePricingPriceDetails PriceDetails { get; set; } + + /// + /// The type of pricing. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricingPriceDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricingPriceDetails.cs new file mode 100644 index 0000000000..67f684a44c --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLinePricingPriceDetails.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingLinePricingPriceDetails : StripeEntity + { + /// + /// The ID of the V1 price. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineStartsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineStartsAt.cs new file mode 100644 index 0000000000..e1c252c708 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingLineStartsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingLineStartsAt : StripeEntity + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverride.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverride.cs new file mode 100644 index 0000000000..eba45d0ab5 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverride.cs @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverride : StripeEntity + { + /// + /// Resolved timestamp when the pricing override ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractPricingOverrideEndsAt EndsAt { get; set; } + + /// + /// The user-provided lookup key for the pricing override. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// Details for a multiplier override. + /// + [JsonProperty("multiplier")] + [STJS.JsonPropertyName("multiplier")] + public ContractPricingOverrideMultiplier Multiplier { get; set; } + + /// + /// Details for an overwrite_price override. + /// + [JsonProperty("overwrite_price")] + [STJS.JsonPropertyName("overwrite_price")] + public ContractPricingOverrideOverwritePrice OverwritePrice { get; set; } + + /// + /// The ID of the pricing override. + /// + [JsonProperty("pricing_override")] + [STJS.JsonPropertyName("pricing_override")] + public string PricingOverride { get; set; } + + /// + /// The priority of this override relative to others. Lower number = higher priority. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long Priority { get; set; } + + /// + /// Resolved timestamp when the pricing override starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractPricingOverrideStartsAt StartsAt { get; set; } + + /// + /// The type of pricing override. + /// One of: multiplier, or overwrite_price. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideEndsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideEndsAt.cs new file mode 100644 index 0000000000..254ed20f2a --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideEndsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideEndsAt : StripeEntity + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplier.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplier.cs new file mode 100644 index 0000000000..f26d991c45 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplier.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideMultiplier : StripeEntity + { + /// + /// Criteria determining which rates the multiplier applies to. + /// + [JsonProperty("criteria")] + [STJS.JsonPropertyName("criteria")] + public List Criteria { get; set; } + + /// + /// The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + /// + [JsonProperty("factor")] + [STJS.JsonPropertyName("factor")] + public string Factor { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterion.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterion.cs new file mode 100644 index 0000000000..a4334c7c12 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterion.cs @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideMultiplierCriterion : StripeEntity + { + /// + /// Filter by billable item IDs. + /// + [JsonProperty("billable_item_ids")] + [STJS.JsonPropertyName("billable_item_ids")] + public List BillableItemIds { get; set; } + + /// + /// Filter by billable item lookup keys. + /// + [JsonProperty("billable_item_lookup_keys")] + [STJS.JsonPropertyName("billable_item_lookup_keys")] + public List BillableItemLookupKeys { get; set; } + + /// + /// Filter by billable item type. + /// One of: licensed, or metered. + /// + [JsonProperty("billable_item_types")] + [STJS.JsonPropertyName("billable_item_types")] + public List BillableItemTypes { get; set; } + + /// + /// Filter by metadata conditions. + /// + [JsonProperty("metadata_conditions")] + [STJS.JsonPropertyName("metadata_conditions")] + public List MetadataConditions { get; set; } + + /// + /// Filter by rate card IDs. Only applicable for multiplier overrides. + /// + [JsonProperty("rate_card_ids")] + [STJS.JsonPropertyName("rate_card_ids")] + public List RateCardIds { get; set; } + + /// + /// Whether to include or exclude items matching these criteria. + /// One of: exclude, or include. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataCondition.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataCondition.cs new file mode 100644 index 0000000000..eb3b2910ca --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataCondition.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideMultiplierCriterionMetadataCondition : StripeEntity + { + /// + /// All of these key-value conditions must match. + /// + [JsonProperty("all_of")] + [STJS.JsonPropertyName("all_of")] + public List AllOf { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataConditionAllOf.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataConditionAllOf.cs new file mode 100644 index 0000000000..8958943ee0 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideMultiplierCriterionMetadataConditionAllOf.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideMultiplierCriterionMetadataConditionAllOf : StripeEntity + { + /// + /// The metadata key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + /// + /// The metadata value. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePrice.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePrice.cs new file mode 100644 index 0000000000..2f628b9c92 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePrice.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideOverwritePrice : StripeEntity + { + /// + /// The ID of the V1 price to overwrite. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + + /// + /// Defines whether the tiered price should be graduated or volume-based. + /// One of: graduated, or volume. + /// + [JsonProperty("tiering_mode")] + [STJS.JsonPropertyName("tiering_mode")] + public string TieringMode { get; set; } + + /// + /// Each element represents a pricing tier. + /// + [JsonProperty("tiers")] + [STJS.JsonPropertyName("tiers")] + public List Tiers { get; set; } + + /// + /// The per-unit amount to be charged, represented as a decimal string in minor currency + /// units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePriceTier.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePriceTier.cs new file mode 100644 index 0000000000..fda80c3ad3 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideOverwritePriceTier.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideOverwritePriceTier : StripeEntity + { + /// + /// Price for the entire tier, represented as a decimal string in minor currency units. + /// + [JsonProperty("flat_amount")] + [STJS.JsonPropertyName("flat_amount")] + public string FlatAmount { get; set; } + + /// + /// Per-unit price for units included in this tier, represented as a decimal string in minor + /// currency units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + + /// + /// Up to and including this quantity will be contained in the tier. + /// + [JsonProperty("up_to_decimal")] + [JsonConverter(typeof(DecimalStringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("up_to_decimal")] + public decimal? UpToDecimal { get; set; } + + /// + /// No upper bound to this tier. + /// + [JsonProperty("up_to_inf")] + [STJS.JsonPropertyName("up_to_inf")] + public string UpToInf { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideStartsAt.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideStartsAt.cs new file mode 100644 index 0000000000..ae535d8317 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractPricingOverrideStartsAt.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractPricingOverrideStartsAt : StripeEntity + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetails.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetails.cs new file mode 100644 index 0000000000..41402376b6 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetails.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractStatusDetails : StripeEntity + { + /// + /// Details of the active contract status. + /// + [JsonProperty("active")] + [STJS.JsonPropertyName("active")] + public ContractStatusDetailsActive Active { get; set; } + + /// + /// Details of the canceled contract status. + /// + [JsonProperty("canceled")] + [STJS.JsonPropertyName("canceled")] + public ContractStatusDetailsCanceled Canceled { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsActive.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsActive.cs new file mode 100644 index 0000000000..4964444ffc --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsActive.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractStatusDetailsActive : StripeEntity + { + /// + /// The timestamp when the contract was activated. + /// + [JsonProperty("activated_at")] + [STJS.JsonPropertyName("activated_at")] + public DateTime ActivatedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsCanceled.cs b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsCanceled.cs new file mode 100644 index 0000000000..7657fbc3aa --- /dev/null +++ b/src/Stripe.net/Entities/V2/Billing/Contracts/ContractStatusDetailsCanceled.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ContractStatusDetailsCanceled : StripeEntity + { + /// + /// The timestamp when the contract was canceled. + /// + [JsonProperty("canceled_at")] + [STJS.JsonPropertyName("canceled_at")] + public DateTime CanceledAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + } +} diff --git a/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFile.cs b/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFile.cs index 65f9f019b9..2912ef32fb 100644 --- a/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFile.cs +++ b/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFile.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe.V2.Data.Reporting { + using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; using STJS = System.Text.Json.Serialization; @@ -23,6 +24,13 @@ public class QueryRunResultFile : StripeEntity [STJS.JsonPropertyName("download_url")] public QueryRunResultFileDownloadUrl DownloadUrl { get; set; } + /// + /// The columns of the schema. + /// + [JsonProperty("schema")] + [STJS.JsonPropertyName("schema")] + public List Schema { get; set; } + /// /// The total size of the file in bytes. /// diff --git a/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFileSchema.cs b/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFileSchema.cs new file mode 100644 index 0000000000..3d16d12590 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Data/Reporting/QueryRuns/QueryRunResultFileSchema.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Data.Reporting +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class QueryRunResultFileSchema : StripeEntity + { + /// + /// The name of the column. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The type of the column. + /// One of: boolean, double, bigint, varchar, or + /// timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/OutboundPayments/OutboundPaymentStatusDetailsFailed.cs b/src/Stripe.net/Entities/V2/MoneyManagement/OutboundPayments/OutboundPaymentStatusDetailsFailed.cs index 654b96e853..468efb2129 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/OutboundPayments/OutboundPaymentStatusDetailsFailed.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/OutboundPayments/OutboundPaymentStatusDetailsFailed.cs @@ -11,10 +11,10 @@ public class OutboundPaymentStatusDetailsFailed : StripeEntity /// Open Enum. The failed status reason. /// One of: paper_check_attachment_too_large, paper_check_expired, - /// paper_check_undeliverable, payout_method_declined, - /// payout_method_does_not_exist, payout_method_expired, - /// payout_method_unsupported, payout_method_usage_frequency_limit_exceeded, - /// or unknown_failure. + /// paper_check_undeliverable, payout_method_amount_limit_exceeded, + /// payout_method_declined, payout_method_does_not_exist, + /// payout_method_expired, payout_method_unsupported, + /// payout_method_usage_frequency_limit_exceeded, or unknown_failure. /// [JsonProperty("reason")] [STJS.JsonPropertyName("reason")] diff --git a/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFile.cs b/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFile.cs index 305d4fcf88..b9a91aae0b 100644 --- a/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFile.cs +++ b/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFile.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe.V2.Reporting { + using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; using STJS = System.Text.Json.Serialization; @@ -23,6 +24,13 @@ public class ReportRunResultFile : StripeEntity [STJS.JsonPropertyName("download_url")] public ReportRunResultFileDownloadUrl DownloadUrl { get; set; } + /// + /// The columns of the schema. + /// + [JsonProperty("schema")] + [STJS.JsonPropertyName("schema")] + public List Schema { get; set; } + /// /// The total size of the file in bytes. /// diff --git a/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFileSchema.cs b/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFileSchema.cs new file mode 100644 index 0000000000..f8a1837fbd --- /dev/null +++ b/src/Stripe.net/Entities/V2/Reporting/ReportRuns/ReportRunResultFileSchema.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Reporting +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ReportRunResultFileSchema : StripeEntity + { + /// + /// The name of the column. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The type of the column. + /// One of: boolean, double, bigint, varchar, or + /// timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignal.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignal.cs new file mode 100644 index 0000000000..5b8c17d8bb --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignal.cs @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// An automatically evaluated signal on a v2 account. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignal : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the account signal. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value of + /// the object field. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// The account or customer this signal is associated with. + /// + [JsonProperty("account_details")] + [STJS.JsonPropertyName("account_details")] + public AccountSignalAccountDetails AccountDetails { get; set; } + + /// + /// Timestamp at which the signal was created. + /// + [JsonProperty("created")] + [STJS.JsonPropertyName("created")] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Data for the fraudulent merchant signal. Present only when type is fraudulent_merchant. + /// + [JsonProperty("fraudulent_merchant")] + [STJS.JsonPropertyName("fraudulent_merchant")] + public AccountSignalFraudulentMerchant FraudulentMerchant { get; set; } + + /// + /// Has the value true if the object exists in live mode or the value false if + /// the object exists in test mode. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// Data for the merchant delinquency signal. Present only when type is + /// merchant_delinquency. + /// + [JsonProperty("merchant_delinquency")] + [STJS.JsonPropertyName("merchant_delinquency")] + public AccountSignalMerchantDelinquency MerchantDelinquency { get; set; } + + /// + /// The type of signal. + /// One of: fraudulent_merchant, or merchant_delinquency. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalAccountDetails.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalAccountDetails.cs new file mode 100644 index 0000000000..d426f7028b --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalAccountDetails.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignalAccountDetails : StripeEntity + { + /// + /// The v2 account ID of the account. + /// + [JsonProperty("account")] + [STJS.JsonPropertyName("account")] + public string Account { get; set; } + + /// + /// The v1 customer ID of the account, for users not yet migrated to v2/accounts. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchant.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchant.cs new file mode 100644 index 0000000000..ac2a32967b --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchant.cs @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignalFraudulentMerchant : StripeEntity + { + /// + /// Array of objects representing individual factors that contributed to the calculated + /// probability. Absent when risk level is not_assessed or unknown, or when the user is not + /// on a product tier that includes indicators. + /// + [JsonProperty("indicators")] + [STJS.JsonPropertyName("indicators")] + public List Indicators { get; set; } + + /// + /// The probability of the merchant being fraudulent. Can be between 0.00 and 100.00. Absent + /// when risk level is not_assessed or unknown, or when the user is not on a product tier + /// that includes numeric scores. + /// + [JsonProperty("probability")] + [JsonConverter(typeof(DecimalStringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("probability")] + public decimal? Probability { get; set; } + + /// + /// Categorical assessment of the fraudulent merchant risk based on probability. + /// One of: elevated, highest, low, normal, not_assessed, + /// or unknown. + /// + [JsonProperty("risk_level")] + [STJS.JsonPropertyName("risk_level")] + public string RiskLevel { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchantIndicator.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchantIndicator.cs new file mode 100644 index 0000000000..c1d71fcfdd --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalFraudulentMerchantIndicator.cs @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignalFraudulentMerchantIndicator : StripeEntity + { + /// + /// A brief explanation of how this indicator contributed to the fraudulent merchant + /// probability. + /// + [JsonProperty("explanation")] + [STJS.JsonPropertyName("explanation")] + public string Explanation { get; set; } + + /// + /// The effect this indicator had on the overall risk level. + /// One of: decrease, neutral, slight_increase, or + /// strong_increase. + /// + [JsonProperty("impact")] + [STJS.JsonPropertyName("impact")] + public string Impact { get; set; } + + /// + /// The name of the specific indicator used in the risk assessment. + /// One of: bank_account, business_information_and_account_activity, + /// disputes, failures, geolocation, other, + /// other_related_accounts, other_transaction_activity, or owner_email. + /// + [JsonProperty("indicator")] + [STJS.JsonPropertyName("indicator")] + public string Indicator { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquency.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquency.cs new file mode 100644 index 0000000000..ca371d50a1 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquency.cs @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignalMerchantDelinquency : StripeEntity + { + /// + /// Array of objects representing individual factors that contributed to the calculated + /// probability of delinquency. Absent when risk level is not_assessed or unknown, or when + /// the user is not on a product tier that includes indicators. + /// + [JsonProperty("indicators")] + [STJS.JsonPropertyName("indicators")] + public List Indicators { get; set; } + + /// + /// The probability of delinquency. Can be between 0.00 and 100.00. Absent when risk level + /// is not_assessed or unknown, or when the user is not on a product tier that includes + /// numeric scores. + /// + [JsonProperty("probability")] + [JsonConverter(typeof(DecimalStringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("probability")] + public decimal? Probability { get; set; } + + /// + /// Categorical assessment of the delinquency risk based on probability. + /// One of: elevated, highest, low, normal, not_assessed, + /// or unknown. + /// + [JsonProperty("risk_level")] + [STJS.JsonPropertyName("risk_level")] + public string RiskLevel { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquencyIndicator.cs b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquencyIndicator.cs new file mode 100644 index 0000000000..46138cd3e4 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Signals/AccountSignals/AccountSignalMerchantDelinquencyIndicator.cs @@ -0,0 +1,39 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class AccountSignalMerchantDelinquencyIndicator : StripeEntity + { + /// + /// A brief explanation of how this indicator contributed to the delinquency probability. + /// + [JsonProperty("explanation")] + [STJS.JsonPropertyName("explanation")] + public string Explanation { get; set; } + + /// + /// The effect this indicator had on the overall risk level. + /// One of: decrease, neutral, slight_increase, or + /// strong_increase. + /// + [JsonProperty("impact")] + [STJS.JsonPropertyName("impact")] + public string Impact { get; set; } + + /// + /// The name of the specific indicator used in the risk assessment. + /// One of: account_balance, aov, charge_concentration, + /// disputes, dispute_window, exposure, firmographic, + /// lifetime_metrics, other, payment_processing, payment_volume, + /// payouts, refunds, related_accounts, tenure, or + /// transfers. + /// + [JsonProperty("indicator")] + [STJS.JsonPropertyName("indicator")] + public string Indicator { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEvent.cs b/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEvent.cs new file mode 100644 index 0000000000..69fafabed8 --- /dev/null +++ b/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEvent.cs @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using STJS = System.Text.Json.Serialization; + + /// + /// Occurs when a merchant delinquency signal is ready for an account. + /// + public class V2SignalsAccountSignalMerchantDelinquencyReadyEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] + [STJS.JsonPropertyName("related_object")] + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Signals.AccountSignal FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification.cs b/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification.cs new file mode 100644 index 0000000000..1073d018d2 --- /dev/null +++ b/src/Stripe.net/Events/V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification.cs @@ -0,0 +1,49 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; + using STJS = System.Text.Json.Serialization; + + /// + /// Occurs when a merchant delinquency signal is ready for an account. + /// + public class V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] + [STJS.JsonPropertyName("related_object")] + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Signals.AccountSignal FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2SignalsAccountSignalMerchantDelinquencyReadyEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs b/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs index 4224c09d41..f11aaf28a2 100644 --- a/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs +++ b/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs @@ -6,6 +6,7 @@ namespace Stripe using System.Linq; using System.Net; using System.Net.Http; + using System.Net.Http.Headers; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -232,6 +233,18 @@ private static StripeException BuildV2StripeException(StripeResponse response) } } + private static void MaybeEmitStripeNotice(HttpResponseHeaders headers) + { + if (headers != null && headers.Contains("Stripe-Notice")) + { + var notice = headers.GetValues("Stripe-Notice").FirstOrDefault(); + if (!string.IsNullOrEmpty(notice)) + { + Console.Error.WriteLine(notice); + } + } + } + // Note: BaseOptions options really means query params here private StripeRequest MakeStripeRequest( BaseAddress baseAddress, @@ -281,6 +294,8 @@ private T ProcessResponse(StripeResponse response, ApiMode apiMode) throw BuildStripeException(response); } + MaybeEmitStripeNotice(response.Headers); + T obj; try { @@ -369,6 +384,8 @@ public override async Task RawRequestAsync( throw BuildStripeException(response); } + MaybeEmitStripeNotice(response.Headers); + return response; } } diff --git a/src/Stripe.net/Infrastructure/Public/StripeEventNotificationHandler.cs b/src/Stripe.net/Infrastructure/Public/StripeEventNotificationHandler.cs index d86cf24d89..70d918a3b5 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeEventNotificationHandler.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeEventNotificationHandler.cs @@ -424,6 +424,7 @@ public class StripeEventNotificationHandler private EventHandler> v2ReportingReportRunSucceeded; private EventHandler> v2ReportingReportRunUpdated; private EventHandler> v2SignalsAccountSignalFraudulentMerchantReady; + private EventHandler> v2SignalsAccountSignalMerchantDelinquencyReady; // private-event-handlers: The end of the section generated from our OpenAPI spec @@ -2912,6 +2913,12 @@ public event EventHandler> V2SignalsAccountSignalMerchantDelinquencyReady + { + add { this.AddEventHandler(ref this.v2SignalsAccountSignalMerchantDelinquencyReady, value, "v2.signals.account_signal.merchant_delinquency_ready"); } + remove { this.RemoveEventHandler(); } + } + // public-event-handlers: The end of the section generated from our OpenAPI spec /// @@ -4645,6 +4652,10 @@ private void DispatchEvent(V2.Core.EventNotification eventNotification, StripeCl { this.v2SignalsAccountSignalFraudulentMerchantReady.Invoke(this, new StripeEventNotificationEventArgs((Stripe.Events.V2SignalsAccountSignalFraudulentMerchantReadyEventNotification)eventNotification, client)); } + else if (eventNotification is Stripe.Events.V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification) + { + this.v2SignalsAccountSignalMerchantDelinquencyReady.Invoke(this, new StripeEventNotificationEventArgs((Stripe.Events.V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification)eventNotification, client)); + } // event-handler-dispatch: The end of the section generated from our OpenAPI spec else diff --git a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs index 5f2e7d3607..dea5f8f0a6 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs @@ -67,6 +67,8 @@ public static class StripeTypeRegistry { "customer_balance_transaction", typeof(CustomerBalanceTransaction) }, { "customer_cash_balance_transaction", typeof(CustomerCashBalanceTransaction) }, { "customer_session", typeof(CustomerSession) }, + { "delegated_checkout.order", typeof(DelegatedCheckout.Order) }, + { "delegated_checkout.order_event", typeof(DelegatedCheckout.OrderEvent) }, { "delegated_checkout.requested_session", typeof( DelegatedCheckout.RequestedSession) @@ -275,6 +277,11 @@ public static class StripeTypeRegistry "v2.billing.collection_setting_version", typeof( V2.Billing.CollectionSettingVersion) }, + { "v2.billing.contract", typeof(V2.Billing.Contract) }, + { + "v2.billing.contract_license_pricing_quantity_change", typeof( + V2.Billing.ContractLicensePricingQuantityChange) + }, { "v2.billing.custom_pricing_unit", typeof(V2.Billing.CustomPricingUnit) }, { "v2.billing.intent", typeof(V2.Billing.Intent) }, { "v2.billing.intent_action", typeof(V2.Billing.IntentAction) }, @@ -408,6 +415,7 @@ public static class StripeTypeRegistry }, { "v2.reporting.report", typeof(V2.Reporting.Report) }, { "v2.reporting.report_run", typeof(V2.Reporting.ReportRun) }, + { "v2.signals.account_signal", typeof(V2.Signals.AccountSignal) }, { "v2.tax.manual_rule", typeof(V2.Tax.ManualRule) }, // V2ObjectsToTypes: The end of the section generated from our OpenAPI spec @@ -1648,6 +1656,10 @@ public static class StripeTypeRegistry "v2.signals.account_signal.fraudulent_merchant_ready", typeof( Events.V2SignalsAccountSignalFraudulentMerchantReadyEvent) }, + { + "v2.signals.account_signal.merchant_delinquency_ready", typeof( + Events.V2SignalsAccountSignalMerchantDelinquencyReadyEvent) + }, // V2EventsToTypes: The end of the section generated from our OpenAPI spec }); @@ -3061,6 +3073,10 @@ public static class StripeTypeRegistry "v2.signals.account_signal.fraudulent_merchant_ready", typeof( Events.V2SignalsAccountSignalFraudulentMerchantReadyEventNotification) }, + { + "v2.signals.account_signal.merchant_delinquency_ready", typeof( + Events.V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification) + }, // V2EventNotificationsToTypes: The end of the section generated from our OpenAPI spec }); diff --git a/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs b/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs index 7c6b1fa9aa..5188d076d8 100644 --- a/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs +++ b/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs @@ -42,6 +42,13 @@ public class AccountPersonCreateOptions : BaseOptions, IHasMetadata [STJS.JsonPropertyName("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } + /// + /// The person's place of birth. + /// + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public AddressOptions BirthAddress { get; set; } + /// /// The person's date of birth. /// diff --git a/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs b/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs index 8ebcc9b6fc..0bfeff16cc 100644 --- a/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs +++ b/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs @@ -42,6 +42,13 @@ public class AccountPersonUpdateOptions : BaseOptions, IHasMetadata [STJS.JsonPropertyName("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } + /// + /// The person's place of birth. + /// + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public AddressOptions BirthAddress { get; set; } + /// /// The person's date of birth. /// diff --git a/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs b/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs index 79bc5830c5..3e22641859 100644 --- a/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs @@ -38,6 +38,10 @@ public class AccountIndividualOptions : INestedOptions, IHasMetadata, IHasSetTra [STJS.JsonPropertyName("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public AddressOptions BirthAddress { get; set; } + /// /// The individual's date of birth. /// diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs index 6465c22861..43dcbd40f8 100644 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs @@ -33,6 +33,7 @@ public ChargePaymentDetailsMoneyServicesAccountFundingOptions AccountFunding /// /// The type of money services transaction. + /// One of: account_funding, or debt_repayment. /// [JsonProperty("transaction_type", NullValueHandling = NullValueHandling.Ignore)] [STJS.JsonPropertyName("transaction_type")] diff --git a/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderGetOptions.cs b/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderGetOptions.cs new file mode 100644 index 0000000000..181f9852f3 --- /dev/null +++ b/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderGetOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class OrderGetOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderService.cs b/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderService.cs new file mode 100644 index 0000000000..c72b585ad0 --- /dev/null +++ b/src/Stripe.net/Services/DelegatedCheckout/Orders/OrderService.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class OrderService : Service, IRetrievable + { + public OrderService() + { + } + + internal OrderService(ApiRequestor requestor) + : base(requestor) + { + } + + public OrderService(IStripeClient client) + : base(client) + { + } + + /// + ///

Retrieves a delegated checkout order.

. + ///
+ public virtual Order Get(string id, OrderGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v1/delegated_checkout/orders/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + ///

Retrieves a delegated checkout order.

. + ///
+ public virtual Task GetAsync(string id, OrderGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v1/delegated_checkout/orders/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderListOptions.cs b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderListOptions.cs new file mode 100644 index 0000000000..0a0afb9d65 --- /dev/null +++ b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderListOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class RequestedSessionOrderListOptions : ListOptions + { + } +} diff --git a/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderService.cs b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderService.cs new file mode 100644 index 0000000000..fdd2344542 --- /dev/null +++ b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessionOrders/RequestedSessionOrderService.cs @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec +namespace Stripe.DelegatedCheckout +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class RequestedSessionOrderService : Service, + INestedListable + { + public RequestedSessionOrderService() + { + } + + internal RequestedSessionOrderService(ApiRequestor requestor) + : base(requestor) + { + } + + public RequestedSessionOrderService(IStripeClient client) + : base(client) + { + } + + /// + ///

Lists orders for a delegated checkout requested session.

. + ///
+ public virtual StripeList List(string parentId, RequestedSessionOrderListOptions options = null, RequestOptions requestOptions = null) + { + return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v1/delegated_checkout/requested_sessions/{WebUtility.UrlEncode(parentId)}/orders", options, requestOptions); + } + + /// + ///

Lists orders for a delegated checkout requested session.

. + ///
+ public virtual Task> ListAsync(string parentId, RequestedSessionOrderListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v1/delegated_checkout/requested_sessions/{WebUtility.UrlEncode(parentId)}/orders", options, requestOptions, cancellationToken); + } + + /// + ///

Lists orders for a delegated checkout requested session.

. + ///
+ public virtual IEnumerable ListAutoPaging(string parentId, RequestedSessionOrderListOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v1/delegated_checkout/requested_sessions/{WebUtility.UrlEncode(parentId)}/orders", options, requestOptions); + } + + /// + ///

Lists orders for a delegated checkout requested session.

. + ///
+ public virtual IAsyncEnumerable ListAutoPagingAsync(string parentId, RequestedSessionOrderListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v1/delegated_checkout/requested_sessions/{WebUtility.UrlEncode(parentId)}/orders", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/DelegatedCheckout/RequestedSessions/RequestedSessionService.cs b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessions/RequestedSessionService.cs index 008bede15a..8a63a34e04 100644 --- a/src/Stripe.net/Services/DelegatedCheckout/RequestedSessions/RequestedSessionService.cs +++ b/src/Stripe.net/Services/DelegatedCheckout/RequestedSessions/RequestedSessionService.cs @@ -12,6 +12,8 @@ public class RequestedSessionService : Service, IRetrievable, IUpdatable { + private RequestedSessionOrderService orders; + public RequestedSessionService() { } @@ -26,6 +28,9 @@ public RequestedSessionService(IStripeClient client) { } + public virtual RequestedSessionOrderService Orders => this.orders ??= new RequestedSessionOrderService( + this.Requestor); + /// ///

Confirms a requested session

. ///
diff --git a/src/Stripe.net/Services/DelegatedCheckoutService.cs b/src/Stripe.net/Services/DelegatedCheckoutService.cs index 84342fa968..4590983604 100644 --- a/src/Stripe.net/Services/DelegatedCheckoutService.cs +++ b/src/Stripe.net/Services/DelegatedCheckoutService.cs @@ -7,6 +7,7 @@ namespace Stripe public class DelegatedCheckoutService : Service { + private DelegatedCheckout.OrderService orders; private DelegatedCheckout.RequestedSessionService requestedSessions; internal DelegatedCheckoutService(ApiRequestor requestor) @@ -19,6 +20,9 @@ internal DelegatedCheckoutService(IStripeClient client) { } + public virtual DelegatedCheckout.OrderService Orders => this.orders ??= new DelegatedCheckout.OrderService( + this.Requestor); + public virtual DelegatedCheckout.RequestedSessionService RequestedSessions => this.requestedSessions ??= new DelegatedCheckout.RequestedSessionService( this.Requestor); } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsMoneyServicesOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsMoneyServicesOptions.cs index fcee1962e3..af1469621a 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsMoneyServicesOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsMoneyServicesOptions.cs @@ -33,6 +33,7 @@ public PaymentIntentPaymentDetailsMoneyServicesAccountFundingOptions AccountFund /// /// The type of money services transaction. + /// One of: account_funding, or debt_repayment. /// [JsonProperty("transaction_type", NullValueHandling = NullValueHandling.Ignore)] [STJS.JsonPropertyName("transaction_type")] diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs index 61de018bc2..8cb58e7cdf 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs @@ -14,6 +14,15 @@ public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAcc [STJS.JsonIgnore] internal SetTracker SetTracker { get; } = new SetTracker(); + /// + /// The category of digital asset being acquired through this account funding transaction. + /// One of: blockchain_native, nft, other_non_fiat, or + /// stablecoin. + /// + [JsonProperty("digital_asset_category")] + [STJS.JsonPropertyName("digital_asset_category")] + public string DigitalAssetCategory { get; set; } + /// /// Details for a liquid asset (crypto or security) funding transaction. /// diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs index 3c2ec603cd..e440f5f74a 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs @@ -14,6 +14,15 @@ public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServ [STJS.JsonIgnore] internal SetTracker SetTracker { get; } = new SetTracker(); + /// + /// The category of digital asset being acquired through this account funding transaction. + /// One of: blockchain_native, nft, other_non_fiat, or + /// stablecoin. + /// + [JsonProperty("digital_asset_category")] + [STJS.JsonPropertyName("digital_asset_category")] + public string DigitalAssetCategory { get; set; } + /// /// Details for a liquid asset (crypto or security) funding transaction. /// diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs index 4c59704d17..9e66b0d94f 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs @@ -18,5 +18,13 @@ public class PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions : INes [JsonProperty("networks")] [STJS.JsonPropertyName("networks")] public List Networks { get; set; } + + /// + /// If true, provisions a permanent per-customer deposit address reused across + /// PaymentIntents. + /// + [JsonProperty("static_address")] + [STJS.JsonPropertyName("static_address")] + public bool? StaticAddress { get; set; } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationOptions.cs index 2bf748350a..4ecf7ea908 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationOptions.cs @@ -16,10 +16,10 @@ public class PaymentIntentPaymentsOrchestrationOptions : INestedOptions public bool? Enabled { get; set; } /// - /// Payment-level details for the orchestrated payment. + /// Merchant-provided reference for this payment, used for reconciliation. /// - [JsonProperty("payment_details")] - [STJS.JsonPropertyName("payment_details")] - public PaymentIntentPaymentsOrchestrationPaymentDetailsOptions PaymentDetails { get; set; } + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationPaymentDetailsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationPaymentDetailsOptions.cs deleted file mode 100644 index 8146462f65..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentsOrchestrationPaymentDetailsOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentsOrchestrationPaymentDetailsOptions : INestedOptions - { - /// - /// Merchant-provided reference for this payment, used for reconciliation. - /// - [JsonProperty("reference")] - [STJS.JsonPropertyName("reference")] - public string Reference { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityGetOptions.cs b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityGetOptions.cs index b9d065656b..ed9026260c 100644 --- a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityGetOptions.cs +++ b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityGetOptions.cs @@ -9,7 +9,7 @@ namespace Stripe public class PaymentLocationCapabilityGetOptions : BaseOptions { /// - /// The payment location for which the capability enables functionality. + /// The payment location that the capability enables functionality for. /// [JsonProperty("location")] [STJS.JsonPropertyName("location")] diff --git a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityListOptions.cs b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityListOptions.cs index 04b08f71e0..f82748fb60 100644 --- a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityListOptions.cs +++ b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityListOptions.cs @@ -9,7 +9,7 @@ namespace Stripe public class PaymentLocationCapabilityListOptions : BaseOptions { /// - /// The location for which the capabilities enable functionality. + /// The payment location that the capabilities enable functionality for. /// [JsonProperty("location")] [STJS.JsonPropertyName("location")] diff --git a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityService.cs b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityService.cs index db3cabeafd..19d09609be 100644 --- a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityService.cs +++ b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityService.cs @@ -27,7 +27,7 @@ public PaymentLocationCapabilityService(IStripeClient client) } /// - ///

Retrieves information about the specified Payment Location Capability.

. + ///

Retrieves a payment_location capability

. ///
public virtual PaymentLocationCapability Get(string id, PaymentLocationCapabilityGetOptions options = null, RequestOptions requestOptions = null) { @@ -35,7 +35,7 @@ public virtual PaymentLocationCapability Get(string id, PaymentLocationCapabilit } /// - ///

Retrieves information about the specified Payment Location Capability.

. + ///

Retrieves a payment_location capability

. ///
public virtual Task GetAsync(string id, PaymentLocationCapabilityGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { @@ -43,8 +43,7 @@ public virtual Task GetAsync(string id, PaymentLocati } /// - ///

Returns a list of PaymentLocationCapability objects associated with the - /// location.

. + ///

List all payment location capabilities associated with the payment location.

. ///
public virtual StripeList List(PaymentLocationCapabilityListOptions options = null, RequestOptions requestOptions = null) { @@ -52,8 +51,7 @@ public virtual StripeList List(PaymentLocationCapabil } /// - ///

Returns a list of PaymentLocationCapability objects associated with the - /// location.

. + ///

List all payment location capabilities associated with the payment location.

. ///
public virtual Task> ListAsync(PaymentLocationCapabilityListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { @@ -61,8 +59,8 @@ public virtual Task> ListAsync(PaymentLoca } /// - ///

Updates a specified Payment Location Capability. Request or remove a payment location - /// capability by updating its requested parameter.

. + ///

Updates a payment_location capability. Request or remove a + /// payment_location capability by updating its requested parameter.

. ///
public virtual PaymentLocationCapability Update(string id, PaymentLocationCapabilityUpdateOptions options, RequestOptions requestOptions = null) { @@ -70,8 +68,8 @@ public virtual PaymentLocationCapability Update(string id, PaymentLocationCapabi } /// - ///

Updates a specified Payment Location Capability. Request or remove a payment location - /// capability by updating its requested parameter.

. + ///

Updates a payment_location capability. Request or remove a + /// payment_location capability by updating its requested parameter.

. ///
public virtual Task UpdateAsync(string id, PaymentLocationCapabilityUpdateOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { diff --git a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityUpdateOptions.cs b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityUpdateOptions.cs index 434b3f6e0c..3fb26964f2 100644 --- a/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityUpdateOptions.cs +++ b/src/Stripe.net/Services/PaymentLocationCapabilities/PaymentLocationCapabilityUpdateOptions.cs @@ -9,7 +9,7 @@ namespace Stripe public class PaymentLocationCapabilityUpdateOptions : BaseOptions { /// - /// The location for which the capability enables functionality. + /// The location that the capability enables functionality for. /// [JsonProperty("location")] [STJS.JsonPropertyName("location")] diff --git a/src/Stripe.net/Services/PaymentLocations/PaymentLocationListOptions.cs b/src/Stripe.net/Services/PaymentLocations/PaymentLocationListOptions.cs index bcd96570a7..b812b13c0b 100644 --- a/src/Stripe.net/Services/PaymentLocations/PaymentLocationListOptions.cs +++ b/src/Stripe.net/Services/PaymentLocations/PaymentLocationListOptions.cs @@ -6,7 +6,7 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLocationListOptions : BaseOptions + public class PaymentLocationListOptions : ListOptions { } } diff --git a/src/Stripe.net/Services/PaymentLocations/PaymentLocationService.cs b/src/Stripe.net/Services/PaymentLocations/PaymentLocationService.cs index c76a6f44df..f67321648c 100644 --- a/src/Stripe.net/Services/PaymentLocations/PaymentLocationService.cs +++ b/src/Stripe.net/Services/PaymentLocations/PaymentLocationService.cs @@ -11,6 +11,7 @@ namespace Stripe public class PaymentLocationService : Service, ICreatable, IDeletable, + IListable, IRetrievable, IUpdatable { @@ -92,6 +93,22 @@ public virtual Task> ListAsync(PaymentLocationListOp return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v1/payment_locations", options, requestOptions, cancellationToken); } + /// + ///

List all Payment Locations.

. + ///
+ public virtual IEnumerable ListAutoPaging(PaymentLocationListOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v1/payment_locations", options, requestOptions); + } + + /// + ///

List all Payment Locations.

. + ///
+ public virtual IAsyncEnumerable ListAutoPagingAsync(PaymentLocationListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v1/payment_locations", options, requestOptions, cancellationToken); + } + /// ///

Update a Payment Location.

. ///
diff --git a/src/Stripe.net/Services/PaymentLocations/PaymentLocationUpdateOptions.cs b/src/Stripe.net/Services/PaymentLocations/PaymentLocationUpdateOptions.cs index 987a07536e..825b0e8cb2 100644 --- a/src/Stripe.net/Services/PaymentLocations/PaymentLocationUpdateOptions.cs +++ b/src/Stripe.net/Services/PaymentLocations/PaymentLocationUpdateOptions.cs @@ -30,10 +30,10 @@ public class PaymentLocationUpdateOptions : BaseOptions public string DisplayName { get; set; } /// - /// Pass true when updating location fields that will trigger onboarding review for any of - /// the location's active location capabilities. If this parameter is not set to true, - /// updates that would trigger onboarding review will fail. Only applicable for locations - /// with active location capabilities. + /// Pass true when updating location fields that trigger onboarding review for any of the + /// location's active location capabilities. If this parameter isn't set to true, updates + /// that would trigger onboarding review fail. Only applicable for locations with active + /// location capabilities. /// [JsonProperty("onboarding_data_update_acknowledged")] [STJS.JsonPropertyName("onboarding_data_update_acknowledged")] diff --git a/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs b/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs index 0b0c75eb70..cd86cd3a09 100644 --- a/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs @@ -38,6 +38,10 @@ public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata, IHasS [STJS.JsonPropertyName("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public AddressOptions BirthAddress { get; set; } + /// /// The individual's date of birth. /// diff --git a/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs b/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs index a4b83d401c..f193eb9436 100644 --- a/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs @@ -46,6 +46,13 @@ public class TokenPersonOptions : INestedOptions, IHasMetadata, IHasSetTracking [STJS.JsonPropertyName("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } + /// + /// The person's place of birth. + /// + [JsonProperty("birth_address")] + [STJS.JsonPropertyName("birth_address")] + public AddressOptions BirthAddress { get; set; } + /// /// The person's date of birth. /// diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractActivateOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractActivateOptions.cs new file mode 100644 index 0000000000..236aea5344 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractActivateOptions.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractActivateOptions : BaseOptions + { + /// + /// Additional fields to include in the response. + /// One of: contract_line_details, license_quantities, one_time_fees, + /// pricing_lines, or pricing_overrides. + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCancelOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCancelOptions.cs new file mode 100644 index 0000000000..8037ec3589 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCancelOptions.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCancelOptions : BaseOptions + { + /// + /// Additional fields to include in the response. + /// One of: contract_line_details, license_quantities, one_time_fees, + /// pricing_lines, or pricing_overrides. + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationOptions.cs new file mode 100644 index 0000000000..7786568a97 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationOptions : INestedOptions + { + /// + /// Tax calculation settings. + /// + [JsonProperty("tax")] + [STJS.JsonPropertyName("tax")] + public ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTaxOptions Tax { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTaxOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTaxOptions.cs new file mode 100644 index 0000000000..c1b7dca83a --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTaxOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTaxOptions : INestedOptions + { + /// + /// The type of tax calculation. + /// One of: automatic, or manual. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceOptions.cs new file mode 100644 index 0000000000..1ee2429ff7 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceOptions : INestedOptions + { + /// + /// The number of time units before the invoice is past due. + /// + [JsonProperty("time_until_due")] + [STJS.JsonPropertyName("time_until_due")] + public ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDueOptions TimeUntilDue { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDueOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDueOptions.cs new file mode 100644 index 0000000000..3da31c46ee --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDueOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDueOptions : INestedOptions + { + /// + /// The interval unit. + /// One of: day, month, week, or year. + /// + [JsonProperty("interval")] + [STJS.JsonPropertyName("interval")] + public string Interval { get; set; } + + /// + /// The number of intervals. + /// + [JsonProperty("interval_count")] + [STJS.JsonPropertyName("interval_count")] + public long? IntervalCount { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsOptions.cs new file mode 100644 index 0000000000..b93ce0c0eb --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsOptions : INestedOptions + { + /// + /// Calculation settings. + /// + [JsonProperty("calculation")] + [STJS.JsonPropertyName("calculation")] + public ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationOptions Calculation { get; set; } + + /// + /// Invoice settings. + /// + [JsonProperty("invoice")] + [STJS.JsonPropertyName("invoice")] + public ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceOptions Invoice { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillingProfileDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillingProfileDetailsOptions.cs new file mode 100644 index 0000000000..f78aaa0343 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsBillingProfileDetailsOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsBillingProfileDetailsOptions : INestedOptions + { + /// + /// The customer who pays for the contract invoice. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + + /// + /// The default payment method for the contract. + /// + [JsonProperty("default_payment_method")] + [STJS.JsonPropertyName("default_payment_method")] + public string DefaultPaymentMethod { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsCollectionSettingsDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsCollectionSettingsDetailsOptions.cs new file mode 100644 index 0000000000..fc1462bca6 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsCollectionSettingsDetailsOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsCollectionSettingsDetailsOptions : INestedOptions + { + /// + /// The collection method. + /// One of: charge_automatically, or send_invoice. + /// + [JsonProperty("collection_method")] + [STJS.JsonPropertyName("collection_method")] + public string CollectionMethod { get; set; } + + /// + /// The payment method configuration. + /// + [JsonProperty("payment_method_configuration")] + [STJS.JsonPropertyName("payment_method_configuration")] + public string PaymentMethodConfiguration { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsOptions.cs new file mode 100644 index 0000000000..65a0e73f5d --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsContractBillingDetailsOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsContractBillingDetailsOptions : INestedOptions + { + /// + /// The bill settings details. + /// + [JsonProperty("bill_settings_details")] + [STJS.JsonPropertyName("bill_settings_details")] + public ContractCreateBillingSettingsContractBillingDetailsBillSettingsDetailsOptions BillSettingsDetails { get; set; } + + /// + /// The billing profile details. + /// + [JsonProperty("billing_profile_details")] + [STJS.JsonPropertyName("billing_profile_details")] + public ContractCreateBillingSettingsContractBillingDetailsBillingProfileDetailsOptions BillingProfileDetails { get; set; } + + /// + /// The collection settings details. + /// + [JsonProperty("collection_settings_details")] + [STJS.JsonPropertyName("collection_settings_details")] + public ContractCreateBillingSettingsContractBillingDetailsCollectionSettingsDetailsOptions CollectionSettingsDetails { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsOptions.cs new file mode 100644 index 0000000000..21c8b1076c --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateBillingSettingsOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateBillingSettingsOptions : INestedOptions + { + /// + /// Billing settings details for the contract. + /// + [JsonProperty("contract_billing_details")] + [STJS.JsonPropertyName("contract_billing_details")] + public ContractCreateBillingSettingsContractBillingDetailsOptions ContractBillingDetails { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineEndsAtOptions.cs new file mode 100644 index 0000000000..38c7abcf69 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineEndsAtOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOptions.cs new file mode 100644 index 0000000000..df6dff3a76 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOptions.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOptions : INestedOptions, IHasMetadata + { + /// + /// Timestamp to indicate when the contract line ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractCreateContractLineEndsAtOptions EndsAt { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// List of overrides. Later overrides in the list override earlier ones. + /// + [JsonProperty("overrides")] + [STJS.JsonPropertyName("overrides")] + public List Overrides { get; set; } + + /// + /// The pricing configuration for the contract line. + /// + [JsonProperty("pricing")] + [STJS.JsonPropertyName("pricing")] + public ContractCreateContractLinePricingOptions Pricing { get; set; } + + /// + /// Timestamp to indicate when the contract line starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractCreateContractLineStartsAtOptions StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideEndsAtOptions.cs new file mode 100644 index 0000000000..410d2391c4 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideEndsAtOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideOptions.cs new file mode 100644 index 0000000000..1cb7740ff8 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideOptions.cs @@ -0,0 +1,39 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideOptions : INestedOptions + { + /// + /// Timestamp to indicate when the override ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractCreateContractLineOverrideEndsAtOptions EndsAt { get; set; } + + /// + /// Service action override parameters. Required if type is service_action. + /// + [JsonProperty("service_action")] + [STJS.JsonPropertyName("service_action")] + public ContractCreateContractLineOverrideServiceActionOptions ServiceAction { get; set; } + + /// + /// Timestamp to indicate when the override starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractCreateContractLineOverrideStartsAtOptions StartsAt { get; set; } + + /// + /// The type of the override. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions.cs new file mode 100644 index 0000000000..a4ed239972 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions : INestedOptions + { + /// + /// The monetary amount of the credit grant. Required if type is monetary. + /// + [JsonProperty("monetary")] + [STJS.JsonPropertyName("monetary")] + public V2.Amount Monetary { get; set; } + + /// + /// The type of the credit grant amount. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions.cs new file mode 100644 index 0000000000..50470c10dc --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions : INestedOptions + { + /// + /// The applicability scope of the credit grant. + /// + [JsonProperty("scope")] + [STJS.JsonPropertyName("scope")] + public ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions Scope { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions.cs new file mode 100644 index 0000000000..102a1be8d8 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions : INestedOptions + { + /// + /// The billable items to apply the credit grant to. + /// + [JsonProperty("billable_items")] + [STJS.JsonPropertyName("billable_items")] + public List BillableItems { get; set; } + + /// + /// The price type that credit grants can apply to. + /// + [JsonProperty("price_type")] + [STJS.JsonPropertyName("price_type")] + public string PriceType { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions.cs new file mode 100644 index 0000000000..2551b4b842 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions : INestedOptions + { + /// + /// The type of the expiry configuration. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions.cs new file mode 100644 index 0000000000..24dc6b83e6 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions : INestedOptions + { + /// + /// The amount of the credit grant. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions Amount { get; set; } + + /// + /// Defines the scope where the credit grant is applicable. + /// + [JsonProperty("applicability_config")] + [STJS.JsonPropertyName("applicability_config")] + public ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions ApplicabilityConfig { get; set; } + + /// + /// The category of the credit grant. + /// One of: paid, or promotional. + /// + [JsonProperty("category")] + [STJS.JsonPropertyName("category")] + public string Category { get; set; } + + /// + /// The expiry configuration for the credit grant. + /// + [JsonProperty("expiry_config")] + [STJS.JsonPropertyName("expiry_config")] + public ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions ExpiryConfig { get; set; } + + /// + /// A descriptive name. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The desired priority for applying this credit grant. The highest priority is 0 and the + /// lowest is 100. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddOptions.cs new file mode 100644 index 0000000000..f0bf482d21 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionAddOptions.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionAddOptions : INestedOptions + { + /// + /// Details for the credit grant. Required if type is credit_grant. + /// + [JsonProperty("credit_grant")] + [STJS.JsonPropertyName("credit_grant")] + public ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions CreditGrant { get; set; } + + /// + /// The interval for assessing service. + /// One of: day, month, week, or year. + /// + [JsonProperty("service_interval")] + [STJS.JsonPropertyName("service_interval")] + public string ServiceInterval { get; set; } + + /// + /// The length of the interval for assessing service. + /// + [JsonProperty("service_interval_count")] + [STJS.JsonPropertyName("service_interval_count")] + public long? ServiceIntervalCount { get; set; } + + /// + /// The type of the service action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionOptions.cs new file mode 100644 index 0000000000..4842d66ee7 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionOptions.cs @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionOptions : INestedOptions + { + /// + /// Parameters for adding a new service action. + /// + [JsonProperty("add")] + [STJS.JsonPropertyName("add")] + public ContractCreateContractLineOverrideServiceActionAddOptions Add { get; set; } + + /// + /// Parameters for replacing an existing service action. + /// + [JsonProperty("replace")] + [STJS.JsonPropertyName("replace")] + public ContractCreateContractLineOverrideServiceActionReplaceOptions Replace { get; set; } + + /// + /// The type of service action override. + /// One of: add, or replace. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions.cs new file mode 100644 index 0000000000..a34c523669 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions : INestedOptions + { + /// + /// The monetary amount of the credit grant. Required if type is monetary. + /// + [JsonProperty("monetary")] + [STJS.JsonPropertyName("monetary")] + public V2.Amount Monetary { get; set; } + + /// + /// The type of the credit grant amount. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions.cs new file mode 100644 index 0000000000..4b6a9e3555 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions : INestedOptions + { + /// + /// The applicability scope of the credit grant. + /// + [JsonProperty("scope")] + [STJS.JsonPropertyName("scope")] + public ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions Scope { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions.cs new file mode 100644 index 0000000000..84869718a7 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions : INestedOptions + { + /// + /// The billable items to apply the credit grant to. + /// + [JsonProperty("billable_items")] + [STJS.JsonPropertyName("billable_items")] + public List BillableItems { get; set; } + + /// + /// The price type that credit grants can apply to. + /// + [JsonProperty("price_type")] + [STJS.JsonPropertyName("price_type")] + public string PriceType { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions.cs new file mode 100644 index 0000000000..6571b41efb --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions : INestedOptions + { + /// + /// The type of the expiry configuration. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions.cs new file mode 100644 index 0000000000..89014acbea --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions : INestedOptions + { + /// + /// The amount of the credit grant. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions Amount { get; set; } + + /// + /// Defines the scope where the credit grant is applicable. + /// + [JsonProperty("applicability_config")] + [STJS.JsonPropertyName("applicability_config")] + public ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions ApplicabilityConfig { get; set; } + + /// + /// The category of the credit grant. + /// One of: paid, or promotional. + /// + [JsonProperty("category")] + [STJS.JsonPropertyName("category")] + public string Category { get; set; } + + /// + /// The expiry configuration for the credit grant. + /// + [JsonProperty("expiry_config")] + [STJS.JsonPropertyName("expiry_config")] + public ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions ExpiryConfig { get; set; } + + /// + /// A descriptive name. + /// + [JsonProperty("name")] + [STJS.JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// The desired priority for applying this credit grant. The highest priority is 0 and the + /// lowest is 100. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceOptions.cs new file mode 100644 index 0000000000..fdeb39c6e1 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideServiceActionReplaceOptions.cs @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideServiceActionReplaceOptions : INestedOptions, IHasId + { + /// + /// Details for the credit grant. Required if type is credit_grant. + /// + [JsonProperty("credit_grant")] + [STJS.JsonPropertyName("credit_grant")] + public ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions CreditGrant { get; set; } + + /// + /// The ID of the service action to replace. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// The lookup key for the service action to replace. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// The interval for assessing service. + /// One of: day, month, week, or year. + /// + [JsonProperty("service_interval")] + [STJS.JsonPropertyName("service_interval")] + public string ServiceInterval { get; set; } + + /// + /// The length of the interval for assessing service. + /// + [JsonProperty("service_interval_count")] + [STJS.JsonPropertyName("service_interval_count")] + public long? ServiceIntervalCount { get; set; } + + /// + /// The type of the service action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideStartsAtOptions.cs new file mode 100644 index 0000000000..13d897a518 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineOverrideStartsAtOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineOverrideStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLinePricingOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLinePricingOptions.cs new file mode 100644 index 0000000000..a07d236224 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLinePricingOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLinePricingOptions : INestedOptions + { + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineStartsAtOptions.cs new file mode 100644 index 0000000000..58509f3e57 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateContractLineStartsAtOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateContractLineStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionEffectiveAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionEffectiveAtOptions.cs new file mode 100644 index 0000000000..b1f7bf00d1 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionEffectiveAtOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateLicenseQuantityActionEffectiveAtOptions : INestedOptions + { + /// + /// The timestamp for the effective at. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the effective at. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionOptions.cs new file mode 100644 index 0000000000..a4e912f324 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionOptions.cs @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateLicenseQuantityActionOptions : INestedOptions + { + /// + /// The effective at for the license quantity action. + /// + [JsonProperty("effective_at")] + [STJS.JsonPropertyName("effective_at")] + public ContractCreateLicenseQuantityActionEffectiveAtOptions EffectiveAt { get; set; } + + /// + /// The ID of the license pricing. + /// + [JsonProperty("license_pricing_id")] + [STJS.JsonPropertyName("license_pricing_id")] + public string LicensePricingId { get; set; } + + /// + /// The lookup key for the license pricing. + /// + [JsonProperty("license_pricing_lookup_key")] + [STJS.JsonPropertyName("license_pricing_lookup_key")] + public string LicensePricingLookupKey { get; set; } + + /// + /// The type of the license pricing. + /// One of: license_fee, or price. + /// + [JsonProperty("license_pricing_type")] + [STJS.JsonPropertyName("license_pricing_type")] + public string LicensePricingType { get; set; } + + /// + /// The pricing line for the license quantity action. + /// + [JsonProperty("pricing_line")] + [STJS.JsonPropertyName("pricing_line")] + public string PricingLine { get; set; } + + /// + /// The set quantity for the license quantity action. + /// + [JsonProperty("set")] + [STJS.JsonPropertyName("set")] + public ContractCreateLicenseQuantityActionSetOptions Set { get; set; } + + /// + /// The type of the license quantity action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionSetOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionSetOptions.cs new file mode 100644 index 0000000000..4900e36643 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateLicenseQuantityActionSetOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateLicenseQuantityActionSetOptions : INestedOptions + { + /// + /// The quantity to set. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long? Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleBillAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleBillAtOptions.cs new file mode 100644 index 0000000000..ff782acd72 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleBillAtOptions.cs @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateOneTimeFeeBillScheduleBillAtOptions : INestedOptions + { + /// + /// The datetime at which the entry should be billed. Required if type is + /// datetime. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the bill_at. + /// One of: contract_start, or datetime. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleOptions.cs new file mode 100644 index 0000000000..849c5d158e --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeBillScheduleOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateOneTimeFeeBillScheduleOptions : INestedOptions + { + /// + /// When this entry should be billed. + /// + [JsonProperty("bill_at")] + [STJS.JsonPropertyName("bill_at")] + public ContractCreateOneTimeFeeBillScheduleBillAtOptions BillAt { get; set; } + + /// + /// The amount to bill for this entry, in the smallest currency unit. + /// + [JsonProperty("value")] + [JsonConverter(typeof(Int64StringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("value")] + public long? Value { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeOptions.cs new file mode 100644 index 0000000000..6f3dd51c15 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateOneTimeFeeOptions : INestedOptions + { + /// + /// The bill schedule for the fee. Each entry produces an individual invoice item billed at + /// bill_at. + /// + [JsonProperty("bill_schedule")] + [STJS.JsonPropertyName("bill_schedule")] + public List BillSchedule { get; set; } + + /// + /// The type of billable item that this fee references. + /// + [JsonProperty("billable_item_type")] + [STJS.JsonPropertyName("billable_item_type")] + public string BillableItemType { get; set; } + + /// + /// Details for a product billable target. Required when billable_item_type is + /// product. + /// + [JsonProperty("product_details")] + [STJS.JsonPropertyName("product_details")] + public ContractCreateOneTimeFeeProductDetailsOptions ProductDetails { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeProductDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeProductDetailsOptions.cs new file mode 100644 index 0000000000..cc30d1507c --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOneTimeFeeProductDetailsOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateOneTimeFeeProductDetailsOptions : INestedOptions + { + /// + /// The ID of the v1 Product. + /// + [JsonProperty("product")] + [STJS.JsonPropertyName("product")] + public string Product { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOptions.cs new file mode 100644 index 0000000000..d78588c668 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreateOptions.cs @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreateOptions : BaseOptions, IHasMetadata + { + /// + /// The billing settings for the contract. + /// + [JsonProperty("billing_settings")] + [STJS.JsonPropertyName("billing_settings")] + public ContractCreateBillingSettingsOptions BillingSettings { get; set; } + + /// + /// A list of contract lines to create with the contract. + /// + [JsonProperty("contract_lines")] + [STJS.JsonPropertyName("contract_lines")] + public List ContractLines { get; set; } + + /// + /// A unique user-provided contract number e.g. C-2026-0001. + /// + [JsonProperty("contract_number")] + [STJS.JsonPropertyName("contract_number")] + public string ContractNumber { get; set; } + + /// + /// Currency of the contract. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// Additional fields to include in the response. + /// One of: contract_line_details, license_quantities, one_time_fees, + /// pricing_lines, or pricing_overrides. + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } + + /// + /// A list of license quantity actions to create with the contract. + /// + [JsonProperty("license_quantity_actions")] + [STJS.JsonPropertyName("license_quantity_actions")] + public List LicenseQuantityActions { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// A list of one-time fees to create with the contract. Each fee is billed as individual + /// invoice items per its bill_schedule. + /// + [JsonProperty("one_time_fees")] + [STJS.JsonPropertyName("one_time_fees")] + public List OneTimeFees { get; set; } + + /// + /// A list of pricing lines to create with the contract. + /// + [JsonProperty("pricing_lines")] + [STJS.JsonPropertyName("pricing_lines")] + public List PricingLines { get; set; } + + /// + /// A list of pricing overrides to create with the contract. + /// + [JsonProperty("pricing_overrides")] + [STJS.JsonPropertyName("pricing_overrides")] + public List PricingOverrides { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineEndsAtOptions.cs new file mode 100644 index 0000000000..751684af30 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingLineEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. Required if type is timestamp. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the ends_at. + /// One of: contract_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineOptions.cs new file mode 100644 index 0000000000..af8968c725 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineOptions.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingLineOptions : INestedOptions, IHasMetadata + { + /// + /// When the pricing line ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractCreatePricingLineEndsAtOptions EndsAt { get; set; } + + /// + /// A user-provided lookup key to reference this pricing line. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The pricing configuration for the pricing line. + /// + [JsonProperty("pricing")] + [STJS.JsonPropertyName("pricing")] + public ContractCreatePricingLinePricingOptions Pricing { get; set; } + + /// + /// When the pricing line starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractCreatePricingLineStartsAtOptions StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingOptions.cs new file mode 100644 index 0000000000..3e74349a3f --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingLinePricingOptions : INestedOptions + { + /// + /// V1 price details. Required if type is price. + /// + [JsonProperty("price_details")] + [STJS.JsonPropertyName("price_details")] + public ContractCreatePricingLinePricingPriceDetailsOptions PriceDetails { get; set; } + + /// + /// The type of pricing. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingPriceDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingPriceDetailsOptions.cs new file mode 100644 index 0000000000..7f4c5e536d --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLinePricingPriceDetailsOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingLinePricingPriceDetailsOptions : INestedOptions + { + /// + /// The ID of the V1 price. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + + /// + /// The quantity for the price. Only applicable for licensed prices. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long? Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineStartsAtOptions.cs new file mode 100644 index 0000000000..b7adbeaf15 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingLineStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingLineStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. Required if type is timestamp. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the starts_at. + /// One of: contract_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideEndsAtOptions.cs new file mode 100644 index 0000000000..4017ad77e4 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. Required if type is timestamp. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the ends_at. + /// One of: contract_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionAllOfOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionAllOfOptions.cs new file mode 100644 index 0000000000..b12324784e --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionAllOfOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideMultiplierCriterionMetadataConditionAllOfOptions : INestedOptions + { + /// + /// The metadata key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + /// + /// The metadata value. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionOptions.cs new file mode 100644 index 0000000000..cd14d90ad1 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionMetadataConditionOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideMultiplierCriterionMetadataConditionOptions : INestedOptions + { + /// + /// All of these key-value conditions must match. + /// + [JsonProperty("all_of")] + [STJS.JsonPropertyName("all_of")] + public List AllOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionOptions.cs new file mode 100644 index 0000000000..ce88494d23 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierCriterionOptions.cs @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideMultiplierCriterionOptions : INestedOptions + { + /// + /// Filter by billable item IDs. + /// + [JsonProperty("billable_item_ids")] + [STJS.JsonPropertyName("billable_item_ids")] + public List BillableItemIds { get; set; } + + /// + /// Filter by billable item lookup keys. + /// + [JsonProperty("billable_item_lookup_keys")] + [STJS.JsonPropertyName("billable_item_lookup_keys")] + public List BillableItemLookupKeys { get; set; } + + /// + /// Filter by billable item type. + /// One of: licensed, or metered. + /// + [JsonProperty("billable_item_types")] + [STJS.JsonPropertyName("billable_item_types")] + public List BillableItemTypes { get; set; } + + /// + /// Filter by metadata conditions. + /// + [JsonProperty("metadata_conditions")] + [STJS.JsonPropertyName("metadata_conditions")] + public List MetadataConditions { get; set; } + + /// + /// Filter by rate card IDs. Only applicable for multiplier overrides. + /// + [JsonProperty("rate_card_ids")] + [STJS.JsonPropertyName("rate_card_ids")] + public List RateCardIds { get; set; } + + /// + /// Whether to include or exclude items matching these criteria. + /// One of: exclude, or include. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierOptions.cs new file mode 100644 index 0000000000..b24c3749b3 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideMultiplierOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideMultiplierOptions : INestedOptions + { + /// + /// Criteria determining which rates the multiplier applies to. + /// + [JsonProperty("criteria")] + [STJS.JsonPropertyName("criteria")] + public List Criteria { get; set; } + + /// + /// The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + /// + [JsonProperty("factor")] + [STJS.JsonPropertyName("factor")] + public string Factor { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs new file mode 100644 index 0000000000..270104038d --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideOptions : INestedOptions + { + /// + /// When the pricing override ends. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractCreatePricingOverrideEndsAtOptions EndsAt { get; set; } + + /// + /// A user-provided lookup key to reference this pricing override. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// Parameters for a multiplier override. Required if type is multiplier. + /// + [JsonProperty("multiplier")] + [STJS.JsonPropertyName("multiplier")] + public ContractCreatePricingOverrideMultiplierOptions Multiplier { get; set; } + + /// + /// Parameters for an overwrite_price override. Required if type is + /// overwrite_price. + /// + [JsonProperty("overwrite_price")] + [STJS.JsonPropertyName("overwrite_price")] + public ContractCreatePricingOverrideOverwritePriceOptions OverwritePrice { get; set; } + + /// + /// The priority of this override relative to others. Lower number = higher priority. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + + /// + /// When the pricing override starts. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractCreatePricingOverrideStartsAtOptions StartsAt { get; set; } + + /// + /// The type of pricing override. + /// One of: multiplier, or overwrite_price. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceOptions.cs new file mode 100644 index 0000000000..91326cb8aa --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceOptions.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideOverwritePriceOptions : INestedOptions + { + /// + /// The ID of the V1 price to overwrite. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + + /// + /// Defines whether the tiered price should be graduated or volume-based. + /// One of: graduated, or volume. + /// + [JsonProperty("tiering_mode")] + [STJS.JsonPropertyName("tiering_mode")] + public string TieringMode { get; set; } + + /// + /// Each element represents a pricing tier. + /// + [JsonProperty("tiers")] + [STJS.JsonPropertyName("tiers")] + public List Tiers { get; set; } + + /// + /// The per-unit amount to be charged, represented as a decimal string in minor currency + /// units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceTierOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceTierOptions.cs new file mode 100644 index 0000000000..d8b6756389 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOverwritePriceTierOptions.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideOverwritePriceTierOptions : INestedOptions + { + /// + /// Price for the entire tier, represented as a decimal string in minor currency units. + /// + [JsonProperty("flat_amount")] + [STJS.JsonPropertyName("flat_amount")] + public string FlatAmount { get; set; } + + /// + /// Per-unit price for units included in this tier, represented as a decimal string in minor + /// currency units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + + /// + /// Up to and including this quantity will be contained in the tier. + /// + [JsonProperty("up_to_decimal")] + [JsonConverter(typeof(DecimalStringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("up_to_decimal")] + public decimal? UpToDecimal { get; set; } + + /// + /// No upper bound to this tier. + /// + [JsonProperty("up_to_inf")] + [STJS.JsonPropertyName("up_to_inf")] + public string UpToInf { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideStartsAtOptions.cs new file mode 100644 index 0000000000..7e218440bb --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractCreatePricingOverrideStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. Required if type is timestamp. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the starts_at. + /// One of: contract_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractGetOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractGetOptions.cs new file mode 100644 index 0000000000..018e8d40c2 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractGetOptions.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractGetOptions : BaseOptions + { + /// + /// Additional fields to include in the response. + /// One of: contract_line_details, license_quantities, one_time_fees, + /// pricing_lines, or pricing_overrides. + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractListOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractListOptions.cs new file mode 100644 index 0000000000..710c0ad771 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractListOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractListOptions : V2.ListOptions + { + /// + /// Filter by customer ID. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractService.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractService.cs new file mode 100644 index 0000000000..22675b2b0d --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractService.cs @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class ContractService : Service + { + private V2.Billing.Contracts.LicensePricingService licensePricing; + + internal ContractService(ApiRequestor requestor) + : base(requestor) + { + } + + internal ContractService(IStripeClient client) + : base(client) + { + } + + public virtual V2.Billing.Contracts.LicensePricingService LicensePricing => this.licensePricing ??= new V2.Billing.Contracts.LicensePricingService( + this.Requestor); + + /// + /// Activate a Draft Contract object by ID. + /// + public virtual Contract Activate(string id, ContractActivateOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}/activate", options, requestOptions); + } + + /// + /// Activate a Draft Contract object by ID. + /// + public virtual Task ActivateAsync(string id, ContractActivateOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}/activate", options, requestOptions, cancellationToken); + } + + /// + /// Cancel a Contract object by ID. + /// + public virtual Contract Cancel(string id, ContractCancelOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}/cancel", options, requestOptions); + } + + /// + /// Cancel a Contract object by ID. + /// + public virtual Task CancelAsync(string id, ContractCancelOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}/cancel", options, requestOptions, cancellationToken); + } + + /// + /// Create a Contract object. + /// + public virtual Contract Create(ContractCreateOptions options, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts", options, requestOptions); + } + + /// + /// Create a Contract object. + /// + public virtual Task CreateAsync(ContractCreateOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts", options, requestOptions, cancellationToken); + } + + /// + /// Retrieve a Contract object by ID. + /// + public virtual Contract Get(string id, ContractGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + /// Retrieve a Contract object by ID. + /// + public virtual Task GetAsync(string id, ContractGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + + /// + /// List Contract objects with pagination. + /// + public virtual V2.StripeList List(ContractListOptions options = null, RequestOptions requestOptions = null) + { + return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts", options, requestOptions); + } + + /// + /// List Contract objects with pagination. + /// + public virtual Task> ListAsync(ContractListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts", options, requestOptions, cancellationToken); + } + + /// + /// List Contract objects with pagination. + /// + public virtual IEnumerable ListAutoPaging(ContractListOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v2/billing/contracts", options, requestOptions); + } + + /// + /// List Contract objects with pagination. + /// + public virtual IAsyncEnumerable ListAutoPagingAsync(ContractListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v2/billing/contracts", options, requestOptions, cancellationToken); + } + + /// + /// Update a Contract object by ID. + /// + public virtual Contract Update(string id, ContractUpdateOptions options, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + /// Update a Contract object by ID. + /// + public virtual Task UpdateAsync(string id, ContractUpdateOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v2/billing/contracts/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionEffectiveAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionEffectiveAtOptions.cs new file mode 100644 index 0000000000..c8a4ee714b --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionEffectiveAtOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdateLicenseQuantityActionEffectiveAtOptions : INestedOptions + { + /// + /// The timestamp for the effective at. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of the effective at. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionOptions.cs new file mode 100644 index 0000000000..bfaeeeaadd --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionOptions.cs @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdateLicenseQuantityActionOptions : INestedOptions + { + /// + /// The effective at for the license quantity action. + /// + [JsonProperty("effective_at")] + [STJS.JsonPropertyName("effective_at")] + public ContractUpdateLicenseQuantityActionEffectiveAtOptions EffectiveAt { get; set; } + + /// + /// The ID of the license pricing. + /// + [JsonProperty("license_pricing_id")] + [STJS.JsonPropertyName("license_pricing_id")] + public string LicensePricingId { get; set; } + + /// + /// The lookup key for the license pricing. + /// + [JsonProperty("license_pricing_lookup_key")] + [STJS.JsonPropertyName("license_pricing_lookup_key")] + public string LicensePricingLookupKey { get; set; } + + /// + /// The type of the license pricing. + /// One of: license_fee, or price. + /// + [JsonProperty("license_pricing_type")] + [STJS.JsonPropertyName("license_pricing_type")] + public string LicensePricingType { get; set; } + + /// + /// The pricing line ID for the license quantity action. + /// + [JsonProperty("pricing_line")] + [STJS.JsonPropertyName("pricing_line")] + public string PricingLine { get; set; } + + /// + /// The pricing line lookup key for the license quantity action. + /// + [JsonProperty("pricing_line_lookup_key")] + [STJS.JsonPropertyName("pricing_line_lookup_key")] + public string PricingLineLookupKey { get; set; } + + /// + /// The set quantity for the license quantity action. + /// + [JsonProperty("set")] + [STJS.JsonPropertyName("set")] + public ContractUpdateLicenseQuantityActionSetOptions Set { get; set; } + + /// + /// The type of the license quantity action. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionSetOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionSetOptions.cs new file mode 100644 index 0000000000..351e52f0a4 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateLicenseQuantityActionSetOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdateLicenseQuantityActionSetOptions : INestedOptions + { + /// + /// The quantity to set. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long? Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateOptions.cs new file mode 100644 index 0000000000..1f43cdff74 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdateOptions.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdateOptions : BaseOptions + { + /// + /// Additional fields to include in the response. + /// One of: contract_line_details, license_quantities, one_time_fees, + /// pricing_lines, or pricing_overrides. + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } + + /// + /// Schema-only: License quantity actions (implementation to follow). + /// + [JsonProperty("license_quantity_actions")] + [STJS.JsonPropertyName("license_quantity_actions")] + public List LicenseQuantityActions { get; set; } + + /// + /// Pricing line actions to apply. + /// + [JsonProperty("pricing_line_actions")] + [STJS.JsonPropertyName("pricing_line_actions")] + public List PricingLineActions { get; set; } + + /// + /// Pricing override actions to apply. + /// + [JsonProperty("pricing_override_actions")] + [STJS.JsonPropertyName("pricing_override_actions")] + public List PricingOverrideActions { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddEndsAtOptions.cs new file mode 100644 index 0000000000..71ee6ddcc5 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionAddEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of end time to apply. + /// One of: billing_period_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddOptions.cs new file mode 100644 index 0000000000..c23f8aae91 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddOptions.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionAddOptions : INestedOptions, IHasMetadata + { + /// + /// The end time for the pricing line. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractUpdatePricingLineActionAddEndsAtOptions EndsAt { get; set; } + + /// + /// A lookup key for the pricing line. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// Metadata for the pricing line. + /// + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The pricing configuration for the pricing line. + /// + [JsonProperty("pricing")] + [STJS.JsonPropertyName("pricing")] + public ContractUpdatePricingLineActionAddPricingOptions Pricing { get; set; } + + /// + /// The start time for the pricing line. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractUpdatePricingLineActionAddStartsAtOptions StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingOptions.cs new file mode 100644 index 0000000000..f05599c1b8 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionAddPricingOptions : INestedOptions + { + /// + /// V1 price details. Required if type is price. + /// + [JsonProperty("price_details")] + [STJS.JsonPropertyName("price_details")] + public ContractUpdatePricingLineActionAddPricingPriceDetailsOptions PriceDetails { get; set; } + + /// + /// The type of pricing. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingPriceDetailsOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingPriceDetailsOptions.cs new file mode 100644 index 0000000000..0f6a67f611 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddPricingPriceDetailsOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionAddPricingPriceDetailsOptions : INestedOptions + { + /// + /// The ID of the V1 price. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + + /// + /// The quantity for the price. Only applicable for licensed prices. + /// + [JsonProperty("quantity")] + [STJS.JsonPropertyName("quantity")] + public long? Quantity { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddStartsAtOptions.cs new file mode 100644 index 0000000000..af1e130206 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionAddStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionAddStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of start time to apply. + /// One of: billing_period_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionOptions.cs new file mode 100644 index 0000000000..d043789122 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionOptions.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionOptions : INestedOptions + { + /// + /// Parameters for adding a pricing line. + /// + [JsonProperty("add")] + [STJS.JsonPropertyName("add")] + public ContractUpdatePricingLineActionAddOptions Add { get; set; } + + /// + /// Parameters for removing a pricing line. + /// + [JsonProperty("remove")] + [STJS.JsonPropertyName("remove")] + public ContractUpdatePricingLineActionRemoveOptions Remove { get; set; } + + /// + /// The type of pricing line action. + /// One of: add, remove, or update. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// Parameters for updating a pricing line. + /// + [JsonProperty("update")] + [STJS.JsonPropertyName("update")] + public ContractUpdatePricingLineActionUpdateOptions Update { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionRemoveOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionRemoveOptions.cs new file mode 100644 index 0000000000..ca11b0ccb9 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionRemoveOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionRemoveOptions : INestedOptions, IHasId + { + /// + /// The ID of the pricing line to remove. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateEndsAtOptions.cs new file mode 100644 index 0000000000..e35d9fb539 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionUpdateEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of end time to apply. + /// One of: billing_period_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateOptions.cs new file mode 100644 index 0000000000..e12ed3b318 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionUpdateOptions : INestedOptions, IHasId + { + /// + /// The updated end time for the pricing line. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractUpdatePricingLineActionUpdateEndsAtOptions EndsAt { get; set; } + + /// + /// The ID of the pricing line. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// The updated start time for the pricing line. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractUpdatePricingLineActionUpdateStartsAtOptions StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateStartsAtOptions.cs new file mode 100644 index 0000000000..dde053c5fe --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingLineActionUpdateStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingLineActionUpdateStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of start time to apply. + /// One of: billing_period_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddEndsAtOptions.cs new file mode 100644 index 0000000000..65df1a04f6 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of end time to apply. + /// One of: billing_period_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionAllOfOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionAllOfOptions.cs new file mode 100644 index 0000000000..41d9b22ac9 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionAllOfOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionAllOfOptions : INestedOptions + { + /// + /// The metadata key. + /// + [JsonProperty("key")] + [STJS.JsonPropertyName("key")] + public string Key { get; set; } + + /// + /// The metadata value. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionOptions.cs new file mode 100644 index 0000000000..6bc3f69dad --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddMultiplierCriterionMetadataConditionOptions : INestedOptions + { + /// + /// All of these key-value conditions must match. + /// + [JsonProperty("all_of")] + [STJS.JsonPropertyName("all_of")] + public List AllOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionOptions.cs new file mode 100644 index 0000000000..e2c150afe9 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierCriterionOptions.cs @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddMultiplierCriterionOptions : INestedOptions + { + /// + /// Filter by billable item IDs. + /// + [JsonProperty("billable_item_ids")] + [STJS.JsonPropertyName("billable_item_ids")] + public List BillableItemIds { get; set; } + + /// + /// Filter by billable item lookup keys. + /// + [JsonProperty("billable_item_lookup_keys")] + [STJS.JsonPropertyName("billable_item_lookup_keys")] + public List BillableItemLookupKeys { get; set; } + + /// + /// Filter by billable item type. + /// One of: licensed, or metered. + /// + [JsonProperty("billable_item_types")] + [STJS.JsonPropertyName("billable_item_types")] + public List BillableItemTypes { get; set; } + + /// + /// Filter by metadata conditions. + /// + [JsonProperty("metadata_conditions")] + [STJS.JsonPropertyName("metadata_conditions")] + public List MetadataConditions { get; set; } + + /// + /// Filter by rate card IDs. Only applicable for multiplier overrides. + /// + [JsonProperty("rate_card_ids")] + [STJS.JsonPropertyName("rate_card_ids")] + public List RateCardIds { get; set; } + + /// + /// Whether to include or exclude items matching these criteria. + /// One of: exclude, or include. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierOptions.cs new file mode 100644 index 0000000000..239d71271e --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddMultiplierOptions.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddMultiplierOptions : INestedOptions + { + /// + /// Criteria determining which rates the multiplier applies to. + /// + [JsonProperty("criteria")] + [STJS.JsonPropertyName("criteria")] + public List Criteria { get; set; } + + /// + /// The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + /// + [JsonProperty("factor")] + [STJS.JsonPropertyName("factor")] + public string Factor { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs new file mode 100644 index 0000000000..4e1040c818 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddOptions : INestedOptions + { + /// + /// The end time for the pricing override. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractUpdatePricingOverrideActionAddEndsAtOptions EndsAt { get; set; } + + /// + /// A lookup key for the pricing override. + /// + [JsonProperty("lookup_key")] + [STJS.JsonPropertyName("lookup_key")] + public string LookupKey { get; set; } + + /// + /// A multiplier override to add. + /// + [JsonProperty("multiplier")] + [STJS.JsonPropertyName("multiplier")] + public ContractUpdatePricingOverrideActionAddMultiplierOptions Multiplier { get; set; } + + /// + /// An overwrite price override to add. + /// + [JsonProperty("overwrite_price")] + [STJS.JsonPropertyName("overwrite_price")] + public ContractUpdatePricingOverrideActionAddOverwritePriceOptions OverwritePrice { get; set; } + + /// + /// The priority for the pricing override. + /// + [JsonProperty("priority")] + [STJS.JsonPropertyName("priority")] + public long? Priority { get; set; } + + /// + /// The start time for the pricing override. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractUpdatePricingOverrideActionAddStartsAtOptions StartsAt { get; set; } + + /// + /// The type of pricing override to add. + /// One of: multiplier, or overwrite_price. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceOptions.cs new file mode 100644 index 0000000000..657d9de388 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceOptions.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddOverwritePriceOptions : INestedOptions + { + /// + /// The ID of the V1 price to overwrite. + /// + [JsonProperty("price")] + [STJS.JsonPropertyName("price")] + public string Price { get; set; } + + /// + /// Defines whether the tiered price should be graduated or volume-based. + /// One of: graduated, or volume. + /// + [JsonProperty("tiering_mode")] + [STJS.JsonPropertyName("tiering_mode")] + public string TieringMode { get; set; } + + /// + /// Each element represents a pricing tier. + /// + [JsonProperty("tiers")] + [STJS.JsonPropertyName("tiers")] + public List Tiers { get; set; } + + /// + /// The per-unit amount to be charged, represented as a decimal string in minor currency + /// units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceTierOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceTierOptions.cs new file mode 100644 index 0000000000..f045b53005 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOverwritePriceTierOptions.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddOverwritePriceTierOptions : INestedOptions + { + /// + /// Price for the entire tier, represented as a decimal string in minor currency units. + /// + [JsonProperty("flat_amount")] + [STJS.JsonPropertyName("flat_amount")] + public string FlatAmount { get; set; } + + /// + /// Per-unit price for units included in this tier, represented as a decimal string in minor + /// currency units. + /// + [JsonProperty("unit_amount")] + [STJS.JsonPropertyName("unit_amount")] + public string UnitAmount { get; set; } + + /// + /// Up to and including this quantity will be contained in the tier. + /// + [JsonProperty("up_to_decimal")] + [JsonConverter(typeof(DecimalStringConverter))] + [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] + [STJS.JsonPropertyName("up_to_decimal")] + public decimal? UpToDecimal { get; set; } + + /// + /// No upper bound to this tier. + /// + [JsonProperty("up_to_inf")] + [STJS.JsonPropertyName("up_to_inf")] + public string UpToInf { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddStartsAtOptions.cs new file mode 100644 index 0000000000..f04153e6fa --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionAddStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of start time to apply. + /// One of: billing_period_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionOptions.cs new file mode 100644 index 0000000000..26edb3c603 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionOptions.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionOptions : INestedOptions + { + /// + /// Parameters for adding a pricing override. + /// + [JsonProperty("add")] + [STJS.JsonPropertyName("add")] + public ContractUpdatePricingOverrideActionAddOptions Add { get; set; } + + /// + /// Parameters for removing a pricing override. + /// + [JsonProperty("remove")] + [STJS.JsonPropertyName("remove")] + public ContractUpdatePricingOverrideActionRemoveOptions Remove { get; set; } + + /// + /// The type of pricing override action. + /// One of: add, remove, or update. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// Parameters for updating a pricing override. + /// + [JsonProperty("update")] + [STJS.JsonPropertyName("update")] + public ContractUpdatePricingOverrideActionUpdateOptions Update { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionRemoveOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionRemoveOptions.cs new file mode 100644 index 0000000000..dd3184bb7e --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionRemoveOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionRemoveOptions : INestedOptions, IHasId + { + /// + /// The ID of the pricing override to remove. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateEndsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateEndsAtOptions.cs new file mode 100644 index 0000000000..f7e9ab8c61 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateEndsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionUpdateEndsAtOptions : INestedOptions + { + /// + /// The timestamp when the item ends. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of end time to apply. + /// One of: billing_period_end, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateOptions.cs new file mode 100644 index 0000000000..ff3427ad65 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionUpdateOptions : INestedOptions, IHasId + { + /// + /// The updated end time for the pricing override. + /// + [JsonProperty("ends_at")] + [STJS.JsonPropertyName("ends_at")] + public ContractUpdatePricingOverrideActionUpdateEndsAtOptions EndsAt { get; set; } + + /// + /// The ID of the pricing override. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// The updated start time for the pricing override. + /// + [JsonProperty("starts_at")] + [STJS.JsonPropertyName("starts_at")] + public ContractUpdatePricingOverrideActionUpdateStartsAtOptions StartsAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateStartsAtOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateStartsAtOptions.cs new file mode 100644 index 0000000000..8aa3cef174 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionUpdateStartsAtOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class ContractUpdatePricingOverrideActionUpdateStartsAtOptions : INestedOptions + { + /// + /// The timestamp when the item starts. + /// + [JsonProperty("timestamp")] + [STJS.JsonPropertyName("timestamp")] + public DateTime? Timestamp { get; set; } + + /// + /// The type of start time to apply. + /// One of: billing_period_start, or timestamp. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeListQuantityChangesOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeListQuantityChangesOptions.cs new file mode 100644 index 0000000000..ec7adbab8a --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeListQuantityChangesOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing.Contracts.LicensePricing +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class QuantityChangeListQuantityChangesOptions : V2.ListOptions + { + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeService.cs b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeService.cs new file mode 100644 index 0000000000..1c94c486ac --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricing/QuantityChanges/QuantityChangeService.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing.Contracts.LicensePricing +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class QuantityChangeService : Service + { + internal QuantityChangeService(ApiRequestor requestor) + : base(requestor) + { + } + + internal QuantityChangeService(IStripeClient client) + : base(client) + { + } + + /// + /// List license quantity changes for a contract given a license pricing ID. + /// + public virtual V2.StripeList ListQuantityChanges(string parentId, string id, QuantityChangeListQuantityChangesOptions options = null, RequestOptions requestOptions = null) + { + return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts/{WebUtility.UrlEncode(parentId)}/license_pricing/{WebUtility.UrlEncode(id)}/quantity_changes", options, requestOptions); + } + + /// + /// List license quantity changes for a contract given a license pricing ID. + /// + public virtual Task> ListQuantityChangesAsync(string parentId, string id, QuantityChangeListQuantityChangesOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/billing/contracts/{WebUtility.UrlEncode(parentId)}/license_pricing/{WebUtility.UrlEncode(id)}/quantity_changes", options, requestOptions, cancellationToken); + } + + /// + /// List license quantity changes for a contract given a license pricing ID. + /// + public virtual IEnumerable ListQuantityChangesAutoPaging(string parentId, string id, QuantityChangeListQuantityChangesOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v2/billing/contracts/{WebUtility.UrlEncode(parentId)}/license_pricing/{WebUtility.UrlEncode(id)}/quantity_changes", options, requestOptions); + } + + /// + /// List license quantity changes for a contract given a license pricing ID. + /// + public virtual IAsyncEnumerable ListQuantityChangesAutoPagingAsync(string parentId, string id, QuantityChangeListQuantityChangesOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v2/billing/contracts/{WebUtility.UrlEncode(parentId)}/license_pricing/{WebUtility.UrlEncode(id)}/quantity_changes", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricingService.cs b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricingService.cs new file mode 100644 index 0000000000..147ead9ab2 --- /dev/null +++ b/src/Stripe.net/Services/V2/Billing/Contracts/LicensePricingService.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Billing.Contracts +{ + using System; + using System.Threading; + using System.Threading.Tasks; + + public class LicensePricingService : Service + { + private V2.Billing.Contracts.LicensePricing.QuantityChangeService quantityChanges; + + internal LicensePricingService(ApiRequestor requestor) + : base(requestor) + { + } + + internal LicensePricingService(IStripeClient client) + : base(client) + { + } + + public virtual V2.Billing.Contracts.LicensePricing.QuantityChangeService QuantityChanges => this.quantityChanges ??= new V2.Billing.Contracts.LicensePricing.QuantityChangeService( + this.Requestor); + } +} diff --git a/src/Stripe.net/Services/V2/BillingService.cs b/src/Stripe.net/Services/V2/BillingService.cs index 1cbb2801ab..b3e7fbc0a1 100644 --- a/src/Stripe.net/Services/V2/BillingService.cs +++ b/src/Stripe.net/Services/V2/BillingService.cs @@ -10,6 +10,7 @@ public class BillingService : Service private V2.Billing.BillSettingService billSettings; private V2.Billing.CadenceService cadences; private V2.Billing.CollectionSettingService collectionSettings; + private V2.Billing.ContractService contracts; private V2.Billing.CustomPricingUnitService customPricingUnits; private V2.Billing.IntentService intents; private V2.Billing.LicenseFeeService licenseFees; @@ -46,6 +47,9 @@ internal BillingService(IStripeClient client) public virtual V2.Billing.CollectionSettingService CollectionSettings => this.collectionSettings ??= new V2.Billing.CollectionSettingService( this.Requestor); + public virtual V2.Billing.ContractService Contracts => this.contracts ??= new V2.Billing.ContractService( + this.Requestor); + public virtual V2.Billing.CustomPricingUnitService CustomPricingUnits => this.customPricingUnits ??= new V2.Billing.CustomPricingUnitService( this.Requestor); diff --git a/src/Stripe.net/Services/V2/Core/Accounts/AccountCreateDefaultsResponsibilitiesOptions.cs b/src/Stripe.net/Services/V2/Core/Accounts/AccountCreateDefaultsResponsibilitiesOptions.cs index d11d406b5b..67b9a8afc8 100644 --- a/src/Stripe.net/Services/V2/Core/Accounts/AccountCreateDefaultsResponsibilitiesOptions.cs +++ b/src/Stripe.net/Services/V2/Core/Accounts/AccountCreateDefaultsResponsibilitiesOptions.cs @@ -25,5 +25,13 @@ public class AccountCreateDefaultsResponsibilitiesOptions : INestedOptions [JsonProperty("losses_collector")] [STJS.JsonPropertyName("losses_collector")] public string LossesCollector { get; set; } + + /// + /// A value indicating the party responsible for collecting requirements on this account. + /// One of: application, or stripe. + /// + [JsonProperty("requirements_collector")] + [STJS.JsonPropertyName("requirements_collector")] + public string RequirementsCollector { get; set; } } } diff --git a/src/Stripe.net/Services/V2/Core/Accounts/AccountUpdateDefaultsResponsibilitiesOptions.cs b/src/Stripe.net/Services/V2/Core/Accounts/AccountUpdateDefaultsResponsibilitiesOptions.cs index 8f7b94ac13..39a205f189 100644 --- a/src/Stripe.net/Services/V2/Core/Accounts/AccountUpdateDefaultsResponsibilitiesOptions.cs +++ b/src/Stripe.net/Services/V2/Core/Accounts/AccountUpdateDefaultsResponsibilitiesOptions.cs @@ -25,5 +25,13 @@ public class AccountUpdateDefaultsResponsibilitiesOptions : INestedOptions [JsonProperty("losses_collector")] [STJS.JsonPropertyName("losses_collector")] public string LossesCollector { get; set; } + + /// + /// A value indicating the party responsible for collecting requirements on this account. + /// One of: application, or stripe. + /// + [JsonProperty("requirements_collector")] + [STJS.JsonPropertyName("requirements_collector")] + public string RequirementsCollector { get; set; } } } diff --git a/src/Stripe.net/Services/V2/Data/Reporting/QueryRuns/QueryRunGetOptions.cs b/src/Stripe.net/Services/V2/Data/Reporting/QueryRuns/QueryRunGetOptions.cs index 2b9e594ec3..2e58446e5a 100644 --- a/src/Stripe.net/Services/V2/Data/Reporting/QueryRuns/QueryRunGetOptions.cs +++ b/src/Stripe.net/Services/V2/Data/Reporting/QueryRuns/QueryRunGetOptions.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe.V2.Data.Reporting { + using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; using STJS = System.Text.Json.Serialization; @@ -8,5 +9,11 @@ namespace Stripe.V2.Data.Reporting [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class QueryRunGetOptions : BaseOptions { + /// + /// Any optional includes (see https://docs.stripe.com/api-includable-response-values). + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } } } diff --git a/src/Stripe.net/Services/V2/MoneyManagement/OutboundPayments/OutboundPaymentCreateOptions.cs b/src/Stripe.net/Services/V2/MoneyManagement/OutboundPayments/OutboundPaymentCreateOptions.cs index 886c81a5b0..3bf38d50dc 100644 --- a/src/Stripe.net/Services/V2/MoneyManagement/OutboundPayments/OutboundPaymentCreateOptions.cs +++ b/src/Stripe.net/Services/V2/MoneyManagement/OutboundPayments/OutboundPaymentCreateOptions.cs @@ -78,8 +78,8 @@ public class OutboundPaymentCreateOptions : BaseOptions, IHasMetadata /// /// The description that appears on the receiving end for an OutboundPayment (for example, - /// on a bank statement). Must be between 3 and 22 characters long, and not contain - /// profanity. + /// on a bank statement). Must be between 3 and 22 characters long for most destinations + /// (500 for FinancialAccount destinations), and not contain profanity. /// [JsonProperty("statement_descriptor")] [STJS.JsonPropertyName("statement_descriptor")] diff --git a/src/Stripe.net/Services/V2/MoneyManagement/OutboundTransfers/OutboundTransferCreateOptions.cs b/src/Stripe.net/Services/V2/MoneyManagement/OutboundTransfers/OutboundTransferCreateOptions.cs index 3f278219df..888c693383 100644 --- a/src/Stripe.net/Services/V2/MoneyManagement/OutboundTransfers/OutboundTransferCreateOptions.cs +++ b/src/Stripe.net/Services/V2/MoneyManagement/OutboundTransfers/OutboundTransferCreateOptions.cs @@ -56,8 +56,8 @@ public class OutboundTransferCreateOptions : BaseOptions, IHasMetadata /// /// The description that appears on the receiving end for an OutboundTransfer (for example, - /// on a bank statement). Must be between 3 and 22 characters long, and not contain - /// profanity. + /// on a bank statement). Must be between 3 and 22 characters long for most destinations + /// (500 for FinancialAccount destinations), and not contain profanity. /// [JsonProperty("statement_descriptor")] [STJS.JsonPropertyName("statement_descriptor")] diff --git a/src/Stripe.net/Services/V2/PaymentService.cs b/src/Stripe.net/Services/V2/PaymentsService.cs similarity index 84% rename from src/Stripe.net/Services/V2/PaymentService.cs rename to src/Stripe.net/Services/V2/PaymentsService.cs index eff7c262e5..531f8ad7e9 100644 --- a/src/Stripe.net/Services/V2/PaymentService.cs +++ b/src/Stripe.net/Services/V2/PaymentsService.cs @@ -5,17 +5,17 @@ namespace Stripe.V2 using System.Threading; using System.Threading.Tasks; - public class PaymentService : Service + public class PaymentsService : Service { private V2.Payments.OffSessionPaymentService offSessionPayments; private V2.Payments.SettlementAllocationIntentService settlementAllocationIntents; - internal PaymentService(ApiRequestor requestor) + internal PaymentsService(ApiRequestor requestor) : base(requestor) { } - internal PaymentService(IStripeClient client) + internal PaymentsService(IStripeClient client) : base(client) { } diff --git a/src/Stripe.net/Services/V2/Reporting/ReportRuns/ReportRunGetOptions.cs b/src/Stripe.net/Services/V2/Reporting/ReportRuns/ReportRunGetOptions.cs index 89761c597d..e939ca4ed5 100644 --- a/src/Stripe.net/Services/V2/Reporting/ReportRuns/ReportRunGetOptions.cs +++ b/src/Stripe.net/Services/V2/Reporting/ReportRuns/ReportRunGetOptions.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe.V2.Reporting { + using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; using STJS = System.Text.Json.Serialization; @@ -8,5 +9,11 @@ namespace Stripe.V2.Reporting [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ReportRunGetOptions : BaseOptions { + /// + /// Any optional includes (see https://docs.stripe.com/api-includable-response-values). + /// + [JsonProperty("include")] + [STJS.JsonPropertyName("include")] + public List Include { get; set; } } } diff --git a/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalGetOptions.cs b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalGetOptions.cs new file mode 100644 index 0000000000..38c54155c6 --- /dev/null +++ b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalGetOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class AccountSignalGetOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListAccountDetailsOptions.cs b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListAccountDetailsOptions.cs new file mode 100644 index 0000000000..cd4ccdcd92 --- /dev/null +++ b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListAccountDetailsOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class AccountSignalListAccountDetailsOptions : INestedOptions + { + /// + /// The v2 account ID of the account. + /// + [JsonProperty("account")] + [STJS.JsonPropertyName("account")] + public string Account { get; set; } + + /// + /// The v1 customer ID of the account, for users not yet migrated to v2/accounts. + /// + [JsonProperty("customer")] + [STJS.JsonPropertyName("customer")] + public string Customer { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListOptions.cs b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListOptions.cs new file mode 100644 index 0000000000..2cd79d2109 --- /dev/null +++ b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalListOptions.cs @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class AccountSignalListOptions : V2.ListOptions + { + /// + /// The account or customer to list signals for. Exactly one of account_details.account or + /// account_details.customer must be provided. + /// + [JsonProperty("account_details")] + [STJS.JsonPropertyName("account_details")] + public AccountSignalListAccountDetailsOptions AccountDetails { get; set; } + + /// + /// Signal types to filter by. + /// One of: fraudulent_merchant, or merchant_delinquency. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public List Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalService.cs b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalService.cs new file mode 100644 index 0000000000..278e54525f --- /dev/null +++ b/src/Stripe.net/Services/V2/Signals/AccountSignals/AccountSignalService.cs @@ -0,0 +1,71 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Signals +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class AccountSignalService : Service + { + internal AccountSignalService(ApiRequestor requestor) + : base(requestor) + { + } + + internal AccountSignalService(IStripeClient client) + : base(client) + { + } + + /// + /// Retrieves an AccountSignal by its ID. + /// + public virtual AccountSignal Get(string id, AccountSignalGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v2/signals/account_signals/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + /// Retrieves an AccountSignal by its ID. + /// + public virtual Task GetAsync(string id, AccountSignalGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v2/signals/account_signals/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + + /// + /// Lists AccountSignals for a given account or customer, filtered by signal type. + /// + public virtual V2.StripeList List(AccountSignalListOptions options = null, RequestOptions requestOptions = null) + { + return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/signals/account_signals", options, requestOptions); + } + + /// + /// Lists AccountSignals for a given account or customer, filtered by signal type. + /// + public virtual Task> ListAsync(AccountSignalListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/signals/account_signals", options, requestOptions, cancellationToken); + } + + /// + /// Lists AccountSignals for a given account or customer, filtered by signal type. + /// + public virtual IEnumerable ListAutoPaging(AccountSignalListOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v2/signals/account_signals", options, requestOptions); + } + + /// + /// Lists AccountSignals for a given account or customer, filtered by signal type. + /// + public virtual IAsyncEnumerable ListAutoPagingAsync(AccountSignalListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v2/signals/account_signals", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/V2/SignalsService.cs b/src/Stripe.net/Services/V2/SignalsService.cs new file mode 100644 index 0000000000..ac146be826 --- /dev/null +++ b/src/Stripe.net/Services/V2/SignalsService.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2 +{ + using System; + using System.Threading; + using System.Threading.Tasks; + + public class SignalsService : Service + { + private V2.Signals.AccountSignalService accountSignals; + + internal SignalsService(ApiRequestor requestor) + : base(requestor) + { + } + + internal SignalsService(IStripeClient client) + : base(client) + { + } + + public virtual V2.Signals.AccountSignalService AccountSignals => this.accountSignals ??= new V2.Signals.AccountSignalService( + this.Requestor); + } +} diff --git a/src/Stripe.net/Services/V2Services.cs b/src/Stripe.net/Services/V2Services.cs index 525f422139..421f0aba61 100644 --- a/src/Stripe.net/Services/V2Services.cs +++ b/src/Stripe.net/Services/V2Services.cs @@ -16,8 +16,9 @@ public class V2Services : Service private V2.MoneyManagementService moneyManagement; private V2.NetworkService network; private V2.OrchestratedCommerceService orchestratedCommerce; - private V2.PaymentService payments; + private V2.PaymentsService payments; private V2.ReportingService reporting; + private V2.SignalsService signals; private V2.TaxService tax; private V2.TestHelperService testHelpers; @@ -58,12 +59,15 @@ internal V2Services(IStripeClient client) public virtual V2.OrchestratedCommerceService OrchestratedCommerce => this.orchestratedCommerce ??= new V2.OrchestratedCommerceService( this.Requestor); - public virtual V2.PaymentService Payments => this.payments ??= new V2.PaymentService( + public virtual V2.PaymentsService Payments => this.payments ??= new V2.PaymentsService( this.Requestor); public virtual V2.ReportingService Reporting => this.reporting ??= new V2.ReportingService( this.Requestor); + public virtual V2.SignalsService Signals => this.signals ??= new V2.SignalsService( + this.Requestor); + public virtual V2.TaxService Tax => this.tax ??= new V2.TaxService( this.Requestor); diff --git a/src/StripeTests/Infrastructure/Public/LiveApiRequestorTest.cs b/src/StripeTests/Infrastructure/Public/LiveApiRequestorTest.cs index 97e4d72963..4a1d881bb0 100644 --- a/src/StripeTests/Infrastructure/Public/LiveApiRequestorTest.cs +++ b/src/StripeTests/Infrastructure/Public/LiveApiRequestorTest.cs @@ -6,6 +6,7 @@ namespace StripeTests using System.Linq; using System.Net; using System.Net.Http; + using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -711,6 +712,137 @@ public async Task StripeAccountHeaderSet() Assert.Equal("acct_2345", lastRequest.StripeHeaders["Stripe-Account"]); } + [Fact] + public async Task RequestAsync_WritesToStderr_WhenStripeNoticeHeaderPresent() + { + var headers = BuildHeaders("Stripe-Notice", "test notice message"); + var response = new StripeResponse(HttpStatusCode.OK, headers, "{\"id\": \"ch_123\"}"); + this.httpClient.Response = response; + + var stderr = new StringWriter(); + Console.SetError(stderr); + try + { + await this.apiRequestor.RequestAsync( + BaseAddress.Api, + HttpMethod.Post, + "/v1/charges", + this.options, + this.requestOptions); + + Assert.Contains("test notice message", stderr.ToString()); + } + finally + { + Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true }); + } + } + + [Fact] + public async Task RequestAsync_NoStderrWrite_WhenStripeNoticeHeaderAbsent() + { + var response = new StripeResponse(HttpStatusCode.OK, null, "{\"id\": \"ch_123\"}"); + this.httpClient.Response = response; + + var stderr = new StringWriter(); + Console.SetError(stderr); + try + { + await this.apiRequestor.RequestAsync( + BaseAddress.Api, + HttpMethod.Post, + "/v1/charges", + this.options, + this.requestOptions); + + Assert.Empty(stderr.ToString()); + } + finally + { + Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true }); + } + } + + [Fact] + public async Task RequestAsync_NoStderrWrite_WhenStripeNoticeHeaderEmpty() + { + var headers = BuildHeaders("Stripe-Notice", string.Empty); + var response = new StripeResponse(HttpStatusCode.OK, headers, "{\"id\": \"ch_123\"}"); + this.httpClient.Response = response; + + var stderr = new StringWriter(); + Console.SetError(stderr); + try + { + await this.apiRequestor.RequestAsync( + BaseAddress.Api, + HttpMethod.Post, + "/v1/charges", + this.options, + this.requestOptions); + + Assert.Empty(stderr.ToString()); + } + finally + { + Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true }); + } + } + + [Fact] + public async Task RawRequestAsync_WritesToStderr_WhenStripeNoticeHeaderPresent() + { + var headers = BuildHeaders("Stripe-Notice", "raw notice message"); + var response = new StripeResponse(HttpStatusCode.OK, headers, "{\"id\": \"ch_123\"}"); + this.httpClient.Response = response; + + var stderr = new StringWriter(); + Console.SetError(stderr); + try + { + await this.apiRequestor.RawRequestAsync( + HttpMethod.Post, + "/v1/charges", + "foo=bar"); + + Assert.Contains("raw notice message", stderr.ToString()); + } + finally + { + Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true }); + } + } + + [Fact] + public async Task RawRequestAsync_NoStderrWrite_WhenStripeNoticeHeaderAbsent() + { + var response = new StripeResponse(HttpStatusCode.OK, null, "{\"id\": \"ch_123\"}"); + this.httpClient.Response = response; + + var stderr = new StringWriter(); + Console.SetError(stderr); + try + { + await this.apiRequestor.RawRequestAsync( + HttpMethod.Post, + "/v1/charges", + "foo=bar"); + + Assert.Empty(stderr.ToString()); + } + finally + { + Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true }); + } + } + + private static HttpResponseHeaders BuildHeaders(string name, string value) + { + var message = new HttpResponseMessage(); + message.Headers.Add(name, value); + return message.Headers; + } + private class Foo : StripeEntity { [JsonProperty("bar")] diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index 99b30a310e..1de3a8407a 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -6521,6 +6521,383 @@ public void TestV2BillingCollectionSettingsVersionGet2() "/v2/billing/collection_settings/collection_setting_id_123/versions/id_123"); } + [Fact] + public void TestV2BillingContractGet() + { + this.StubRequest( + HttpMethod.Get, + "/v2/billing/contracts", + (HttpStatusCode)200, + "{\"data\":[{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}],\"next_page_url\":null,\"previous_page_url\":null}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.StripeList contracts = service + .List(); + this.AssertRequest(HttpMethod.Get, "/v2/billing/contracts"); + } + + [Fact] + public void TestV2BillingContractPost() + { + this.StubRequest( + HttpMethod.Post, + "/v2/billing/contracts", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}"); + var options = new Stripe.V2.Billing.ContractCreateOptions + { + ContractLines = new List + { + new Stripe.V2.Billing.ContractCreateContractLineOptions + { + EndsAt = new Stripe.V2.Billing.ContractCreateContractLineEndsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + }, + Metadata = new Dictionary + { + { "key", "metadata" }, + }, + Overrides = new List + { + new Stripe.V2.Billing.ContractCreateContractLineOverrideOptions + { + EndsAt = new Stripe.V2.Billing.ContractCreateContractLineOverrideEndsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + }, + ServiceAction = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionOptions + { + Add = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddOptions + { + CreditGrant = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddCreditGrantOptions + { + Amount = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddCreditGrantAmountOptions + { + Monetary = new Stripe.V2.Amount + { + Value = 63, + Currency = "USD", + }, + Type = "monetary", + }, + ApplicabilityConfig = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigOptions + { + Scope = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScopeOptions + { + BillableItems = new List + { + "billable_items", + }, + PriceType = "metered", + }, + }, + Category = "paid", + ExpiryConfig = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionAddCreditGrantExpiryConfigOptions + { + Type = "end_of_service_period", + }, + Name = "name", + Priority = 1165461084, + }, + ServiceInterval = "month", + ServiceIntervalCount = 1375336415, + Type = "credit_grant", + }, + Replace = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceOptions + { + CreditGrant = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceCreditGrantOptions + { + Amount = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceCreditGrantAmountOptions + { + Monetary = new Stripe.V2.Amount + { + Value = 63, + Currency = "USD", + }, + Type = "monetary", + }, + ApplicabilityConfig = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigOptions + { + Scope = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScopeOptions + { + BillableItems = new List + { + "billable_items", + }, + PriceType = "metered", + }, + }, + Category = "paid", + ExpiryConfig = new Stripe.V2.Billing.ContractCreateContractLineOverrideServiceActionReplaceCreditGrantExpiryConfigOptions + { + Type = "end_of_service_period", + }, + Name = "name", + Priority = 1165461084, + }, + Id = "obj_123", + LookupKey = "lookup_key", + ServiceInterval = "month", + ServiceIntervalCount = 1375336415, + Type = "credit_grant", + }, + Type = "add", + }, + StartsAt = new Stripe.V2.Billing.ContractCreateContractLineOverrideStartsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + }, + Type = "service_action", + }, + }, + Pricing = new Stripe.V2.Billing.ContractCreateContractLinePricingOptions(), + StartsAt = new Stripe.V2.Billing.ContractCreateContractLineStartsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + }, + }, + }, + ContractNumber = "contract_number", + Currency = "usd", + LicenseQuantityActions = new List + { + new Stripe.V2.Billing.ContractCreateLicenseQuantityActionOptions + { + EffectiveAt = new Stripe.V2.Billing.ContractCreateLicenseQuantityActionEffectiveAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + Type = "timestamp", + }, + LicensePricingId = "license_pricing_id", + LicensePricingLookupKey = "license_pricing_lookup_key", + LicensePricingType = "price", + PricingLine = "pricing_line", + Set = new Stripe.V2.Billing.ContractCreateLicenseQuantityActionSetOptions + { + Quantity = 1285004149, + }, + Type = "set", + }, + }, + PricingLines = new List + { + new Stripe.V2.Billing.ContractCreatePricingLineOptions + { + EndsAt = new Stripe.V2.Billing.ContractCreatePricingLineEndsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + Type = "contract_end", + }, + LookupKey = "lookup_key", + Metadata = new Dictionary + { + { "key", "metadata" }, + }, + Pricing = new Stripe.V2.Billing.ContractCreatePricingLinePricingOptions + { + PriceDetails = new Stripe.V2.Billing.ContractCreatePricingLinePricingPriceDetailsOptions + { + Price = "price", + Quantity = 1285004149, + }, + Type = "price", + }, + StartsAt = new Stripe.V2.Billing.ContractCreatePricingLineStartsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + Type = "contract_start", + }, + }, + }, + PricingOverrides = new List + { + new Stripe.V2.Billing.ContractCreatePricingOverrideOptions + { + EndsAt = new Stripe.V2.Billing.ContractCreatePricingOverrideEndsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + Type = "contract_end", + }, + LookupKey = "lookup_key", + Multiplier = new Stripe.V2.Billing.ContractCreatePricingOverrideMultiplierOptions + { + Criteria = new List + { + new Stripe.V2.Billing.ContractCreatePricingOverrideMultiplierCriterionOptions + { + BillableItemIds = new List + { + "billable_item_ids", + }, + BillableItemLookupKeys = new List + { + "billable_item_lookup_keys", + }, + BillableItemTypes = new List + { + "metered", + }, + MetadataConditions = new List + { + new Stripe.V2.Billing.ContractCreatePricingOverrideMultiplierCriterionMetadataConditionOptions + { + AllOf = new List + { + new Stripe.V2.Billing.ContractCreatePricingOverrideMultiplierCriterionMetadataConditionAllOfOptions + { + Key = "key", + Value = "value", + }, + }, + }, + }, + RateCardIds = new List + { + "rate_card_ids", + }, + Type = "exclude", + }, + }, + Factor = "factor", + }, + OverwritePrice = new Stripe.V2.Billing.ContractCreatePricingOverrideOverwritePriceOptions + { + Price = "price", + TieringMode = "graduated", + Tiers = new List + { + new Stripe.V2.Billing.ContractCreatePricingOverrideOverwritePriceTierOptions + { + FlatAmount = "flat_amount", + UnitAmount = "unit_amount", + UpToDecimal = 1387931359.3333333M, + UpToInf = "inf", + }, + }, + UnitAmount = "unit_amount", + }, + Priority = 1165461084, + StartsAt = new Stripe.V2.Billing.ContractCreatePricingOverrideStartsAtOptions + { + Timestamp = DateTimeOffset.Parse( + "1970-01-01T15:18:46.294Z") + .UtcDateTime, + Type = "contract_start", + }, + Type = "multiplier", + }, + }, + }; + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.Billing.Contract contract = service.Create(options); + this.AssertRequest(HttpMethod.Post, "/v2/billing/contracts"); + } + + [Fact] + public void TestV2BillingContractGet2() + { + this.StubRequest( + HttpMethod.Get, + "/v2/billing/contracts/id_123", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.Billing.Contract contract = service.Get("id_123"); + this.AssertRequest(HttpMethod.Get, "/v2/billing/contracts/id_123"); + } + + [Fact] + public void TestV2BillingContractPost2() + { + this.StubRequest( + HttpMethod.Post, + "/v2/billing/contracts/id_123", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}"); + var options = new Stripe.V2.Billing.ContractUpdateOptions(); + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.Billing.Contract contract = service.Update( + "id_123", + options); + this.AssertRequest(HttpMethod.Post, "/v2/billing/contracts/id_123"); + } + + [Fact] + public void TestV2BillingContractPost3() + { + this.StubRequest( + HttpMethod.Post, + "/v2/billing/contracts/id_123/activate", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.Billing.Contract contract = service.Activate("id_123"); + this.AssertRequest( + HttpMethod.Post, + "/v2/billing/contracts/id_123/activate"); + } + + [Fact] + public void TestV2BillingContractPost4() + { + this.StubRequest( + HttpMethod.Post, + "/v2/billing/contracts/id_123/cancel", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.contract\",\"contract_line_details\":[{\"contract_line\":\"contract_line\",\"contract_line_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"service_action\"}],\"pricing\":{},\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"contract_number\":\"contract_number\",\"contract_value_details\":{\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"customer\":\"customer\",\"id\":\"obj_123\",\"license_quantities\":[{\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"livemode\":true,\"pricing_lines\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing\":{\"type\":\"price\"},\"pricing_line\":\"pricing_line\",\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"}}],\"pricing_overrides\":[{\"ends_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"pricing_override\":\"pricing_override\",\"priority\":1165461084,\"starts_at\":{\"timestamp\":\"1970-01-01T15:18:46.294Z\"},\"type\":\"multiplier\"}],\"status\":\"draft\",\"status_details\":{}}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.Contracts; + Stripe.V2.Billing.Contract contract = service.Cancel("id_123"); + this.AssertRequest( + HttpMethod.Post, + "/v2/billing/contracts/id_123/cancel"); + } + + [Fact] + public void TestV2BillingContractsLicensePricingQuantityChangeGet() + { + this.StubRequest( + HttpMethod.Get, + "/v2/billing/contracts/contract_id_123/license_pricing/license_pricing_id_123/quantity_changes", + (HttpStatusCode)200, + "{\"data\":[{\"object\":\"v2.billing.contract_license_pricing_quantity_change\",\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"license_pricing_id\":\"license_pricing_id\",\"license_pricing_type\":\"price\",\"livemode\":true,\"pricing_line\":\"pricing_line\",\"quantity\":1285004149}],\"next_page_url\":null,\"previous_page_url\":null}"); + var client = new StripeClient(this.Requestor); + var service = client + .V2 + .Billing + .Contracts + .LicensePricing + .QuantityChanges; + Stripe.V2.StripeList contractLicensePricingQuantityChanges = service + .ListQuantityChanges( + "contract_id_123", + "license_pricing_id_123"); + this.AssertRequest( + HttpMethod.Get, + "/v2/billing/contracts/contract_id_123/license_pricing/license_pricing_id_123/quantity_changes"); + } + [Fact] public void TestV2BillingCustomPricingUnitGet() { @@ -11058,6 +11435,46 @@ public void TestV2ReportingReportRunGet() "/v2/reporting/report_runs/id_123"); } + [Fact] + public void TestV2SignalsAccountSignalGet() + { + this.StubRequest( + HttpMethod.Get, + "/v2/signals/account_signals", + (HttpStatusCode)200, + "{\"data\":[{\"object\":\"v2.signals.account_signal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"type\":\"fraudulent_merchant\"}],\"next_page_url\":null,\"previous_page_url\":null}", + "type[0]=fraudulent_merchant"); + var options = new Stripe.V2.Signals.AccountSignalListOptions + { + Type = new List { "fraudulent_merchant" }, + }; + var client = new StripeClient(this.Requestor); + var service = client.V2.Signals.AccountSignals; + Stripe.V2.StripeList accountSignals = service + .List(options); + this.AssertRequest( + HttpMethod.Get, + "/v2/signals/account_signals", + "type[0]=fraudulent_merchant"); + } + + [Fact] + public void TestV2SignalsAccountSignalGet2() + { + this.StubRequest( + HttpMethod.Get, + "/v2/signals/account_signals/id_123", + (HttpStatusCode)200, + "{\"object\":\"v2.signals.account_signal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"type\":\"fraudulent_merchant\"}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Signals.AccountSignals; + Stripe.V2.Signals.AccountSignal accountSignal = service.Get( + "id_123"); + this.AssertRequest( + HttpMethod.Get, + "/v2/signals/account_signals/id_123"); + } + [Fact] public void TestV2TaxManualRuleGet() {