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

Bring sdk-release/next-major up to date #1470

Merged
merged 9 commits into from
Nov 7, 2022
Prev Previous commit
Next Next commit
Codegen for openapi v204 (#1466)
  • Loading branch information
kamil-stripe authored Nov 2, 2022
commit 007f67fc19cb865e3006f2f26e778646acf991a5
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v203
v204
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/Refund.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* {@code Refund} objects allow you to refund a charge that has previously been created but not yet
* refunded. Funds will be refunded to the credit or debit card that was originally charged.
*
* <p>Stripe Tax users with recurring payments and invoices can create <a
* href="https://stripe.com/docs/api/credit_notes">Credit Notes</a>, which reduce overall tax
* liability because tax is correctly recalculated and apportioned to the related invoice.
*
* <p>Related guide: <a href="https://stripe.com/docs/refunds">Refunds</a>.
*/
@Getter
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/com/stripe/model/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su
@SerializedName("object")
String object;

/**
* The account (if any) the charge was made on behalf of for charges associated with this
* subscription. See the Connect documentation for details.
*/
@SerializedName("on_behalf_of")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> onBehalfOf;

/** If specified, payment collection for this subscription will be paused. */
@SerializedName("pause_collection")
PauseCollection pauseCollection;
Expand Down Expand Up @@ -422,6 +431,24 @@ public void setLatestInvoiceObject(Invoice expandableObject) {
this.latestInvoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}

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

public void setOnBehalfOf(String id) {
this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
}

/** Get expanded {@code onBehalfOf}. */
public Account getOnBehalfOfObject() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
}

