Skip to content

Commit

Permalink
Update generated code for v760
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jan 17, 2024
1 parent fb08be6 commit 6cb7a36
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v758
v760
83 changes: 83 additions & 0 deletions src/main/java/com/stripe/param/issuing/CardCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class CardCreateParams extends ApiRequestParams {
@SerializedName("metadata")
Map<String, String> metadata;

/** The desired PIN for this card. */
@SerializedName("pin")
Pin pin;

/** The card this is meant to be a replacement for (if any). */
@SerializedName("replacement_for")
String replacementFor;
Expand Down Expand Up @@ -90,6 +94,7 @@ private CardCreateParams(
Map<String, Object> extraParams,
String financialAccount,
Map<String, String> metadata,
Pin pin,
String replacementFor,
ReplacementReason replacementReason,
Shipping shipping,
Expand All @@ -102,6 +107,7 @@ private CardCreateParams(
this.extraParams = extraParams;
this.financialAccount = financialAccount;
this.metadata = metadata;
this.pin = pin;
this.replacementFor = replacementFor;
this.replacementReason = replacementReason;
this.shipping = shipping;
Expand All @@ -127,6 +133,8 @@ public static class Builder {

private Map<String, String> metadata;

private Pin pin;

private String replacementFor;

private ReplacementReason replacementReason;
Expand All @@ -148,6 +156,7 @@ public CardCreateParams build() {
this.extraParams,
this.financialAccount,
this.metadata,
this.pin,
this.replacementFor,
this.replacementReason,
this.shipping,
Expand Down Expand Up @@ -254,6 +263,12 @@ public Builder putAllMetadata(Map<String, String> map) {
return this;
}

/** The desired PIN for this card. */
public Builder setPin(CardCreateParams.Pin pin) {
this.pin = pin;
return this;
}

/** The card this is meant to be a replacement for (if any). */
public Builder setReplacementFor(String replacementFor) {
this.replacementFor = replacementFor;
Expand Down Expand Up @@ -304,6 +319,74 @@ public Builder setType(CardCreateParams.Type type) {
}
}

@Getter
public static class Pin {
/** The card's desired new PIN, encrypted under Stripe's public key. */
@SerializedName("encrypted_number")
String encryptedNumber;

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

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

public static class Builder {
private String encryptedNumber;

private Map<String, Object> extraParams;

/** Finalize and obtain parameter instance from this builder. */
public CardCreateParams.Pin build() {
return new CardCreateParams.Pin(this.encryptedNumber, this.extraParams);
}

/** The card's desired new PIN, encrypted under Stripe's public key. */
public Builder setEncryptedNumber(String encryptedNumber) {
this.encryptedNumber = encryptedNumber;
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
* CardCreateParams.Pin#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 CardCreateParams.Pin#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 Shipping {
/** <strong>Required.</strong> The address that the card is shipped to. */
Expand Down

0 comments on commit 6cb7a36

Please sign in to comment.