Skip to content

Commit

Permalink
Update generated code using latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-stripe committed Apr 9, 2024
1 parent 789a3ec commit 308cb0e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 291 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/ApiVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package com.stripe;

final class ApiVersion {
public static final String CURRENT = "2023-10-16";
public static final String CURRENT = "2024-04-10";
}
17 changes: 0 additions & 17 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,6 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("rendering")
Rendering rendering;

/**
* This is a legacy field that will be removed soon. For details about {@code rendering_options},
* refer to {@code rendering} instead. Options for invoice PDF rendering.
*/
@SerializedName("rendering_options")
RenderingOptions renderingOptions;

/** The details of the cost of shipping, including the ShippingRate applied on the invoice. */
@SerializedName("shipping_cost")
ShippingCost shippingCost;
Expand Down Expand Up @@ -2278,15 +2271,6 @@ public static class Pdf extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class RenderingOptions extends StripeObject {
/** How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. */
@SerializedName("amount_tax_display")
String amountTaxDisplay;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2577,7 +2561,6 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(paymentSettings, responseGetter);
trySetResponseGetter(quote, responseGetter);
trySetResponseGetter(rendering, responseGetter);
trySetResponseGetter(renderingOptions, responseGetter);
trySetResponseGetter(shippingCost, responseGetter);
trySetResponseGetter(shippingDetails, responseGetter);
trySetResponseGetter(statusTransitions, responseGetter);
Expand Down
136 changes: 0 additions & 136 deletions src/main/java/com/stripe/param/InvoiceCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,6 @@ public class InvoiceCreateParams extends ApiRequestParams {
@SerializedName("rendering")
Rendering rendering;

/**
* This is a legacy field that will be removed soon. For details about {@code rendering_options},
* refer to {@code rendering} instead. Options for invoice PDF rendering.
*/
@SerializedName("rendering_options")
Object renderingOptions;

/** Settings for the cost of shipping for this invoice. */
@SerializedName("shipping_cost")
ShippingCost shippingCost;
Expand Down Expand Up @@ -270,7 +263,6 @@ private InvoiceCreateParams(
PaymentSettings paymentSettings,
PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior,
Rendering rendering,
Object renderingOptions,
ShippingCost shippingCost,
ShippingDetails shippingDetails,
String statementDescriptor,
Expand Down Expand Up @@ -303,7 +295,6 @@ private InvoiceCreateParams(
this.paymentSettings = paymentSettings;
this.pendingInvoiceItemsBehavior = pendingInvoiceItemsBehavior;
this.rendering = rendering;
this.renderingOptions = renderingOptions;
this.shippingCost = shippingCost;
this.shippingDetails = shippingDetails;
this.statementDescriptor = statementDescriptor;
Expand Down Expand Up @@ -370,8 +361,6 @@ public static class Builder {

private Rendering rendering;

private Object renderingOptions;

private ShippingCost shippingCost;

private ShippingDetails shippingDetails;
Expand Down Expand Up @@ -412,7 +401,6 @@ public InvoiceCreateParams build() {
this.paymentSettings,
this.pendingInvoiceItemsBehavior,
this.rendering,
this.renderingOptions,
this.shippingCost,
this.shippingDetails,
this.statementDescriptor,
Expand Down Expand Up @@ -868,24 +856,6 @@ public Builder setRendering(InvoiceCreateParams.Rendering rendering) {
return this;
}

/**
* This is a legacy field that will be removed soon. For details about {@code
* rendering_options}, refer to {@code rendering} instead. Options for invoice PDF rendering.
*/
public Builder setRenderingOptions(InvoiceCreateParams.RenderingOptions renderingOptions) {
this.renderingOptions = renderingOptions;
return this;
}

/**
* This is a legacy field that will be removed soon. For details about {@code
* rendering_options}, refer to {@code rendering} instead. Options for invoice PDF rendering.
*/
public Builder setRenderingOptions(EmptyParam renderingOptions) {
this.renderingOptions = renderingOptions;
return this;
}

/** Settings for the cost of shipping for this invoice. */
public Builder setShippingCost(InvoiceCreateParams.ShippingCost shippingCost) {
this.shippingCost = shippingCost;
Expand Down Expand Up @@ -3697,112 +3667,6 @@ public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
}
}

@Getter
public static class RenderingOptions {
/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
* of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
* include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
* will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
*/
@SerializedName("amount_tax_display")
ApiRequestParams.EnumParam amountTaxDisplay;

/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

private RenderingOptions(
ApiRequestParams.EnumParam amountTaxDisplay, Map<String, Object> extraParams) {
this.amountTaxDisplay = amountTaxDisplay;
this.extraParams = extraParams;
}

public static Builder builder() {
return new Builder();
}

public static class Builder {
private ApiRequestParams.EnumParam amountTaxDisplay;

private Map<String, Object> extraParams;

/** Finalize and obtain parameter instance from this builder. */
public InvoiceCreateParams.RenderingOptions build() {
return new InvoiceCreateParams.RenderingOptions(this.amountTaxDisplay, this.extraParams);
}

/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
* of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
* include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
* exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
*/
public Builder setAmountTaxDisplay(
InvoiceCreateParams.RenderingOptions.AmountTaxDisplay amountTaxDisplay) {
this.amountTaxDisplay = amountTaxDisplay;
return this;
}

/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
* of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
* include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
* exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
*/
public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
this.amountTaxDisplay = amountTaxDisplay;
return this;
}

/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* InvoiceCreateParams.RenderingOptions#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}

/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link InvoiceCreateParams.RenderingOptions#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map<String, Object> map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}

public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
@SerializedName("exclude_tax")
EXCLUDE_TAX("exclude_tax"),

@SerializedName("include_inclusive_tax")
INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");

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

AmountTaxDisplay(String value) {
this.value = value;
}
}
}

@Getter
public static class ShippingCost {
/**
Expand Down

0 comments on commit 308cb0e

Please sign in to comment.