Skip to content

Commit

Permalink
Codegen for openapi v196
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Sep 26, 2022
1 parent 479ca73 commit 4669460
Show file tree
Hide file tree
Showing 62 changed files with 7,752 additions and 2,072 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v185
v196
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/AccountSession.java
Expand Up @@ -14,14 +14,14 @@

/**
* An AccountSession allows a Connect platform to grant access to a connected account in Connect
* Elements.
* Embedded UIs.
*
* <p>We recommend that you create an AccountSession each time you need to display an embedded UI to
* your user. Do not save AccountSessions to your database as they expire relatively quickly, and
* cannot be used more than once.
*
* <p>Related guide: <a href="https://stripe.com/docs/connect/get-started-connect-elements">Connect
* Elements</a>.
* Embedded UIs</a>.
*/
@Getter
@Setter
Expand All @@ -40,8 +40,8 @@ public class AccountSession extends ApiResource {
* that you have TLS enabled on any page that includes the client secret.
*
* <p>Refer to our docs to <a
* href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Elements</a>
* and learn about how {@code client_secret} should be handled.
* href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Embedded
* UIs</a> and learn about how {@code client_secret} should be handled.
*/
@SerializedName("client_secret")
String clientSecret;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Expand Up @@ -91,6 +91,11 @@ final class EventDataClassLookup {
"billing_portal.configuration", com.stripe.model.billingportal.Configuration.class);
classLookup.put("billing_portal.session", com.stripe.model.billingportal.Session.class);

classLookup.put("capital.financing_offer", com.stripe.model.capital.FinancingOffer.class);
classLookup.put("capital.financing_summary", com.stripe.model.capital.FinancingSummary.class);
classLookup.put(
"capital.financing_transaction", com.stripe.model.capital.FinancingTransaction.class);

classLookup.put("checkout.session", com.stripe.model.checkout.Session.class);

classLookup.put(
Expand Down
119 changes: 118 additions & 1 deletion src/main/java/com/stripe/model/Invoice.java
Expand Up @@ -15,6 +15,7 @@
import com.stripe.param.InvoiceRetrieveParams;
import com.stripe.param.InvoiceSearchParams;
import com.stripe.param.InvoiceSendInvoiceParams;
import com.stripe.param.InvoiceUpcomingLinesParams;
import com.stripe.param.InvoiceUpcomingParams;
import com.stripe.param.InvoiceUpdateParams;
import com.stripe.param.InvoiceVoidInvoiceParams;
Expand Down Expand Up @@ -316,6 +317,14 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("footer")
String footer;

/**
* Details of the invoice that was cloned. See the <a
* href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more
* details.
*/
@SerializedName("from_invoice")
FromInvoice fromInvoice;

/**
* The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the
* invoice has not been finalized yet, this will be null.
Expand All @@ -342,6 +351,12 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("last_finalization_error")
StripeError lastFinalizationError;

/** The ID of the most recent non-draft revision of this invoice. */
@SerializedName("latest_revision")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Invoice> latestRevision;

/**
* The individual line items that make up the invoice. {@code lines} is sorted as follows: invoice
* items in reverse chronological order, followed by the subscription, if any.
Expand Down Expand Up @@ -522,7 +537,7 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice

/** The aggregate amounts calculated per discount across all line items. */
@SerializedName("total_discount_amounts")
List<DiscountAmount> totalDiscountAmounts;
List<Invoice.DiscountAmount> totalDiscountAmounts;

/**
* The integer amount in %s representing the total amount of the invoice including all discounts
Expand Down Expand Up @@ -644,6 +659,24 @@ public void setDefaultSourceObject(PaymentSource expandableObject) {
new ExpandableField<PaymentSource>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code latestRevision} object. */
public String getLatestRevision() {
return (this.latestRevision != null) ? this.latestRevision.getId() : null;
}

public void setLatestRevision(String id) {
this.latestRevision = ApiResource.setExpandableFieldId(id, this.latestRevision);
}

/** Get expanded {@code latestRevision}. */
public Invoice getLatestRevisionObject() {
return (this.latestRevision != null) ? this.latestRevision.getExpanded() : null;
}

public void setLatestRevisionObject(Invoice expandableObject) {
this.latestRevision = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code onBehalfOf} object. */
public String getOnBehalfOf() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
Expand Down Expand Up @@ -1449,6 +1482,57 @@ public static Invoice upcoming(InvoiceUpcomingParams params, RequestOptions opti
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options);
}

/**
* When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing
* the total count of line items and the first handful of those items. There is also a URL where
* you can retrieve the full (paginated) list of line items.
*/
public static InvoiceLineItemCollection upcomingLines() throws StripeException {
return upcomingLines((Map<String, Object>) null, (RequestOptions) null);
}

/**
* When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing
* the total count of line items and the first handful of those items. There is also a URL where
* you can retrieve the full (paginated) list of line items.
*/
public static InvoiceLineItemCollection upcomingLines(Map<String, Object> params)
throws StripeException {
return upcomingLines(params, (RequestOptions) null);
}

/**
* When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing
* the total count of line items and the first handful of those items. There is also a URL where
* you can retrieve the full (paginated) list of line items.
*/
public static InvoiceLineItemCollection upcomingLines(
Map<String, Object> params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines");
return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options);
}

/**
* When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing
* the total count of line items and the first handful of those items. There is also a URL where
* you can retrieve the full (paginated) list of line items.
*/
public static InvoiceLineItemCollection upcomingLines(InvoiceUpcomingLinesParams params)
throws StripeException {
return upcomingLines(params, (RequestOptions) null);
}