public void setOnBehalfOfObject(Account expandableObject) {
this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code pendingSetupIntent} object. */
public String getPendingSetupIntent() {
return (this.pendingSetupIntent != null) ? this.pendingSetupIntent.getId() : null;
Expand Down
54 changes: 54 additions & 0 deletions src/main/java/com/stripe/model/SubscriptionSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,15 @@ public static class DefaultSettings extends StripeObject {
@SerializedName("invoice_settings")
InvoiceSettings invoiceSettings;

/**
* The account (if any) the charge was made on behalf of for charges associated with the
* schedule's subscription. See the Connect documentation for details.
*/
@SerializedName("on_behalf_of")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> onBehalfOf;

/**
* The account (if any) the associated subscription's payments will be attributed to for tax
* reporting, and where funds from each payment will be transferred to for each of the
Expand Down Expand Up @@ -676,6 +685,24 @@ public void setDefaultPaymentMethodObject(PaymentMethod expandableObject) {
new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
}

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

public void setOnBehalfOf(String id) {
this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
}

/** Get expanded {@code onBehalfOf}. */
public Account getOnBehalfOfObject() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
}

public void setOnBehalfOfObject(Account expandableObject) {
this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -817,6 +844,15 @@ public static class Phase extends StripeObject {
@SerializedName("metadata")
Map<String, String> metadata;

/**
* The account (if any) the charge was made on behalf of for charges associated with the
* schedule's subscription. See the Connect documentation for details.
*/
@SerializedName("on_behalf_of")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> onBehalfOf;

/**
* If the subscription schedule will prorate when transitioning to this phase. Possible values
* are {@code create_prorations} and {@code none}.
Expand Down Expand Up @@ -879,6 +915,24 @@ public void setDefaultPaymentMethodObject(PaymentMethod expandableObject) {
new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
}

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

public void setOnBehalfOf(String id) {
this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
}

/** Get expanded {@code onBehalfOf}. */
public Account getOnBehalfOfObject() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
}

public void setOnBehalfOfObject(Account expandableObject) {
this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
48 changes: 36 additions & 12 deletions src/main/java/com/stripe/model/issuing/Authorization.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ public void setCardholderObject(Cardholder expandableObject) {
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve() throws StripeException {
return approve((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -225,7 +227,9 @@ public Authorization approve() throws StripeException {
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve(RequestOptions options) throws StripeException {
return approve((Map<String, Object>) null, options);
Expand All @@ -235,7 +239,9 @@ public Authorization approve(RequestOptions options) throws StripeException {
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve(Map<String, Object> params) throws StripeException {
return approve(params, (RequestOptions) null);
Expand All @@ -245,7 +251,9 @@ public Authorization approve(Map<String, Object> params) throws StripeException
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand All @@ -263,7 +271,9 @@ public Authorization approve(Map<String, Object> params, RequestOptions options)
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve(AuthorizationApproveParams params) throws StripeException {
return approve(params, (RequestOptions) null);
Expand All @@ -273,7 +283,9 @@ public Authorization approve(AuthorizationApproveParams params) throws StripeExc
* Approves a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to approve an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization approve(AuthorizationApproveParams params, RequestOptions options)
throws StripeException {
Expand All @@ -291,7 +303,9 @@ public Authorization approve(AuthorizationApproveParams params, RequestOptions o
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline() throws StripeException {
return decline((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -301,7 +315,9 @@ public Authorization decline() throws StripeException {
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline(RequestOptions options) throws StripeException {
return decline((Map<String, Object>) null, options);
Expand All @@ -311,7 +327,9 @@ public Authorization decline(RequestOptions options) throws StripeException {
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline(Map<String, Object> params) throws StripeException {
return decline(params, (RequestOptions) null);
Expand All @@ -321,7 +339,9 @@ public Authorization decline(Map<String, Object> params) throws StripeException
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand All @@ -339,7 +359,9 @@ public Authorization decline(Map<String, Object> params, RequestOptions options)
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline(AuthorizationDeclineParams params) throws StripeException {
return decline(params, (RequestOptions) null);
Expand All @@ -349,7 +371,9 @@ public Authorization decline(AuthorizationDeclineParams params) throws StripeExc
* Declines a pending Issuing <code>Authorization</code> object. This request should be made
* within the timeout window of the <a
* href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
* authorization</a> flow.
* authorization</a> flow. You can also respond directly to the webhook request to decline an
* authorization (preferred). More details can be found <a
* href="https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">here</a>.
*/
public Authorization decline(AuthorizationDeclineParams params, RequestOptions options)
throws StripeException {
Expand Down
62 changes: 62 additions & 0 deletions src/main/java/com/stripe/param/InvoiceItemCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ public class InvoiceItemCreateParams extends ApiRequestParams {
@SerializedName("subscription")
String subscription;

/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
* {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either {@code
* inclusive} or {@code exclusive}, it cannot be changed.
*/
@SerializedName("tax_behavior")
TaxBehavior taxBehavior;

/** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
@SerializedName("tax_code")
Object taxCode;

/**
* The tax rates which apply to the invoice item. When set, the {@code default_tax_rates} on the
* invoice do not apply to this invoice item.
Expand Down Expand Up @@ -152,6 +164,8 @@ private InvoiceItemCreateParams(
PriceData priceData,
Long quantity,
String subscription,
TaxBehavior taxBehavior,
Object taxCode,
List<String> taxRates,
Long unitAmount,
BigDecimal unitAmountDecimal) {
Expand All @@ -170,6 +184,8 @@ private InvoiceItemCreateParams(
this.priceData = priceData;
this.quantity = quantity;
this.subscription = subscription;
this.taxBehavior = taxBehavior;
this.taxCode = taxCode;
this.taxRates = taxRates;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
Expand Down Expand Up @@ -210,6 +226,10 @@ public static class Builder {

private String subscription;

private TaxBehavior taxBehavior;

private Object taxCode;

private List<String> taxRates;

private Long unitAmount;
Expand All @@ -234,6 +254,8 @@ public InvoiceItemCreateParams build() {
this.priceData,
this.quantity,
this.subscription,
this.taxBehavior,
this.taxCode,
this.taxRates,
this.unitAmount,
this.unitAmountDecimal);
Expand Down Expand Up @@ -478,6 +500,28 @@ public Builder setSubscription(String subscription) {
return this;
}

/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
* {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either {@code
* inclusive} or {@code exclusive}, it cannot be changed.
*/
public Builder setTaxBehavior(InvoiceItemCreateParams.TaxBehavior taxBehavior) {
this.taxBehavior = taxBehavior;
return this;
}

/** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
public Builder setTaxCode(String taxCode) {
this.taxCode = taxCode;
return this;
}

/** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
public Builder setTaxCode(EmptyParam taxCode) {
this.taxCode = taxCode;
return this;
}

/**
* Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
Expand Down Expand Up @@ -867,4 +911,22 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam {
}
}
}

public enum TaxBehavior implements ApiRequestParams.EnumParam {
@SerializedName("exclusive")
EXCLUSIVE("exclusive"),

@SerializedName("inclusive")
INCLUSIVE("inclusive"),

@SerializedName("unspecified")
UNSPECIFIED("unspecified");

@Getter(onMethod_ = {@Override})
private final String value;

TaxBehavior(String value) {
this.value = value;
}
}
}
Loading