Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #2801

Merged
merged 7 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v680
v691
35 changes: 35 additions & 0 deletions src/Stripe.net/Constants/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,41 @@ public static class Events
/// </summary>
public const string CheckoutSessionExpired = "checkout.session.expired";

/// <summary>
/// Occurs when a Climate order is canceled.
/// </summary>
public const string ClimateOrderCanceled = "climate.order.canceled";

/// <summary>
/// Occurs when a Climate order is created.
/// </summary>
public const string ClimateOrderCreated = "climate.order.created";

/// <summary>
/// Occurs when a Climate order is delayed.
/// </summary>
public const string ClimateOrderDelayed = "climate.order.delayed";

/// <summary>
/// Occurs when a Climate order is delivered.
/// </summary>
public const string ClimateOrderDelivered = "climate.order.delivered";

/// <summary>
/// Occurs when a Climate order's product is substituted for another.
/// </summary>
public const string ClimateOrderProductSubstituted = "climate.order.product_substituted";

/// <summary>
/// Occurs when a Climate product is created.
/// </summary>
public const string ClimateProductCreated = "climate.product.created";

/// <summary>
/// Occurs when a Climate product is updated.
/// </summary>
public const string ClimateProductPricingUpdated = "climate.product.pricing_updated";

/// <summary>
/// Occurs whenever a coupon is created.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public IBalanceTransactionSource Source
/// <summary>
/// Transaction type: <c>adjustment</c>, <c>advance</c>, <c>advance_funding</c>,
/// <c>anticipation_repayment</c>, <c>application_fee</c>, <c>application_fee_refund</c>,
/// <c>charge</c>, <c>connect_collection_transfer</c>, <c>contribution</c>,
/// <c>charge</c>, <c>climate_order_purchase</c>, <c>climate_order_refund</c>,
/// <c>connect_collection_transfer</c>, <c>contribution</c>,
/// <c>issuing_authorization_hold</c>, <c>issuing_authorization_release</c>,
/// <c>issuing_dispute</c>, <c>issuing_transaction</c>, <c>obligation_inbound</c>,
/// <c>obligation_outbound</c>, <c>obligation_reversal_inbound</c>,
Expand All @@ -164,7 +165,8 @@ public IBalanceTransactionSource Source
/// consider <c>reporting_category</c> instead.
/// One of: <c>adjustment</c>, <c>advance</c>, <c>advance_funding</c>,
/// <c>anticipation_repayment</c>, <c>application_fee</c>, <c>application_fee_refund</c>,
/// <c>charge</c>, <c>connect_collection_transfer</c>, <c>contribution</c>,
/// <c>charge</c>, <c>climate_order_purchase</c>, <c>climate_order_refund</c>,
/// <c>connect_collection_transfer</c>, <c>contribution</c>,
/// <c>issuing_authorization_hold</c>, <c>issuing_authorization_release</c>,
/// <c>issuing_dispute</c>, <c>issuing_transaction</c>, <c>obligation_inbound</c>,
/// <c>obligation_outbound</c>, <c>obligation_payout</c>, <c>obligation_payout_failure</c>,
Expand Down
185 changes: 185 additions & 0 deletions src/Stripe.net/Entities/Climate/Orders/Order.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
// File generated from our OpenAPI spec
namespace Stripe.Climate
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;