/**
* When retrieving an upcoming invoice, you’ll get a <strong>lines</strong> property containing
* the total count of line items and the first handful of those items. There is also a URL where
* you can retrieve the full (paginated) list of line items.
*/
public static InvoiceLineItemCollection upcomingLines(
InvoiceUpcomingLinesParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming/lines");
return ApiResource.requestCollection(url, params, InvoiceLineItemCollection.class, options);
}

/**
* Draft invoices are fully editable. Once an invoice is <a
* href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>, monetary
Expand Down Expand Up @@ -1674,6 +1758,39 @@ public void setDiscountObject(Discount expandableObject) {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class FromInvoice extends StripeObject {
/** The relation between this invoice and the cloned invoice. */
@SerializedName("action")
String action;

/** The invoice that was cloned. */
@SerializedName("invoice")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Invoice> invoice;

/** Get ID of expandable {@code invoice} object. */
public String getInvoice() {
return (this.invoice != null) ? this.invoice.getId() : null;
}

public void setInvoice(String id) {
this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
}

/** Get expanded {@code invoice}. */
public Invoice getInvoiceObject() {
return (this.invoice != null) ? this.invoice.getExpanded() : null;
}

public void setInvoiceObject(Invoice expandableObject) {
this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/Order.java
Expand Up @@ -1084,7 +1084,7 @@ public static class CustomerBalance extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class BankTransfer extends StripeObject {
@SerializedName("eu_bank_transfer")
PaymentIntent.PaymentMethodOptions.BankTransfer.EuBankTransfer euBankTransfer;
EuBankTransfer euBankTransfer;

/**
* List of address types that should be returned in the financial_addresses response. If
Expand Down Expand Up @@ -1635,7 +1635,7 @@ public static class Discount extends StripeObject {
* Subscriptions</a>.
*/
@SerializedName("discount")
Discount discount;
com.stripe.model.Discount discount;
}

@Getter
Expand Down
53 changes: 53 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Expand Up @@ -1464,6 +1464,9 @@ public static class NextAction extends StripeObject {
@SerializedName("paynow_display_qr_code")
PaynowDisplayQrCode paynowDisplayQrCode;

@SerializedName("pix_display_qr_code")
PixDisplayQrCode pixDisplayQrCode;

@SerializedName("promptpay_display_qr_code")
PromptpayDisplayQrCode promptpayDisplayQrCode;

Expand Down Expand Up @@ -1518,6 +1521,37 @@ public static class PaynowDisplayQrCode extends StripeObject {
String imageUrlSvg;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PixDisplayQrCode extends StripeObject {
/**
* The raw data string used to generate QR code, it should be used together with QR code
* library.
*/
@SerializedName("data")
String data;

/** The date (unix timestamp) when the PIX expires. */
@SerializedName("expires_at")
Long expiresAt;

/**
* The URL to the hosted pix instructions page, which allows customers to view the pix QR
* code.
*/
@SerializedName("hosted_instructions_url")
String hostedInstructionsUrl;

/** The image_url_png string used to render png QR code. */
@SerializedName("image_url_png")
String imageUrlPng;

/** The image_url_svg string used to render svg QR code. */
@SerializedName("image_url_svg")
String imageUrlSvg;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2097,6 +2131,12 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("paypal")
Paypal paypal;

@SerializedName("pix")
Pix pix;

@SerializedName("promptpay")
Promptpay promptpay;

Expand Down Expand Up @@ -3080,6 +3120,19 @@ public static class Paypal extends StripeObject {
String preferredLocale;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {
/** The number of seconds (between 10 and 1209600) after which Pix payment will expire. */
@SerializedName("expires_after_seconds")
Long expiresAfterSeconds;

/** The timestamp at which the Pix expires. */
@SerializedName("expires_at")
Long expiresAt;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/stripe/model/PaymentMethod.java
Expand Up @@ -147,6 +147,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
@SerializedName("paynow")
Paynow paynow;

@SerializedName("paypal")
Paypal paypal;

@SerializedName("pix")
Pix pix;

Expand Down Expand Up @@ -174,8 +177,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
* au_becs_debit}, {@code bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code
* card}, {@code card_present}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code
* giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code klarna}, {@code
* konbini}, {@code link}, {@code oxxo}, {@code p24}, {@code paynow}, {@code pix}, {@code
* promptpay}, {@code sepa_debit}, {@code sofort}, {@code us_bank_account}, or {@code wechat_pay}.
* konbini}, {@code link}, {@code oxxo}, {@code p24}, {@code paynow}, {@code paypal}, {@code pix},
* {@code promptpay}, {@code sepa_debit}, {@code sofort}, {@code us_bank_account}, or {@code
* wechat_pay}.
*/
@SerializedName("type")
String type;
Expand Down Expand Up @@ -1115,6 +1119,11 @@ public static class P24 extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class Paynow extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Paypal extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
21 changes: 0 additions & 21 deletions src/main/java/com/stripe/model/Plan.java
Expand Up @@ -378,27 +378,6 @@ public Plan update(PlanUpdateParams params, RequestOptions options) throws Strip
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Plan.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class MigrateTo extends StripeObject {
/**
* The behavior controlling at what point in the subscription lifecycle to migrate the price
*
* <p>Equal to {@code at_cycle_end}.
*/
@SerializedName("behavior")
String behavior;

/** The unix timestamp after at which subscriptions will start to migrate to the new price. */
@SerializedName("effective_after")
Long effectiveAfter;

/** The id of the price being migrated to. */
@SerializedName("price")
String price;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down

0 comments on commit 4669460

Please sign in to comment.