Skip to content

Commit

Permalink
Update generated code (#1601)
Browse files Browse the repository at this point in the history
* Update generated code for v406

* Update generated code for v407

* Update generated code for v408

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: pakrym-stripe <[email protected]>
  • Loading branch information
stripe-openapi[bot] and pakrym-stripe authored Jul 6, 2023
1 parent 8739625 commit 4377b6a
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v403
v408
34 changes: 34 additions & 0 deletions src/main/java/com/stripe/model/PaymentLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,21 @@ public static class CustomField extends StripeObject {
@SerializedName("label")
Label label;

/** Configuration for {@code type=numeric} fields. */
@SerializedName("numeric")
Numeric numeric;

/**
* Whether the customer is required to complete the field before completing the Checkout
* Session. Defaults to {@code false}.
*/
@SerializedName("optional")
Boolean optional;

/** Configuration for {@code type=text} fields. */
@SerializedName("text")
Text text;

/**
* The type of the field.
*
Expand Down Expand Up @@ -557,6 +565,32 @@ public static class Label extends StripeObject {
@SerializedName("type")
String type;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Numeric extends StripeObject {
/** The maximum character length constraint for the customer's input. */
@SerializedName("maximum_length")
Long maximumLength;

/** The minimum character length requirement for the customer's input. */
@SerializedName("minimum_length")
Long minimumLength;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Text extends StripeObject {
/** The maximum character length constraint for the customer's input. */
@SerializedName("maximum_length")
Long maximumLength;

/** The minimum character length requirement for the customer's input. */
@SerializedName("minimum_length")
Long minimumLength;
}
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.Getter;
import lombok.Setter;

/** Describes an owner of an account. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
89 changes: 89 additions & 0 deletions src/main/java/com/stripe/param/SubscriptionListParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

@Getter
public class SubscriptionListParams extends ApiRequestParams {
/** Filter subscriptions by their automatic tax settings. */
@SerializedName("automatic_tax")
AutomaticTax automaticTax;

/**
* The collection method of the subscriptions to retrieve. Either {@code charge_automatically} or
* {@code send_invoice}.
Expand Down Expand Up @@ -96,6 +100,7 @@ public class SubscriptionListParams extends ApiRequestParams {
String testClock;

private SubscriptionListParams(
AutomaticTax automaticTax,
CollectionMethod collectionMethod,
Object created,
Object currentPeriodEnd,
Expand All @@ -110,6 +115,7 @@ private SubscriptionListParams(
String startingAfter,
Status status,
String testClock) {
this.automaticTax = automaticTax;
this.collectionMethod = collectionMethod;
this.created = created;
this.currentPeriodEnd = currentPeriodEnd;
Expand All @@ -131,6 +137,8 @@ public static Builder builder() {
}

public static class Builder {
private AutomaticTax automaticTax;

private CollectionMethod collectionMethod;

private Object created;
Expand Down Expand Up @@ -162,6 +170,7 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public SubscriptionListParams build() {
return new SubscriptionListParams(
this.automaticTax,
this.collectionMethod,
this.created,
this.currentPeriodEnd,
Expand All @@ -178,6 +187,12 @@ public SubscriptionListParams build() {
this.testClock);
}

/** Filter subscriptions by their automatic tax settings. */
public Builder setAutomaticTax(SubscriptionListParams.AutomaticTax automaticTax) {
this.automaticTax = automaticTax;
return this;
}

/**
* The collection method of the subscriptions to retrieve. Either {@code charge_automatically}
* or {@code send_invoice}.
Expand Down Expand Up @@ -343,6 +358,80 @@ public Builder setTestClock(String testClock) {
}
}

@Getter
public static class AutomaticTax {
/**
* <strong>Required.</strong> Enabled automatic tax calculation which will automatically compute
* tax rates on all invoices generated by the subscription.
*/
@SerializedName("enabled")
Boolean enabled;

/**
* 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 AutomaticTax(Boolean enabled, Map<String, Object> extraParams) {
this.enabled = enabled;
this.extraParams = extraParams;
}

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

public static class Builder {
private Boolean enabled;

private Map<String, Object> extraParams;

/** Finalize and obtain parameter instance from this builder. */
public SubscriptionListParams.AutomaticTax build() {
return new SubscriptionListParams.AutomaticTax(this.enabled, this.extraParams);
}

/**
* <strong>Required.</strong> Enabled automatic tax calculation which will automatically
* compute tax rates on all invoices generated by the subscription.
*/
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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
* SubscriptionListParams.AutomaticTax#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 SubscriptionListParams.AutomaticTax#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;
}
}
}

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

0 comments on commit 4377b6a

Please sign in to comment.