/// <summary>
/// Orders represent your intent to purchase a particular Climate product. When you create
/// an order, the payment is deducted from your merchant balance.
/// </summary>
public class Order : StripeEntity<Order>, IHasId, IHasMetadata, IHasObject
{
/// <summary>
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// Total amount of <a href="https://frontierclimate.com/">Frontier</a>'s service fees in
/// the currency's smallest unit.
/// </summary>
[JsonProperty("amount_fees")]
public long AmountFees { get; set; }

/// <summary>
/// Total amount of the carbon removal in the currency's smallest unit.
/// </summary>
[JsonProperty("amount_subtotal")]
public long AmountSubtotal { get; set; }

/// <summary>
/// Total amount of the order including fees in the currency's smallest unit.
/// </summary>
[JsonProperty("amount_total")]
public long AmountTotal { get; set; }

[JsonProperty("beneficiary")]
public OrderBeneficiary Beneficiary { get; set; }

/// <summary>
/// Time at which the order was canceled. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("canceled_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? CanceledAt { get; set; }

/// <summary>
/// Reason for the cancellation of this order.
/// One of: <c>expired</c>, <c>product_unavailable</c>, or <c>requested</c>.
/// </summary>
[JsonProperty("cancellation_reason")]
public string CancellationReason { get; set; }

/// <summary>
/// For delivered orders, a URL to a delivery certificate for the order.
/// </summary>
[JsonProperty("certificate")]
public string Certificate { get; set; }

/// <summary>
/// Time at which the order was confirmed. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("confirmed_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? ConfirmedAt { get; set; }

/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("created")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
/// code</a>, in lowercase, representing the currency for this order.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// Time at which the order's expected_delivery_year was delayed. Measured in seconds since
/// the Unix epoch.
/// </summary>
[JsonProperty("delayed_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? DelayedAt { get; set; }

/// <summary>
/// Time at which the order was delivered. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("delivered_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? DeliveredAt { get; set; }

/// <summary>
/// Details about the delivery of carbon removal for this order.
/// </summary>
[JsonProperty("delivery_details")]
public List<OrderDeliveryDetail> DeliveryDetails { get; set; }

/// <summary>
/// The year this order is expected to be delivered.
/// </summary>
[JsonProperty("expected_delivery_year")]
public long ExpectedDeliveryYear { get; set; }

/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
/// the object exists in test mode.
/// </summary>
[JsonProperty("livemode")]
public bool Livemode { get; set; }

/// <summary>
/// Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
/// attach to an object. This can be useful for storing additional information about the
/// object in a structured format.
/// </summary>
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// Quantity of carbon removal that is included in this order.
/// </summary>
[JsonProperty("metric_tons")]
public decimal MetricTons { get; set; }

#region Expandable Product

/// <summary>
/// (ID of the Product)
/// Unique ID for the Climate <c>Product</c> this order is purchasing.
/// </summary>
[JsonIgnore]
public string ProductId
{
get => this.InternalProduct?.Id;
set => this.InternalProduct = SetExpandableFieldId(value, this.InternalProduct);
}

/// <summary>
/// (Expanded)
/// Unique ID for the Climate <c>Product</c> this order is purchasing.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Product Product
{
get => this.InternalProduct?.ExpandedObject;
set => this.InternalProduct = SetExpandableFieldObject(value, this.InternalProduct);
}

[JsonProperty("product")]
[JsonConverter(typeof(ExpandableFieldConverter<Product>))]
internal ExpandableField<Product> InternalProduct { get; set; }
#endregion

/// <summary>
/// Time at which the order's product was substituted for a different product. Measured in
/// seconds since the Unix epoch.
/// </summary>
[JsonProperty("product_substituted_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? ProductSubstitutedAt { get; set; }

/// <summary>
/// The current status of this order.
/// One of: <c>awaiting_funds</c>, <c>canceled</c>, <c>confirmed</c>, <c>delivered</c>, or
/// <c>open</c>.
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Stripe.net/Entities/Climate/Orders/OrderBeneficiary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe.Climate
{
using Newtonsoft.Json;

public class OrderBeneficiary : StripeEntity<OrderBeneficiary>
{
/// <summary>
/// Publicly displayable name for the end beneficiary of carbon removal.
/// </summary>
[JsonProperty("public_name")]
public string PublicName { get; set; }
}
}
41 changes: 41 additions & 0 deletions src/Stripe.net/Entities/Climate/Orders/OrderDeliveryDetail.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// File generated from our OpenAPI spec
namespace Stripe.Climate
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class OrderDeliveryDetail : StripeEntity<OrderDeliveryDetail>
{
/// <summary>
/// Time at which the delivery occurred. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("delivered_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime DeliveredAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Specific location of this delivery.
/// </summary>
[JsonProperty("location")]
public OrderDeliveryDetailLocation Location { get; set; }

/// <summary>
/// Quantity of carbon removal supplied by this delivery.
/// </summary>
[JsonProperty("metric_tons")]
public string MetricTons { get; set; }

/// <summary>
/// Once retired, a URL to the registry entry for the tons from this delivery.
/// </summary>
[JsonProperty("registry_url")]
public string RegistryUrl { get; set; }

/// <summary>
/// A supplier of carbon removal.
/// </summary>
[JsonProperty("supplier")]
public Supplier Supplier { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// File generated from our OpenAPI spec
namespace Stripe.Climate
{
using Newtonsoft.Json;

public class OrderDeliveryDetailLocation : StripeEntity<OrderDeliveryDetailLocation>
{
/// <summary>
/// The city where the supplier is located.
/// </summary>
[JsonProperty("city")]
public string City { get; set; }

/// <summary>
/// Two-letter ISO code representing the country where the supplier is located.
/// </summary>
[JsonProperty("country")]
public string Country { get; set; }

/// <summary>
/// The geographic latitude where the supplier is located.
/// </summary>
[JsonProperty("latitude")]
public decimal? Latitude { get; set; }

/// <summary>
/// The geographic longitude where the supplier is located.
/// </summary>
[JsonProperty("longitude")]
public decimal? Longitude { get; set; }

/// <summary>
/// The state/county/province/region where the supplier is located.
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
}
}
Loading
Loading