Skip to content

Commit

Permalink
Merge upstream and update generated code for v669
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Nov 17, 2023
2 parents 759871b + c0c9785 commit 2cef405
Show file tree
Hide file tree
Showing 13 changed files with 19,251 additions and 6,827 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
* Change type of `tax.RegistrationCreateParams.active_from` to `DateTime | 'now'`
* Add support for new value `invoice.payment.overpaid` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 24.3.0 - 2023-11-16
* [#1685](https://github.com/stripe/stripe-java/pull/1685) Update generated code
* Add support for `status` on `checkout.SessionListParams`
* [#1683](https://github.com/stripe/stripe-java/pull/1683) Update generated code
* Add support for `bacs_debit_payments` on `AccountCreateParams.settings` and `AccountUpdateParams.settings`
* Add support for `service_user_number` on `Account.settings.bacs_debit_payments`
* Add support for `capture_before` on `Charge.payment_method_details.card`
* Add support for `paypal` on `Checkout.Session.payment_method_options`
* Add support for `tax_amounts` on `CreditNoteCreateParams.lines[]`, `CreditNotePreviewLinesParams.lines[]`, and `CreditNotePreviewParams.lines[]`
* Add support for `network_data` on `Issuing.Transaction`

## 24.2.0 - 2023-11-09
* [#1679](https://github.com/stripe/stripe-java/pull/1679) Update generated code
* Add support for `metadata` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, and `QuoteUpdateParams.subscription_data`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v667
v669
94 changes: 1 addition & 93 deletions src/main/java/com/stripe/model/InvoiceLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiMode;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.InvoiceLineItemUpdateParams;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
Expand All @@ -21,7 +14,7 @@
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class InvoiceLineItem extends ApiResource implements HasId {
public class InvoiceLineItem extends StripeObject implements HasId {
/** The amount, in cents (or local equivalent). */
@SerializedName("amount")
Long amount;
Expand Down Expand Up @@ -308,79 +301,6 @@ public void setMarginObjects(List<Margin> objs) {
: null;
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, Map<String, Object> params) throws StripeException {
return update(invoice, params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
return getResponseGetter()
.request(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
params,
InvoiceLineItem.class,
options,
ApiMode.V1);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, InvoiceLineItemUpdateParams params)
throws StripeException {
return update(invoice, params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(
String invoice, InvoiceLineItemUpdateParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
return getResponseGetter()
.request(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
InvoiceLineItem.class,
options,
ApiMode.V1);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -541,16 +461,4 @@ public void setTaxRateObject(TaxRate expandableObject) {
this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(invoiceItem, responseGetter);
trySetResponseGetter(period, responseGetter);
trySetResponseGetter(plan, responseGetter);
trySetResponseGetter(price, responseGetter);
trySetResponseGetter(prorationDetails, responseGetter);
trySetResponseGetter(subscription, responseGetter);
trySetResponseGetter(subscriptionItem, responseGetter);
}
}
204 changes: 204 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -2292,10 +2292,19 @@ public static class PaymentDetails extends StripeObject {
@SerializedName("car_rental")
CarRental carRental;

@SerializedName("event_details")
EventDetails eventDetails;

@SerializedName("subscription")
Subscription subscription;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CarRental extends StripeObject {
@SerializedName("affiliate")
Affiliate affiliate;

/** The booking number associated with the car rental. */
@SerializedName("booking_number")
String bookingNumber;
Expand Down Expand Up @@ -2324,6 +2333,13 @@ public static class CarRental extends StripeObject {
@SerializedName("days_rented")
Long daysRented;

@SerializedName("delivery")
Delivery delivery;

/** The details of the drivers associated with the trip. */
@SerializedName("drivers")
List<PaymentIntent.PaymentDetails.CarRental.Driver> drivers;

/** List of additional charges being billed. */
@SerializedName("extra_charges")
List<String> extraCharges;
Expand Down Expand Up @@ -2364,6 +2380,194 @@ public static class CarRental extends StripeObject {
/** Indicates whether the goods or services are tax-exempt or tax is not collected. */
@SerializedName("tax_exempt")
Boolean taxExempt;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Affiliate extends StripeObject {
/** The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Delivery extends StripeObject {
/**
* The delivery method for the payment
*
* <p>One of {@code email}, {@code phone}, {@code pickup}, or {@code post}.
*/
@SerializedName("mode")
String mode;

@SerializedName("receipient")
Receipient receipient;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Receipient extends StripeObject {
/** The email of the recipient the ticket is delivered to. */
@SerializedName("email")
String email;

/** The name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;

/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Driver extends StripeObject {
/** Full name of the driver on the reservation. */
@SerializedName("name")
String name;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class EventDetails extends StripeObject {
/** Indicates if the tickets are digitally checked when entering the venue. */
@SerializedName("access_controlled_venue")
Boolean accessControlledVenue;

@SerializedName("address")
com.stripe.model.Address address;

@SerializedName("affiliate")
Affiliate affiliate;

/** The name of the company. */
@SerializedName("company")
String company;

@SerializedName("delivery")
Delivery delivery;

/** Event end time. Measured in seconds since the Unix epoch. */
@SerializedName("ends_at")
Long endsAt;

/** Type of the event entertainment (concert, sports event etc). */
@SerializedName("genre")
String genre;

/** The name of the event. */
@SerializedName("name")
String name;

/** Event start time. Measured in seconds since the Unix epoch. */
@SerializedName("starts_at")
Long startsAt;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Affiliate extends StripeObject {
/** The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Delivery extends StripeObject {
/**
* The delivery method for the payment
*
* <p>One of {@code email}, {@code phone}, {@code pickup}, or {@code post}.
*/
@SerializedName("mode")
String mode;

@SerializedName("receipient")
Receipient receipient;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Receipient extends StripeObject {
/** The email of the recipient the ticket is delivered to. */
@SerializedName("email")
String email;

/** The name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;

/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
}
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Subscription extends StripeObject {
@SerializedName("affiliate")
Affiliate affiliate;

/** Info whether the subscription will be auto renewed upon expiry. */
@SerializedName("auto_renewal")
Boolean autoRenewal;

@SerializedName("billing_interval")
BillingInterval billingInterval;

/** Subscription end time. Measured in seconds since the Unix epoch. */
@SerializedName("ends_at")
Long endsAt;

/** Name of the product on subscription. e.g. Apple Music Subscription. */
@SerializedName("name")
String name;

/** Subscription start time. Measured in seconds since the Unix epoch. */
@SerializedName("starts_at")
Long startsAt;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Affiliate extends StripeObject {
/** The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class BillingInterval extends StripeObject {
/**
* The number of intervals, as an whole number greater than 0. Stripe multiplies this by the
* interval type to get the overall duration.
*/
@SerializedName("count")
Long count;

/**
* Specifies a type of interval unit. Either {@code day}, {@code week}, {@code month} or
* {@code year}.
*
* <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
*/
@SerializedName("interval")
String interval;
}
}
}

Expand Down
Loading

0 comments on commit 2cef405

Please sign in to comment.