com.stripe.param.PaymentMethodUpdateParams Maven / Gradle / Ivy
// Generated by delombok at Fri Jan 24 09:51:02 PST 2020
package com.stripe.param;
import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import com.stripe.param.common.EmptyParam;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PaymentMethodUpdateParams extends ApiRequestParams {
/**
* Billing information associated with the PaymentMethod that may be used or required by
* particular types of payment methods.
*/
@SerializedName("billing_details")
BillingDetails billingDetails;
/**
* If this is a `card` PaymentMethod, this hash contains the user's card details.
*/
@SerializedName("card")
Card card;
/**
* Specifies which fields in the response should be expanded.
*/
@SerializedName("expand")
List expand;
/**
* 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 extraParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format. Individual keys can be unset by
* posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
@SerializedName("metadata")
Map metadata;
/**
* If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank
* account.
*/
@SerializedName("sepa_debit")
SepaDebit sepaDebit;
private PaymentMethodUpdateParams(BillingDetails billingDetails, Card card, List expand, Map extraParams, Map metadata, SepaDebit sepaDebit) {
this.billingDetails = billingDetails;
this.card = card;
this.expand = expand;
this.extraParams = extraParams;
this.metadata = metadata;
this.sepaDebit = sepaDebit;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private BillingDetails billingDetails;
private Card card;
private List expand;
private Map extraParams;
private Map metadata;
private SepaDebit sepaDebit;
/**
* Finalize and obtain parameter instance from this builder.
*/
public PaymentMethodUpdateParams build() {
return new PaymentMethodUpdateParams(this.billingDetails, this.card, this.expand, this.extraParams, this.metadata, this.sepaDebit);
}
/**
* Billing information associated with the PaymentMethod that may be used or required by
* particular types of payment methods.
*/
public Builder setBillingDetails(BillingDetails billingDetails) {
this.billingDetails = billingDetails;
return this;
}
/**
* If this is a `card` PaymentMethod, this hash contains the user's card details.
*/
public Builder setCard(Card card) {
this.card = card;
return this;
}
/**
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* PaymentMethodUpdateParams#expand} for the field documentation.
*/
public Builder addExpand(String element) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.add(element);
return this;
}
/**
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* PaymentMethodUpdateParams#expand} for the field documentation.
*/
public Builder addAllExpand(List elements) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.addAll(elements);
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
* PaymentMethodUpdateParams#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 PaymentMethodUpdateParams#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add a key/value pair to `metadata` 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
* PaymentMethodUpdateParams#metadata} for the field documentation.
*/
public Builder putMetadata(String key, String value) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` 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 PaymentMethodUpdateParams#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}
/**
* If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank
* account.
*/
public Builder setSepaDebit(SepaDebit sepaDebit) {
this.sepaDebit = sepaDebit;
return this;
}
}
public static class BillingDetails {
/**
* Billing address.
*/
@SerializedName("address")
Address address;
/**
* Email address.
*/
@SerializedName("email")
Object email;
/**
* 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 extraParams;
/**
* Full name.
*/
@SerializedName("name")
Object name;
/**
* Billing phone number (including extension).
*/
@SerializedName("phone")
Object phone;
private BillingDetails(Address address, Object email, Map extraParams, Object name, Object phone) {
this.address = address;
this.email = email;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Address address;
private Object email;
private Map extraParams;
private Object name;
private Object phone;
/**
* Finalize and obtain parameter instance from this builder.
*/
public BillingDetails build() {
return new BillingDetails(this.address, this.email, this.extraParams, this.name, this.phone);
}
/**
* Billing address.
*/
public Builder setAddress(Address address) {
this.address = address;
return this;
}
/**
* Email address.
*/
public Builder setEmail(String email) {
this.email = email;
return this;
}
/**
* Email address.
*/
public Builder setEmail(EmptyParam email) {
this.email = email;
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
* PaymentMethodUpdateParams.BillingDetails#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 PaymentMethodUpdateParams.BillingDetails#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Full name.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
/**
* Full name.
*/
public Builder setName(EmptyParam name) {
this.name = name;
return this;
}
/**
* Billing phone number (including extension).
*/
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
/**
* Billing phone number (including extension).
*/
public Builder setPhone(EmptyParam phone) {
this.phone = phone;
return this;
}
}
public static class Address {
/** City, district, suburb, town, or village. */
@SerializedName("city")
Object city;
/**
* Two-letter country code ([ISO 3166-1
* alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
@SerializedName("country")
Object country;
/**
* 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 extraParams;
/** Address line 1 (e.g., street, PO Box, or company name). */
@SerializedName("line1")
Object line1;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
Object line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
Object postalCode;
/** State, county, province, or region. */
@SerializedName("state")
Object state;
private Address(Object city, Object country, Map extraParams, Object line1, Object line2, Object postalCode, Object state) {
this.city = city;
this.country = country;
this.extraParams = extraParams;
this.line1 = line1;
this.line2 = line2;
this.postalCode = postalCode;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object city;
private Object country;
private Map extraParams;
private Object line1;
private Object line2;
private Object postalCode;
private Object state;
/** Finalize and obtain parameter instance from this builder. */
public Address build() {
return new Address(this.city, this.country, this.extraParams, this.line1, this.line2, this.postalCode, this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/** City, district, suburb, town, or village. */
public Builder setCity(EmptyParam city) {
this.city = city;
return this;
}
/**
* Two-letter country code ([ISO 3166-1
* alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Two-letter country code ([ISO 3166-1
* alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
public Builder setCountry(EmptyParam country) {
this.country = country;
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 PaymentMethodUpdateParams.BillingDetails.Address#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 PaymentMethodUpdateParams.BillingDetails.Address#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(EmptyParam line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(EmptyParam line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(EmptyParam postalCode) {
this.postalCode = postalCode;
return this;
}
/** State, county, province, or region. */
public Builder setState(String state) {
this.state = state;
return this;
}
public Builder setState(EmptyParam state) {
this.state = state;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getCity() {
return this.city;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getCountry() {
return this.country;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getLine1() {
return this.line1;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getLine2() {
return this.line2;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getPostalCode() {
return this.postalCode;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getState() {
return this.state;
}
}
/**
* Billing address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Address getAddress() {
return this.address;
}
/**
* Email address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getEmail() {
return this.email;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Full name.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getName() {
return this.name;
}
/**
* Billing phone number (including extension).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getPhone() {
return this.phone;
}
}
/**
* State, county, province, or region.
*/
public static class Card {
/**
* Two-digit number representing the card's expiration month.
*/
@SerializedName("exp_month")
Long expMonth;
/**
* Four-digit number representing the card's expiration year.
*/
@SerializedName("exp_year")
Long expYear;
/**
* 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 extraParams;
private Card(Long expMonth, Long expYear, Map extraParams) {
this.expMonth = expMonth;
this.expYear = expYear;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long expMonth;
private Long expYear;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public Card build() {
return new Card(this.expMonth, this.expYear, this.extraParams);
}
/** Two-digit number representing the card's expiration month. */
public Builder setExpMonth(Long expMonth) {
this.expMonth = expMonth;
return this;
}
/** Four-digit number representing the card's expiration year. */
public Builder setExpYear(Long expYear) {
this.expYear = expYear;
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
* PaymentMethodUpdateParams.Card#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;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* Two-digit number representing the card's expiration month.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getExpMonth() {
return this.expMonth;
}
/**
* Four-digit number representing the card's expiration year.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getExpYear() {
return this.expYear;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
/**
* 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 PaymentMethodUpdateParams.Card#extraParams} for the field documentation.
*/
public static class SepaDebit {
/**
* 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 extraParams;
private SepaDebit(Map extraParams) {
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public SepaDebit build() {
return new SepaDebit(this.extraParams);
}
/**
* 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
* PaymentMethodUpdateParams.SepaDebit#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 PaymentMethodUpdateParams.SepaDebit#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
/**
* Billing information associated with the PaymentMethod that may be used or required by
* particular types of payment methods.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BillingDetails getBillingDetails() {
return this.billingDetails;
}
/**
* If this is a `card` PaymentMethod, this hash contains the user's card details.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Card getCard() {
return this.card;
}
/**
* Specifies which fields in the response should be expanded.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getExpand() {
return this.expand;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format. Individual keys can be unset by
* posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
/**
* If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank
* account.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SepaDebit getSepaDebit() {
return this.sepaDebit;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy