diff --git a/src/main/java/com/stripe/net/ApiRequestParams.java b/src/main/java/com/stripe/net/ApiRequestParams.java index 7605de640b5..b40c3c34bed 100644 --- a/src/main/java/com/stripe/net/ApiRequestParams.java +++ b/src/main/java/com/stripe/net/ApiRequestParams.java @@ -1,16 +1,5 @@ package com.stripe.net; -import com.google.gson.FieldNamingPolicy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -import java.io.IOException; import java.util.Map; /** @@ -23,70 +12,34 @@ public abstract class ApiRequestParams { /** * Interface implemented by all enum parameter to get the actual string value that Stripe API * expects. Internally, it used in custom serialization - * {@link ApiRequestParams.HasEmptyEnumTypeAdapterFactory} converting empty string enum to null. + * {@link ApiRequestParamsConverter} converting empty string enum to + * null. */ public interface EnumParam { String getValue(); } - private static final Gson GSON = new GsonBuilder() - .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) - .registerTypeAdapterFactory(new HasEmptyEnumTypeAdapterFactory()) - .create(); - - private static final UntypedMapDeserializer UNTYPED_MAP_DESERIALIZER = - new UntypedMapDeserializer(); - - private static class HasEmptyEnumTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EnumParam.class.isAssignableFrom(type.getRawType())) { - return null; - } - - TypeAdapter paramEnum = new TypeAdapter() { - @Override - public void write(JsonWriter out, EnumParam value) throws IOException { - if (value.getValue().equals("")) { - // need to restore serialize null setting - // not to affect other fields - boolean previousSetting = out.getSerializeNulls(); - out.setSerializeNulls(true); - out.nullValue(); - out.setSerializeNulls(previousSetting); - } else { - out.value(value.getValue()); - } - } + /** + * Param key for an `extraParams` map. Any param/sub-param specifying a field + * intended to support extra params from users should have the annotation + * {@code @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)}. Logic to handle this is in + * {@link ApiRequestParamsConverter}. + */ + public static final String EXTRA_PARAMS_KEY = "_stripe_java_extra_param_key"; - @Override - public EnumParam read(JsonReader in) { - throw new UnsupportedOperationException( - "No deserialization is expected from this private type adapter for enum param."); - } - }; - return (TypeAdapter) paramEnum.nullSafe(); - } - } + /** + * Converter mapping typed API request parameters into an untyped map. + */ + private static final ApiRequestParamsConverter PARAMS_CONVERTER = + new ApiRequestParamsConverter(); /** - * Convenient method to convert this typed request params into an untyped map. This map is - * composed of {@code Map}, {@code List}, and basic Java data types. - * This allows you to test building the request params and verify compatibility with your - * prior integrations using the untyped params map - * {@link ApiResource#request(ApiResource.RequestMethod, String, Map, Class, RequestOptions)}. - * - *

The peculiarity of this conversion is that `EMPTY` {@link EnumParam} with raw - * value of empty string will be converted to null. This is compatible with the existing - * contract enforcing no empty string in the untyped map params. - * - *

Because of the translation from `EMPTY` enum to null, deserializing this map back to a - * request instance is lossy. The null value will not be converted back to the `EMPTY` enum. + * Convert `this` api request params to an untyped map. The conversion is specific to api + * request params object. Please see documentation in + * {@link ApiRequestParamsConverter#convert(ApiRequestParams)}. */ public Map toMap() { - JsonObject json = GSON.toJsonTree(this).getAsJsonObject(); - return UNTYPED_MAP_DESERIALIZER.deserialize(json); + return PARAMS_CONVERTER.convert(this); } } diff --git a/src/main/java/com/stripe/net/ApiRequestParamsConverter.java b/src/main/java/com/stripe/net/ApiRequestParamsConverter.java new file mode 100644 index 00000000000..0f4e7bd8cfa --- /dev/null +++ b/src/main/java/com/stripe/net/ApiRequestParamsConverter.java @@ -0,0 +1,148 @@ +package com.stripe.net; + +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +import com.stripe.Stripe; +import com.stripe.param.common.EmptyParam; + +import java.io.IOException; +import java.util.Map; + +/** + * Converter to map an api request object to an untyped map. + * It is not called a *Serializer because the outcome is not a JSON data. + * It is not called *UntypedMapDeserializer because it is not converting from JSON. + */ +class ApiRequestParamsConverter { + /** + * Strategy to flatten extra params in the API request parameters. + */ + private static class ExtraParamsFlatteningStrategy implements UntypedMapDeserializer.Strategy { + @Override + public void deserializeAndTransform(Map outerMap, + Map.Entry jsonEntry, + UntypedMapDeserializer untypedMapDeserializer) { + String key = jsonEntry.getKey(); + JsonElement jsonValue = jsonEntry.getValue(); + if (ApiRequestParams.EXTRA_PARAMS_KEY.equals(key)) { + if (!jsonValue.isJsonObject()) { + throw new IllegalStateException(String.format( + "Unexpected schema for extra params. JSON object is expected at key `%s`, but found" + + " `%s`. This is likely a problem with this current library version `%s`. " + + "Please contact support@stripe.com for assistance.", + ApiRequestParams.EXTRA_PARAMS_KEY, jsonValue, Stripe.VERSION)); + } + // JSON value now corresponds to the extra params map, and is also deserialized as a map. + // Instead of putting this result map under the original key, flatten the map + // by adding all its key/value pairs to the outer map instead. + Map extraParamsMap = + untypedMapDeserializer.deserialize(jsonValue.getAsJsonObject()); + for (Map.Entry entry : extraParamsMap.entrySet()) { + validateDuplicateKey(outerMap, entry.getKey(), entry.getValue()); + outerMap.put(entry.getKey(), entry.getValue()); + } + } else { + Object value = untypedMapDeserializer.deserializeJsonElement(jsonValue); + validateDuplicateKey(outerMap, key, value); + + // Normal deserialization where output map has the same structure as the given JSON content. + // The deserialized content is an untyped `Object` and added to the outer map at the + // original key. + outerMap.put(key, value); + } + } + } + + private static void validateDuplicateKey(Map outerMap, + String paramKey, Object paramValue) { + if (outerMap.containsKey(paramKey)) { + throw new IllegalArgumentException(String.format( + "Found multiple param values for the same param key. This can happen because you passed " + + "additional parameters via `putExtraParam` that conflict with the existing params. " + + "Found param key `%s` with values `%s` and `%s`. " + + "If you wish to pass additional params for nested parameters, you " + + "should add extra params at the nested params themselves, not from the " + + "top-level param.", + paramKey, outerMap.get(paramKey), paramValue)); + } + } + + /** + * Type adapter to convert an empty enum to null value to comply with the lower-lever encoding + * logic for the API request parameters. + */ + private static class HasEmptyEnumTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiRequestParams.EnumParam.class.isAssignableFrom(type.getRawType())) { + return null; + } + + TypeAdapter paramEnum = + new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiRequestParams.EnumParam value) throws IOException { + if (value.getValue().equals("")) { + // need to restore serialize null setting + // not to affect other fields + boolean previousSetting = out.getSerializeNulls(); + out.setSerializeNulls(true); + out.nullValue(); + out.setSerializeNulls(previousSetting); + } else { + out.value(value.getValue()); + } + } + + @Override + public ApiRequestParams.EnumParam read(JsonReader in) { + throw new UnsupportedOperationException( + "No deserialization is expected from this private type adapter for enum param."); + } + }; + return (TypeAdapter) paramEnum.nullSafe(); + } + } + + private static final Gson GSON = new GsonBuilder() + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .registerTypeAdapterFactory(new ApiRequestParamsConverter.HasEmptyEnumTypeAdapterFactory()) + .create(); + + private static final UntypedMapDeserializer FLATTENING_EXTRA_PARAMS_DESERIALIZER = + new UntypedMapDeserializer(new ExtraParamsFlatteningStrategy()); + + /** + * Convert the given request params into an untyped map. This map is + * composed of {@code Map}, {@code List}, and basic Java data types. + * This allows you to test building the request params and verify compatibility with your + * prior integrations using the untyped params map + * {@link ApiResource#request(ApiResource.RequestMethod, String, Map, Class, RequestOptions)}. + * + *

There are two peculiarities in this conversion: + * + *

1) {@link EmptyParam#EMPTY}, containing a raw empty string value, is converted to null. + * This is because the form-encoding layer prohibits passing empty string as a param map value. + * It, however, allows a null value in the map (present key but null value). + * Because of the translation from `EMPTY` enum to null, deserializing this map back to a + * request instance is lossy. The null value will not be converted back to the `EMPTY` enum. + * + *

2) Parameter with serialized name {@link ApiRequestParams#EXTRA_PARAMS_KEY} will be + * flattened. This is to support passing new params that the current library has not + * yet supported. + */ + Map convert(ApiRequestParams apiRequestParams) { + JsonObject jsonParams = GSON.toJsonTree(apiRequestParams).getAsJsonObject(); + return FLATTENING_EXTRA_PARAMS_DESERIALIZER.deserialize(jsonParams); + } +} diff --git a/src/main/java/com/stripe/net/UntypedMapDeserializer.java b/src/main/java/com/stripe/net/UntypedMapDeserializer.java index c328e1f2554..997898f3894 100644 --- a/src/main/java/com/stripe/net/UntypedMapDeserializer.java +++ b/src/main/java/com/stripe/net/UntypedMapDeserializer.java @@ -17,28 +17,95 @@ * JSON representation (using GSON) to a generic {@code Map}. */ public class UntypedMapDeserializer { + /** + * Strategy to deserialize a JSON element, allowing for custom interactions between the + * deserialized element and its outer map. + * For example, for a full JSON: + * { + * "foo": 1, + * "foo_inner": { // outer context map + * "bar": 1, + * "zing": 2, // given JSON element + * }, + * } + * + *

Given, a json entry of "zing": 2, the outer map corresponds to value for "foo_inner". A + * default strategy is to simply deserialize value and puts it at "zing" key in the outer map. + * + *

Custom strategy allows, for example, renaming the key "zing", wrapping the deserialized + * value in another map/array, or flattening the value if the deserialized value is a map. + */ + interface Strategy { + /** + * Define how the given JSON element should be deserialized, and how the deserialized content + * should be added to the given outer map. + * @param outerMap the untyped map that the deserialized content can be added to. + * @param jsonEntry original JSON entry with key and json element + * @param untypedMapDeserializer deserializer for the untyped map to transform the given json + * element + */ + void deserializeAndTransform(Map outerMap, + Map.Entry jsonEntry, + UntypedMapDeserializer untypedMapDeserializer + ); + } + + /** + * Strategy for this deserializer. + */ + private Strategy strategy; + + /** + * Default deserializer for the untyped map. The result untyped map has same object graph + * structure as that of the given JSON content. + */ + public UntypedMapDeserializer() { + /** + * Default strategy where each JSON element gets deserialized and added with its original key. + */ + this.strategy = new Strategy() { + @Override + public void deserializeAndTransform(Map outerMap, + Map.Entry jsonEntry, + UntypedMapDeserializer untypedMapDeserializer) { + outerMap.put( + jsonEntry.getKey(), + untypedMapDeserializer.deserializeJsonElement(jsonEntry.getValue())); + } + }; + } + + /** + * Deserializer with a custom strategy. + * @param strategy definition of how JSON element should be deserialized and set in its outer map. + */ + UntypedMapDeserializer(Strategy strategy) { + this.strategy = strategy; + } + /** * Deserialize JSON into untyped map. * {@code JsonArray} is represented as {@code List}. * {@code JsonObject} is represented as {@code Map}. * {@code JsonPrimitive} is represented as String, Number, or Boolean. - * * @param jsonObject JSON to convert into untyped map * @return untyped map without dependency on JSON representation. */ public Map deserialize(JsonObject jsonObject) { Map objMap = new HashMap<>(); for (Map.Entry entry : jsonObject.entrySet()) { - String key = entry.getKey(); - JsonElement element = entry.getValue(); - // JsonElement is super class of all JSON standard types: - // array, null, primitive, and object - objMap.put(key, deserializeJsonElement(element)); + this.strategy.deserializeAndTransform(objMap, entry, this); } return objMap; } - private Object deserializeJsonElement(JsonElement element) { + /** + * Normalizes JSON element into an untyped Object as value to the untyped map. + * @param element JSON element to convert to java Object + * @return untyped object, one of {@code Map}, {@code String}, {@code Number}, + * {@code Boolean}, or {@code List}. + */ + Object deserializeJsonElement(JsonElement element) { if (element.isJsonNull()) { return null; } else if (element.isJsonObject()) { diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 2397fa7dc39..3493dbece55 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -74,6 +74,15 @@ public class AccountCreateParams extends ApiRequestParams { @SerializedName("external_account") String externalAccount; + /** + * 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; + /** * Information about the person represented by the account. This field is null unless * `business_type` is set to `individual`. @@ -124,6 +133,7 @@ private AccountCreateParams( String email, List expand, String externalAccount, + Map extraParams, Individual individual, Map metadata, List requestedCapabilities, @@ -139,6 +149,7 @@ private AccountCreateParams( this.email = email; this.expand = expand; this.externalAccount = externalAccount; + this.extraParams = extraParams; this.individual = individual; this.metadata = metadata; this.requestedCapabilities = requestedCapabilities; @@ -170,6 +181,8 @@ public static class Builder { private String externalAccount; + private Map extraParams; + private Individual individual; private Map metadata; @@ -194,6 +207,7 @@ public AccountCreateParams build() { this.email, this.expand, this.externalAccount, + this.extraParams, this.individual, this.metadata, this.requestedCapabilities, @@ -304,6 +318,32 @@ public Builder setExternalAccount(String externalAccount) { 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 + * AccountCreateParams#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 AccountCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Information about the person represented by the account. This field is null unless * `business_type` is set to `individual`. @@ -391,6 +431,15 @@ public Builder setType(Type type) { } public static class BusinessProfile { + /** + * 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; + /** * The merchant category code for the account. MCCs are used to classify businesses based on the * goods or services they provide. @@ -426,6 +475,7 @@ public static class BusinessProfile { String url; private BusinessProfile( + Map extraParams, String mcc, String name, String productDescription, @@ -433,6 +483,7 @@ private BusinessProfile( String supportPhone, String supportUrl, String url) { + this.extraParams = extraParams; this.mcc = mcc; this.name = name; this.productDescription = productDescription; @@ -447,6 +498,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String mcc; private String name; @@ -464,6 +517,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public BusinessProfile build() { return new BusinessProfile( + this.extraParams, this.mcc, this.name, this.productDescription, @@ -473,6 +527,32 @@ public BusinessProfile build() { this.url); } + /** + * 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 + * AccountCreateParams.BusinessProfile#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 AccountCreateParams.BusinessProfile#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The merchant category code for the account. MCCs are used to classify businesses based on * the goods or services they provide. @@ -546,6 +626,15 @@ public static class Company { @SerializedName("directors_provided") Boolean directorsProvided; + /** + * 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; + /** The company's legal name. */ @SerializedName("name") String name; @@ -591,6 +680,7 @@ private Company( AddressKana addressKana, AddressKanji addressKanji, Boolean directorsProvided, + Map extraParams, String name, String nameKana, String nameKanji, @@ -603,6 +693,7 @@ private Company( this.addressKana = addressKana; this.addressKanji = addressKanji; this.directorsProvided = directorsProvided; + this.extraParams = extraParams; this.name = name; this.nameKana = nameKana; this.nameKanji = nameKanji; @@ -626,6 +717,8 @@ public static class Builder { private Boolean directorsProvided; + private Map extraParams; + private String name; private String nameKana; @@ -649,6 +742,7 @@ public Company build() { this.addressKana, this.addressKanji, this.directorsProvided, + this.extraParams, this.name, this.nameKana, this.nameKanji, @@ -689,6 +783,32 @@ public Builder setDirectorsProvided(Boolean directorsProvided) { 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 + * AccountCreateParams.Company#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 AccountCreateParams.Company#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The company's legal name. */ public Builder setName(String name) { this.name = name; @@ -758,6 +878,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -777,12 +906,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -798,6 +929,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -809,7 +942,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -827,6 +966,34 @@ public Builder setCountry(String 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 AccountCreateParams.Company.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 AccountCreateParams.Company.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; @@ -865,6 +1032,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -888,6 +1064,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -895,6 +1072,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -911,6 +1089,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -926,6 +1106,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -948,6 +1129,34 @@ public Builder setCountry(String 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 AccountCreateParams.Company.AddressKana#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 AccountCreateParams.Company.AddressKana#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -992,6 +1201,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -1015,6 +1233,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -1022,6 +1241,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1038,6 +1258,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1053,6 +1275,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1075,6 +1298,34 @@ public Builder setCountry(String 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 AccountCreateParams.Company.AddressKanji#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 AccountCreateParams.Company.AddressKanji#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1128,6 +1379,15 @@ public static class Individual { @SerializedName("email") String 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; + /** The individual's first name. */ @SerializedName("first_name") String firstName; @@ -1196,6 +1456,7 @@ private Individual( AddressKanji addressKanji, Dob dob, String email, + Map extraParams, String firstName, String firstNameKana, String firstNameKanji, @@ -1214,6 +1475,7 @@ private Individual( this.addressKanji = addressKanji; this.dob = dob; this.email = email; + this.extraParams = extraParams; this.firstName = firstName; this.firstNameKana = firstNameKana; this.firstNameKanji = firstNameKanji; @@ -1244,6 +1506,8 @@ public static class Builder { private String email; + private Map extraParams; + private String firstName; private String firstNameKana; @@ -1278,6 +1542,7 @@ public Individual build() { this.addressKanji, this.dob, this.email, + this.extraParams, this.firstName, this.firstNameKana, this.firstNameKanji, @@ -1322,6 +1587,32 @@ public Builder setEmail(String 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 + * AccountCreateParams.Individual#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 AccountCreateParams.Individual#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The individual's first name. */ public Builder setFirstName(String firstName) { this.firstName = firstName; @@ -1438,6 +1729,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -1457,12 +1757,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1478,6 +1780,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1489,7 +1793,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -1507,6 +1817,34 @@ public Builder setCountry(String 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 AccountCreateParams.Individual.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 AccountCreateParams.Individual.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; @@ -1545,6 +1883,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -1568,6 +1915,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -1575,6 +1923,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1591,6 +1940,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1606,6 +1957,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1628,6 +1980,34 @@ public Builder setCountry(String 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 AccountCreateParams.Individual.AddressKana#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 AccountCreateParams.Individual.AddressKana#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1672,6 +2052,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -1695,6 +2084,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -1702,6 +2092,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1718,6 +2109,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1733,6 +2126,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1755,6 +2149,34 @@ public Builder setCountry(String 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 AccountCreateParams.Individual.AddressKanji#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 AccountCreateParams.Individual.AddressKanji#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1792,6 +2214,15 @@ public static class Dob { @SerializedName("day") Long day; + /** + * 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; + /** The month of birth, between 1 and 12. */ @SerializedName("month") Long month; @@ -1800,8 +2231,9 @@ public static class Dob { @SerializedName("year") Long year; - private Dob(Long day, Long month, Long year) { + private Dob(Long day, Map extraParams, Long month, Long year) { this.day = day; + this.extraParams = extraParams; this.month = month; this.year = year; } @@ -1813,13 +2245,15 @@ public static Builder builder() { public static class Builder { private Long day; + private Map extraParams; + private Long month; private Long year; /** Finalize and obtain parameter instance from this builder. */ public Dob build() { - return new Dob(this.day, this.month, this.year); + return new Dob(this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -1828,6 +2262,34 @@ public Builder setDay(Long day) { 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 AccountCreateParams.Individual.Dob#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 AccountCreateParams.Individual.Dob#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The month of birth, between 1 and 12. */ public Builder setMonth(Long month) { this.month = month; @@ -1847,8 +2309,18 @@ public static class Verification { @SerializedName("document") Document document; - private Verification(Document document) { + /** + * 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 Verification(Document document, Map extraParams) { this.document = document; + this.extraParams = extraParams; } public static Builder builder() { @@ -1858,9 +2330,11 @@ public static Builder builder() { public static class Builder { private Document document; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Verification build() { - return new Verification(this.document); + return new Verification(this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ @@ -1868,6 +2342,34 @@ public Builder setDocument(Document document) { this.document = document; 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 AccountCreateParams.Individual.Verification#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 AccountCreateParams.Individual.Verification#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } public static class Document { @@ -1878,6 +2380,16 @@ public static class Document { @SerializedName("back") String back; + /** + * 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; + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -1885,8 +2397,9 @@ public static class Document { @SerializedName("front") String front; - private Document(String back, String front) { + private Document(String back, Map extraParams, String front) { this.back = back; + this.extraParams = extraParams; this.front = front; } @@ -1898,11 +2411,13 @@ public static Builder builder() { public static class Builder { private String back; + private Map extraParams; + private String front; /** Finalize and obtain parameter instance from this builder. */ public Document build() { - return new Document(this.back, this.front); + return new Document(this.back, this.extraParams, this.front); } /** @@ -1914,6 +2429,34 @@ public Builder setBack(String back) { 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 AccountCreateParams.Individual.Verification.Document#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 AccountCreateParams.Individual.Verification.Document#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -1939,6 +2482,15 @@ public static class Settings { @SerializedName("card_payments") CardPayments cardPayments; + /** + * 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; + /** Settings that apply across payment methods for charging on the account. */ @SerializedName("payments") Payments payments; @@ -1948,9 +2500,14 @@ public static class Settings { Payouts payouts; private Settings( - Branding branding, CardPayments cardPayments, Payments payments, Payouts payouts) { + Branding branding, + CardPayments cardPayments, + Map extraParams, + Payments payments, + Payouts payouts) { this.branding = branding; this.cardPayments = cardPayments; + this.extraParams = extraParams; this.payments = payments; this.payouts = payouts; } @@ -1964,13 +2521,16 @@ public static class Builder { private CardPayments cardPayments; + private Map extraParams; + private Payments payments; private Payouts payouts; /** Finalize and obtain parameter instance from this builder. */ public Settings build() { - return new Settings(this.branding, this.cardPayments, this.payments, this.payouts); + return new Settings( + this.branding, this.cardPayments, this.extraParams, this.payments, this.payouts); } /** @@ -1988,6 +2548,32 @@ public Builder setCardPayments(CardPayments cardPayments) { 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 + * AccountCreateParams.Settings#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 AccountCreateParams.Settings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Settings that apply across payment methods for charging on the account. */ public Builder setPayments(Payments payments) { this.payments = payments; @@ -2002,6 +2588,15 @@ public Builder setPayouts(Payouts payouts) { } public static class Branding { + /** + * 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; + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the * account. Must be square and at least 128px x 128px. @@ -2021,7 +2616,9 @@ public static class Branding { @SerializedName("primary_color") String primaryColor; - private Branding(String icon, String logo, String primaryColor) { + private Branding( + Map extraParams, String icon, String logo, String primaryColor) { + this.extraParams = extraParams; this.icon = icon; this.logo = logo; this.primaryColor = primaryColor; @@ -2032,6 +2629,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String icon; private String logo; @@ -2040,7 +2639,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Branding build() { - return new Branding(this.icon, this.logo, this.primaryColor); + return new Branding(this.extraParams, this.icon, this.logo, this.primaryColor); + } + + /** + * 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 AccountCreateParams.Settings.Branding#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 AccountCreateParams.Settings.Branding#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -2078,6 +2705,15 @@ public static class CardPayments { @SerializedName("decline_on") DeclineOn declineOn; + /** + * 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; + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2087,8 +2723,10 @@ public static class CardPayments { @SerializedName("statement_descriptor_prefix") String statementDescriptorPrefix; - private CardPayments(DeclineOn declineOn, String statementDescriptorPrefix) { + private CardPayments( + DeclineOn declineOn, Map extraParams, String statementDescriptorPrefix) { this.declineOn = declineOn; + this.extraParams = extraParams; this.statementDescriptorPrefix = statementDescriptorPrefix; } @@ -2099,11 +2737,13 @@ public static Builder builder() { public static class Builder { private DeclineOn declineOn; + private Map extraParams; + private String statementDescriptorPrefix; /** Finalize and obtain parameter instance from this builder. */ public CardPayments build() { - return new CardPayments(this.declineOn, this.statementDescriptorPrefix); + return new CardPayments(this.declineOn, this.extraParams, this.statementDescriptorPrefix); } /** @@ -2115,6 +2755,34 @@ public Builder setDeclineOn(DeclineOn declineOn) { 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 AccountCreateParams.Settings.CardPayments#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 AccountCreateParams.Settings.CardPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2143,9 +2811,20 @@ public static class DeclineOn { @SerializedName("cvc_failure") Boolean cvcFailure; - private DeclineOn(Boolean avsFailure, Boolean cvcFailure) { + /** + * 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 DeclineOn(Boolean avsFailure, Boolean cvcFailure, Map extraParams) { this.avsFailure = avsFailure; this.cvcFailure = cvcFailure; + this.extraParams = extraParams; } public static Builder builder() { @@ -2157,9 +2836,11 @@ public static class Builder { private Boolean cvcFailure; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public DeclineOn build() { - return new DeclineOn(this.avsFailure, this.cvcFailure); + return new DeclineOn(this.avsFailure, this.cvcFailure, this.extraParams); } /** @@ -2180,11 +2861,48 @@ public Builder setCvcFailure(Boolean cvcFailure) { this.cvcFailure = cvcFailure; 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 AccountCreateParams.Settings.CardPayments.DeclineOn#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 AccountCreateParams.Settings.CardPayments.DeclineOn#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } public static class Payments { + /** + * 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; + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2192,7 +2910,8 @@ public static class Payments { @SerializedName("statement_descriptor") String statementDescriptor; - private Payments(String statementDescriptor) { + private Payments(Map extraParams, String statementDescriptor) { + this.extraParams = extraParams; this.statementDescriptor = statementDescriptor; } @@ -2201,11 +2920,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ public Payments build() { - return new Payments(this.statementDescriptor); + return new Payments(this.extraParams, this.statementDescriptor); + } + + /** + * 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 AccountCreateParams.Settings.Payments#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 AccountCreateParams.Settings.Payments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -2228,6 +2977,15 @@ public static class Payouts { @SerializedName("debit_negative_balances") Boolean debitNegativeBalances; + /** + * 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; + /** * Details on when funds from charges are available, and when they are paid out to an external * account. For details, see our [Setting Bank and Debit Card @@ -2244,8 +3002,12 @@ public static class Payouts { String statementDescriptor; private Payouts( - Boolean debitNegativeBalances, Schedule schedule, String statementDescriptor) { + Boolean debitNegativeBalances, + Map extraParams, + Schedule schedule, + String statementDescriptor) { this.debitNegativeBalances = debitNegativeBalances; + this.extraParams = extraParams; this.schedule = schedule; this.statementDescriptor = statementDescriptor; } @@ -2257,13 +3019,19 @@ public static Builder builder() { public static class Builder { private Boolean debitNegativeBalances; + private Map extraParams; + private Schedule schedule; private String statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ public Payouts build() { - return new Payouts(this.debitNegativeBalances, this.schedule, this.statementDescriptor); + return new Payouts( + this.debitNegativeBalances, + this.extraParams, + this.schedule, + this.statementDescriptor); } /** @@ -2276,6 +3044,34 @@ public Builder setDebitNegativeBalances(Boolean debitNegativeBalances) { 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 AccountCreateParams.Settings.Payouts#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 AccountCreateParams.Settings.Payouts#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Details on when funds from charges are available, and when they are paid out to an * external account. For details, see our [Setting Bank and Debit Card @@ -2306,6 +3102,16 @@ public static class Schedule { @SerializedName("delay_days") Object delayDays; + /** + * 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; + /** * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or * `monthly`. Default is `daily`. @@ -2328,8 +3134,13 @@ public static class Schedule { WeeklyAnchor weeklyAnchor; private Schedule( - Object delayDays, Interval interval, Long monthlyAnchor, WeeklyAnchor weeklyAnchor) { + Object delayDays, + Map extraParams, + Interval interval, + Long monthlyAnchor, + WeeklyAnchor weeklyAnchor) { this.delayDays = delayDays; + this.extraParams = extraParams; this.interval = interval; this.monthlyAnchor = monthlyAnchor; this.weeklyAnchor = weeklyAnchor; @@ -2342,6 +3153,8 @@ public static Builder builder() { public static class Builder { private Object delayDays; + private Map extraParams; + private Interval interval; private Long monthlyAnchor; @@ -2351,7 +3164,11 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Schedule build() { return new Schedule( - this.delayDays, this.interval, this.monthlyAnchor, this.weeklyAnchor); + this.delayDays, + this.extraParams, + this.interval, + this.monthlyAnchor, + this.weeklyAnchor); } /** @@ -2374,6 +3191,34 @@ public Builder setDelayDays(Long delayDays) { 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 AccountCreateParams.Settings.Payouts.Schedule#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 AccountCreateParams.Settings.Payouts.Schedule#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or * `monthly`. Default is `daily`. @@ -2476,6 +3321,15 @@ public static class TosAcceptance { @SerializedName("date") Long date; + /** + * 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; + /** * The IP address from which the account representative accepted the Stripe Services Agreement. */ @@ -2489,8 +3343,9 @@ public static class TosAcceptance { @SerializedName("user_agent") String userAgent; - private TosAcceptance(Long date, String ip, String userAgent) { + private TosAcceptance(Long date, Map extraParams, String ip, String userAgent) { this.date = date; + this.extraParams = extraParams; this.ip = ip; this.userAgent = userAgent; } @@ -2502,13 +3357,15 @@ public static Builder builder() { public static class Builder { private Long date; + private Map extraParams; + private String ip; private String userAgent; /** Finalize and obtain parameter instance from this builder. */ public TosAcceptance build() { - return new TosAcceptance(this.date, this.ip, this.userAgent); + return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -2520,6 +3377,32 @@ public Builder setDate(Long date) { 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 + * AccountCreateParams.TosAcceptance#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 AccountCreateParams.TosAcceptance#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The IP address from which the account representative accepted the Stripe Services * Agreement. @@ -2547,6 +3430,9 @@ public enum RequestedCapability implements ApiRequestParams.EnumParam { @SerializedName("card_payments") CARD_PAYMENTS("card_payments"), + @SerializedName("legacy_payments") + LEGACY_PAYMENTS("legacy_payments"), + @SerializedName("platform_payments") PLATFORM_PAYMENTS("platform_payments"); diff --git a/src/main/java/com/stripe/param/AccountLinkCreateParams.java b/src/main/java/com/stripe/param/AccountLinkCreateParams.java index e65c4918630..84a81ac377e 100644 --- a/src/main/java/com/stripe/param/AccountLinkCreateParams.java +++ b/src/main/java/com/stripe/param/AccountLinkCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class AccountLinkCreateParams extends ApiRequestParams { @@ -24,6 +26,15 @@ public class AccountLinkCreateParams extends ApiRequestParams { @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; + /** The URL that the user will be redirected to if the account link is no longer valid. */ @SerializedName("failure_url") String failureUrl; @@ -43,12 +54,14 @@ private AccountLinkCreateParams( String account, Collect collect, List expand, + Map extraParams, String failureUrl, String successUrl, String type) { this.account = account; this.collect = collect; this.expand = expand; + this.extraParams = extraParams; this.failureUrl = failureUrl; this.successUrl = successUrl; this.type = type; @@ -65,6 +78,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String failureUrl; private String successUrl; @@ -74,7 +89,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public AccountLinkCreateParams build() { return new AccountLinkCreateParams( - this.account, this.collect, this.expand, this.failureUrl, this.successUrl, this.type); + this.account, + this.collect, + this.expand, + this.extraParams, + this.failureUrl, + this.successUrl, + this.type); } /** The identifier of the account to create an account link for. */ @@ -118,6 +139,32 @@ public Builder addAllExpand(List 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 + * AccountLinkCreateParams#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 AccountLinkCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The URL that the user will be redirected to if the account link is no longer valid. */ public Builder setFailureUrl(String failureUrl) { this.failureUrl = failureUrl; diff --git a/src/main/java/com/stripe/param/AccountListParams.java b/src/main/java/com/stripe/param/AccountListParams.java index 32b18641fbd..102243c9699 100644 --- a/src/main/java/com/stripe/param/AccountListParams.java +++ b/src/main/java/com/stripe/param/AccountListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AccountListParams extends ApiRequestParams { @SerializedName("created") @@ -24,6 +26,15 @@ public class AccountListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -41,10 +52,16 @@ public class AccountListParams extends ApiRequestParams { String startingAfter; private AccountListParams( - Object created, String endingBefore, List expand, Long limit, String startingAfter) { + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -60,6 +77,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -67,7 +86,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public AccountListParams build() { return new AccountListParams( - this.created, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setCreated(Created created) { @@ -117,6 +141,32 @@ public Builder addAllExpand(List 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 + * AccountListParams#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 AccountListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -139,6 +189,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -155,7 +214,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -167,6 +227,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -177,7 +239,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * AccountListParams.Created#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 AccountListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/AccountPersonsParams.java b/src/main/java/com/stripe/param/AccountPersonsParams.java index 148c1324a02..abb53789b0e 100644 --- a/src/main/java/com/stripe/param/AccountPersonsParams.java +++ b/src/main/java/com/stripe/param/AccountPersonsParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AccountPersonsParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class AccountPersonsParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -47,11 +58,13 @@ public class AccountPersonsParams extends ApiRequestParams { private AccountPersonsParams( String endingBefore, List expand, + Map extraParams, Long limit, Relationship relationship, String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.relationship = relationship; this.startingAfter = startingAfter; @@ -66,6 +79,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private Relationship relationship; @@ -75,7 +90,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public AccountPersonsParams build() { return new AccountPersonsParams( - this.endingBefore, this.expand, this.limit, this.relationship, this.startingAfter); + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.relationship, + this.startingAfter); } /** @@ -115,6 +135,32 @@ public Builder addAllExpand(List 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 + * AccountPersonsParams#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 AccountPersonsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -160,6 +206,15 @@ public static class Relationship { @SerializedName("director") Boolean director; + /** + * 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; + /** * A filter on the list of people returned based on whether these people are owners of the * account's company. @@ -167,9 +222,11 @@ public static class Relationship { @SerializedName("owner") Boolean owner; - private Relationship(Boolean accountOpener, Boolean director, Boolean owner) { + private Relationship( + Boolean accountOpener, Boolean director, Map extraParams, Boolean owner) { this.accountOpener = accountOpener; this.director = director; + this.extraParams = extraParams; this.owner = owner; } @@ -182,11 +239,13 @@ public static class Builder { private Boolean director; + private Map extraParams; + private Boolean owner; /** Finalize and obtain parameter instance from this builder. */ public Relationship build() { - return new Relationship(this.accountOpener, this.director, this.owner); + return new Relationship(this.accountOpener, this.director, this.extraParams, this.owner); } /** @@ -207,6 +266,32 @@ public Builder setDirector(Boolean director) { 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 + * AccountPersonsParams.Relationship#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 AccountPersonsParams.Relationship#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A filter on the list of people returned based on whether these people are owners of the * account's company. diff --git a/src/main/java/com/stripe/param/AccountRejectParams.java b/src/main/java/com/stripe/param/AccountRejectParams.java index cba468835ef..cfbc055b96f 100644 --- a/src/main/java/com/stripe/param/AccountRejectParams.java +++ b/src/main/java/com/stripe/param/AccountRejectParams.java @@ -5,19 +5,31 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AccountRejectParams extends ApiRequestParams { /** 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; + /** The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. */ @SerializedName("reason") String reason; - private AccountRejectParams(List expand, String reason) { + private AccountRejectParams(List expand, Map extraParams, String reason) { this.expand = expand; + this.extraParams = extraParams; this.reason = reason; } @@ -28,11 +40,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String reason; /** Finalize and obtain parameter instance from this builder. */ public AccountRejectParams build() { - return new AccountRejectParams(this.expand, this.reason); + return new AccountRejectParams(this.expand, this.extraParams, this.reason); } /** @@ -61,6 +75,32 @@ public Builder addAllExpand(List 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 + * AccountRejectParams#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 AccountRejectParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. */ public Builder setReason(String reason) { this.reason = reason; diff --git a/src/main/java/com/stripe/param/AccountRetrieveParams.java b/src/main/java/com/stripe/param/AccountRetrieveParams.java index f7c10089bdc..3be45ded460 100644 --- a/src/main/java/com/stripe/param/AccountRetrieveParams.java +++ b/src/main/java/com/stripe/param/AccountRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AccountRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private AccountRetrieveParams(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; + + private AccountRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public AccountRetrieveParams build() { - return new AccountRetrieveParams(this.expand); + return new AccountRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * AccountRetrieveParams#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 AccountRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index e55d81fdbe9..32a0930264d 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -66,6 +66,15 @@ public class AccountUpdateParams extends ApiRequestParams { @SerializedName("external_account") String externalAccount; + /** + * 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; + /** * Information about the person represented by the account. This field is null unless * `business_type` is set to `individual`. @@ -108,6 +117,7 @@ private AccountUpdateParams( String email, List expand, String externalAccount, + Map extraParams, Individual individual, Map metadata, List requestedCapabilities, @@ -121,6 +131,7 @@ private AccountUpdateParams( this.email = email; this.expand = expand; this.externalAccount = externalAccount; + this.extraParams = extraParams; this.individual = individual; this.metadata = metadata; this.requestedCapabilities = requestedCapabilities; @@ -149,6 +160,8 @@ public static class Builder { private String externalAccount; + private Map extraParams; + private Individual individual; private Map metadata; @@ -170,6 +183,7 @@ public AccountUpdateParams build() { this.email, this.expand, this.externalAccount, + this.extraParams, this.individual, this.metadata, this.requestedCapabilities, @@ -269,6 +283,32 @@ public Builder setExternalAccount(String externalAccount) { 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 + * AccountUpdateParams#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 AccountUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Information about the person represented by the account. This field is null unless * `business_type` is set to `individual`. @@ -347,6 +387,15 @@ public Builder setTosAcceptance(TosAcceptance tosAcceptance) { } public static class BusinessProfile { + /** + * 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; + /** * The merchant category code for the account. MCCs are used to classify businesses based on the * goods or services they provide. @@ -382,6 +431,7 @@ public static class BusinessProfile { String url; private BusinessProfile( + Map extraParams, String mcc, String name, String productDescription, @@ -389,6 +439,7 @@ private BusinessProfile( String supportPhone, String supportUrl, String url) { + this.extraParams = extraParams; this.mcc = mcc; this.name = name; this.productDescription = productDescription; @@ -403,6 +454,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String mcc; private String name; @@ -420,6 +473,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public BusinessProfile build() { return new BusinessProfile( + this.extraParams, this.mcc, this.name, this.productDescription, @@ -429,6 +483,32 @@ public BusinessProfile build() { this.url); } + /** + * 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 + * AccountUpdateParams.BusinessProfile#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 AccountUpdateParams.BusinessProfile#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The merchant category code for the account. MCCs are used to classify businesses based on * the goods or services they provide. @@ -502,6 +582,15 @@ public static class Company { @SerializedName("directors_provided") Boolean directorsProvided; + /** + * 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; + /** The company's legal name. */ @SerializedName("name") String name; @@ -547,6 +636,7 @@ private Company( AddressKana addressKana, AddressKanji addressKanji, Boolean directorsProvided, + Map extraParams, String name, String nameKana, String nameKanji, @@ -559,6 +649,7 @@ private Company( this.addressKana = addressKana; this.addressKanji = addressKanji; this.directorsProvided = directorsProvided; + this.extraParams = extraParams; this.name = name; this.nameKana = nameKana; this.nameKanji = nameKanji; @@ -582,6 +673,8 @@ public static class Builder { private Boolean directorsProvided; + private Map extraParams; + private String name; private String nameKana; @@ -605,6 +698,7 @@ public Company build() { this.addressKana, this.addressKanji, this.directorsProvided, + this.extraParams, this.name, this.nameKana, this.nameKanji, @@ -645,6 +739,32 @@ public Builder setDirectorsProvided(Boolean directorsProvided) { 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 + * AccountUpdateParams.Company#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 AccountUpdateParams.Company#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The company's legal name. */ public Builder setName(String name) { this.name = name; @@ -714,6 +834,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -733,12 +862,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -754,6 +885,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -765,7 +898,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -783,6 +922,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Company.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 AccountUpdateParams.Company.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; @@ -821,6 +988,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -844,6 +1020,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -851,6 +1028,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -867,6 +1045,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -882,6 +1062,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -904,6 +1085,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Company.AddressKana#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 AccountUpdateParams.Company.AddressKana#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -948,6 +1157,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -971,6 +1189,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -978,6 +1197,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -994,6 +1214,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1009,6 +1231,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1031,6 +1254,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Company.AddressKanji#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 AccountUpdateParams.Company.AddressKanji#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1084,6 +1335,15 @@ public static class Individual { @SerializedName("email") String 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; + /** The individual's first name. */ @SerializedName("first_name") String firstName; @@ -1152,6 +1412,7 @@ private Individual( AddressKanji addressKanji, Dob dob, String email, + Map extraParams, String firstName, String firstNameKana, String firstNameKanji, @@ -1170,6 +1431,7 @@ private Individual( this.addressKanji = addressKanji; this.dob = dob; this.email = email; + this.extraParams = extraParams; this.firstName = firstName; this.firstNameKana = firstNameKana; this.firstNameKanji = firstNameKanji; @@ -1200,6 +1462,8 @@ public static class Builder { private String email; + private Map extraParams; + private String firstName; private String firstNameKana; @@ -1234,6 +1498,7 @@ public Individual build() { this.addressKanji, this.dob, this.email, + this.extraParams, this.firstName, this.firstNameKana, this.firstNameKanji, @@ -1278,6 +1543,32 @@ public Builder setEmail(String 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 + * AccountUpdateParams.Individual#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 AccountUpdateParams.Individual#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The individual's first name. */ public Builder setFirstName(String firstName) { this.firstName = firstName; @@ -1394,6 +1685,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -1413,12 +1713,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1434,6 +1736,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1445,7 +1749,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -1463,6 +1773,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Individual.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 AccountUpdateParams.Individual.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; @@ -1501,6 +1839,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -1524,6 +1871,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -1531,6 +1879,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1547,6 +1896,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1562,6 +1913,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1584,6 +1936,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Individual.AddressKana#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 AccountUpdateParams.Individual.AddressKana#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1628,6 +2008,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -1651,6 +2040,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -1658,6 +2048,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -1674,6 +2065,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -1689,6 +2082,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -1711,6 +2105,34 @@ public Builder setCountry(String 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 AccountUpdateParams.Individual.AddressKanji#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 AccountUpdateParams.Individual.AddressKanji#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -1748,6 +2170,15 @@ public static class Dob { @SerializedName("day") Long day; + /** + * 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; + /** The month of birth, between 1 and 12. */ @SerializedName("month") Long month; @@ -1756,8 +2187,9 @@ public static class Dob { @SerializedName("year") Long year; - private Dob(Long day, Long month, Long year) { + private Dob(Long day, Map extraParams, Long month, Long year) { this.day = day; + this.extraParams = extraParams; this.month = month; this.year = year; } @@ -1769,13 +2201,15 @@ public static Builder builder() { public static class Builder { private Long day; + private Map extraParams; + private Long month; private Long year; /** Finalize and obtain parameter instance from this builder. */ public Dob build() { - return new Dob(this.day, this.month, this.year); + return new Dob(this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -1784,6 +2218,34 @@ public Builder setDay(Long day) { 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 AccountUpdateParams.Individual.Dob#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 AccountUpdateParams.Individual.Dob#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The month of birth, between 1 and 12. */ public Builder setMonth(Long month) { this.month = month; @@ -1803,8 +2265,18 @@ public static class Verification { @SerializedName("document") Document document; - private Verification(Document document) { + /** + * 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 Verification(Document document, Map extraParams) { this.document = document; + this.extraParams = extraParams; } public static Builder builder() { @@ -1814,9 +2286,11 @@ public static Builder builder() { public static class Builder { private Document document; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Verification build() { - return new Verification(this.document); + return new Verification(this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ @@ -1824,6 +2298,34 @@ public Builder setDocument(Document document) { this.document = document; 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 AccountUpdateParams.Individual.Verification#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 AccountUpdateParams.Individual.Verification#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } public static class Document { @@ -1834,6 +2336,16 @@ public static class Document { @SerializedName("back") String back; + /** + * 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; + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -1841,8 +2353,9 @@ public static class Document { @SerializedName("front") String front; - private Document(String back, String front) { + private Document(String back, Map extraParams, String front) { this.back = back; + this.extraParams = extraParams; this.front = front; } @@ -1854,11 +2367,13 @@ public static Builder builder() { public static class Builder { private String back; + private Map extraParams; + private String front; /** Finalize and obtain parameter instance from this builder. */ public Document build() { - return new Document(this.back, this.front); + return new Document(this.back, this.extraParams, this.front); } /** @@ -1870,6 +2385,34 @@ public Builder setBack(String back) { 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 AccountUpdateParams.Individual.Verification.Document#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 AccountUpdateParams.Individual.Verification.Document#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -1895,6 +2438,15 @@ public static class Settings { @SerializedName("card_payments") CardPayments cardPayments; + /** + * 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; + /** Settings that apply across payment methods for charging on the account. */ @SerializedName("payments") Payments payments; @@ -1904,9 +2456,14 @@ public static class Settings { Payouts payouts; private Settings( - Branding branding, CardPayments cardPayments, Payments payments, Payouts payouts) { + Branding branding, + CardPayments cardPayments, + Map extraParams, + Payments payments, + Payouts payouts) { this.branding = branding; this.cardPayments = cardPayments; + this.extraParams = extraParams; this.payments = payments; this.payouts = payouts; } @@ -1920,13 +2477,16 @@ public static class Builder { private CardPayments cardPayments; + private Map extraParams; + private Payments payments; private Payouts payouts; /** Finalize and obtain parameter instance from this builder. */ public Settings build() { - return new Settings(this.branding, this.cardPayments, this.payments, this.payouts); + return new Settings( + this.branding, this.cardPayments, this.extraParams, this.payments, this.payouts); } /** @@ -1944,6 +2504,32 @@ public Builder setCardPayments(CardPayments cardPayments) { 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 + * AccountUpdateParams.Settings#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 AccountUpdateParams.Settings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Settings that apply across payment methods for charging on the account. */ public Builder setPayments(Payments payments) { this.payments = payments; @@ -1958,6 +2544,15 @@ public Builder setPayouts(Payouts payouts) { } public static class Branding { + /** + * 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; + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the * account. Must be square and at least 128px x 128px. @@ -1977,7 +2572,9 @@ public static class Branding { @SerializedName("primary_color") String primaryColor; - private Branding(String icon, String logo, String primaryColor) { + private Branding( + Map extraParams, String icon, String logo, String primaryColor) { + this.extraParams = extraParams; this.icon = icon; this.logo = logo; this.primaryColor = primaryColor; @@ -1988,6 +2585,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String icon; private String logo; @@ -1996,7 +2595,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Branding build() { - return new Branding(this.icon, this.logo, this.primaryColor); + return new Branding(this.extraParams, this.icon, this.logo, this.primaryColor); + } + + /** + * 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 AccountUpdateParams.Settings.Branding#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 AccountUpdateParams.Settings.Branding#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -2034,6 +2661,15 @@ public static class CardPayments { @SerializedName("decline_on") DeclineOn declineOn; + /** + * 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; + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2043,8 +2679,10 @@ public static class CardPayments { @SerializedName("statement_descriptor_prefix") String statementDescriptorPrefix; - private CardPayments(DeclineOn declineOn, String statementDescriptorPrefix) { + private CardPayments( + DeclineOn declineOn, Map extraParams, String statementDescriptorPrefix) { this.declineOn = declineOn; + this.extraParams = extraParams; this.statementDescriptorPrefix = statementDescriptorPrefix; } @@ -2055,11 +2693,13 @@ public static Builder builder() { public static class Builder { private DeclineOn declineOn; + private Map extraParams; + private String statementDescriptorPrefix; /** Finalize and obtain parameter instance from this builder. */ public CardPayments build() { - return new CardPayments(this.declineOn, this.statementDescriptorPrefix); + return new CardPayments(this.declineOn, this.extraParams, this.statementDescriptorPrefix); } /** @@ -2071,6 +2711,34 @@ public Builder setDeclineOn(DeclineOn declineOn) { 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 AccountUpdateParams.Settings.CardPayments#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 AccountUpdateParams.Settings.CardPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2099,9 +2767,20 @@ public static class DeclineOn { @SerializedName("cvc_failure") Boolean cvcFailure; - private DeclineOn(Boolean avsFailure, Boolean cvcFailure) { + /** + * 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 DeclineOn(Boolean avsFailure, Boolean cvcFailure, Map extraParams) { this.avsFailure = avsFailure; this.cvcFailure = cvcFailure; + this.extraParams = extraParams; } public static Builder builder() { @@ -2113,9 +2792,11 @@ public static class Builder { private Boolean cvcFailure; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public DeclineOn build() { - return new DeclineOn(this.avsFailure, this.cvcFailure); + return new DeclineOn(this.avsFailure, this.cvcFailure, this.extraParams); } /** @@ -2136,11 +2817,48 @@ public Builder setCvcFailure(Boolean cvcFailure) { this.cvcFailure = cvcFailure; 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 AccountUpdateParams.Settings.CardPayments.DeclineOn#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 AccountUpdateParams.Settings.CardPayments.DeclineOn#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } public static class Payments { + /** + * 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; + /** * The default text that appears on credit card statements when a charge is made. This field * prefixes any dynamic `statement_descriptor` specified on the charge. @@ -2148,7 +2866,8 @@ public static class Payments { @SerializedName("statement_descriptor") String statementDescriptor; - private Payments(String statementDescriptor) { + private Payments(Map extraParams, String statementDescriptor) { + this.extraParams = extraParams; this.statementDescriptor = statementDescriptor; } @@ -2157,11 +2876,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ public Payments build() { - return new Payments(this.statementDescriptor); + return new Payments(this.extraParams, this.statementDescriptor); + } + + /** + * 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 AccountUpdateParams.Settings.Payments#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 AccountUpdateParams.Settings.Payments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -2184,6 +2933,15 @@ public static class Payouts { @SerializedName("debit_negative_balances") Boolean debitNegativeBalances; + /** + * 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; + /** * Details on when funds from charges are available, and when they are paid out to an external * account. For details, see our [Setting Bank and Debit Card @@ -2200,8 +2958,12 @@ public static class Payouts { String statementDescriptor; private Payouts( - Boolean debitNegativeBalances, Schedule schedule, String statementDescriptor) { + Boolean debitNegativeBalances, + Map extraParams, + Schedule schedule, + String statementDescriptor) { this.debitNegativeBalances = debitNegativeBalances; + this.extraParams = extraParams; this.schedule = schedule; this.statementDescriptor = statementDescriptor; } @@ -2213,13 +2975,19 @@ public static Builder builder() { public static class Builder { private Boolean debitNegativeBalances; + private Map extraParams; + private Schedule schedule; private String statementDescriptor; /** Finalize and obtain parameter instance from this builder. */ public Payouts build() { - return new Payouts(this.debitNegativeBalances, this.schedule, this.statementDescriptor); + return new Payouts( + this.debitNegativeBalances, + this.extraParams, + this.schedule, + this.statementDescriptor); } /** @@ -2232,6 +3000,34 @@ public Builder setDebitNegativeBalances(Boolean debitNegativeBalances) { 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 AccountUpdateParams.Settings.Payouts#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 AccountUpdateParams.Settings.Payouts#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Details on when funds from charges are available, and when they are paid out to an * external account. For details, see our [Setting Bank and Debit Card @@ -2262,6 +3058,16 @@ public static class Schedule { @SerializedName("delay_days") Object delayDays; + /** + * 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; + /** * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or * `monthly`. Default is `daily`. @@ -2284,8 +3090,13 @@ public static class Schedule { WeeklyAnchor weeklyAnchor; private Schedule( - Object delayDays, Interval interval, Long monthlyAnchor, WeeklyAnchor weeklyAnchor) { + Object delayDays, + Map extraParams, + Interval interval, + Long monthlyAnchor, + WeeklyAnchor weeklyAnchor) { this.delayDays = delayDays; + this.extraParams = extraParams; this.interval = interval; this.monthlyAnchor = monthlyAnchor; this.weeklyAnchor = weeklyAnchor; @@ -2298,6 +3109,8 @@ public static Builder builder() { public static class Builder { private Object delayDays; + private Map extraParams; + private Interval interval; private Long monthlyAnchor; @@ -2307,7 +3120,11 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Schedule build() { return new Schedule( - this.delayDays, this.interval, this.monthlyAnchor, this.weeklyAnchor); + this.delayDays, + this.extraParams, + this.interval, + this.monthlyAnchor, + this.weeklyAnchor); } /** @@ -2330,6 +3147,34 @@ public Builder setDelayDays(Long delayDays) { 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 AccountUpdateParams.Settings.Payouts.Schedule#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 AccountUpdateParams.Settings.Payouts.Schedule#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or * `monthly`. Default is `daily`. @@ -2432,6 +3277,15 @@ public static class TosAcceptance { @SerializedName("date") Long date; + /** + * 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; + /** * The IP address from which the account representative accepted the Stripe Services Agreement. */ @@ -2445,8 +3299,9 @@ public static class TosAcceptance { @SerializedName("user_agent") String userAgent; - private TosAcceptance(Long date, String ip, String userAgent) { + private TosAcceptance(Long date, Map extraParams, String ip, String userAgent) { this.date = date; + this.extraParams = extraParams; this.ip = ip; this.userAgent = userAgent; } @@ -2458,13 +3313,15 @@ public static Builder builder() { public static class Builder { private Long date; + private Map extraParams; + private String ip; private String userAgent; /** Finalize and obtain parameter instance from this builder. */ public TosAcceptance build() { - return new TosAcceptance(this.date, this.ip, this.userAgent); + return new TosAcceptance(this.date, this.extraParams, this.ip, this.userAgent); } /** @@ -2476,6 +3333,32 @@ public Builder setDate(Long date) { 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 + * AccountUpdateParams.TosAcceptance#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 AccountUpdateParams.TosAcceptance#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The IP address from which the account representative accepted the Stripe Services * Agreement. @@ -2503,6 +3386,9 @@ public enum RequestedCapability implements ApiRequestParams.EnumParam { @SerializedName("card_payments") CARD_PAYMENTS("card_payments"), + @SerializedName("legacy_payments") + LEGACY_PAYMENTS("legacy_payments"), + @SerializedName("platform_payments") PLATFORM_PAYMENTS("platform_payments"); diff --git a/src/main/java/com/stripe/param/ApplePayDomainCreateParams.java b/src/main/java/com/stripe/param/ApplePayDomainCreateParams.java index 3b3e794df91..d8cfa9a146b 100644 --- a/src/main/java/com/stripe/param/ApplePayDomainCreateParams.java +++ b/src/main/java/com/stripe/param/ApplePayDomainCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ApplePayDomainCreateParams extends ApiRequestParams { @SerializedName("domain_name") @@ -15,9 +17,20 @@ public class ApplePayDomainCreateParams extends ApiRequestParams { @SerializedName("expand") List expand; - private ApplePayDomainCreateParams(String domainName, 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; + + private ApplePayDomainCreateParams( + String domainName, List expand, Map extraParams) { this.domainName = domainName; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -29,9 +42,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ApplePayDomainCreateParams build() { - return new ApplePayDomainCreateParams(this.domainName, this.expand); + return new ApplePayDomainCreateParams(this.domainName, this.expand, this.extraParams); } public Builder setDomainName(String domainName) { @@ -64,5 +79,31 @@ public Builder addAllExpand(List elements) { 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 + * ApplePayDomainCreateParams#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 ApplePayDomainCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ApplePayDomainListParams.java b/src/main/java/com/stripe/param/ApplePayDomainListParams.java index bb0cf94d47f..48a7588ffa7 100644 --- a/src/main/java/com/stripe/param/ApplePayDomainListParams.java +++ b/src/main/java/com/stripe/param/ApplePayDomainListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ApplePayDomainListParams extends ApiRequestParams { @SerializedName("domain_name") @@ -24,6 +26,15 @@ public class ApplePayDomainListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -44,11 +55,13 @@ private ApplePayDomainListParams( String domainName, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.domainName = domainName; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -64,6 +77,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -71,7 +86,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ApplePayDomainListParams build() { return new ApplePayDomainListParams( - this.domainName, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.domainName, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setDomainName(String domainName) { @@ -116,6 +136,32 @@ public Builder addAllExpand(List 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 + * ApplePayDomainListParams#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 ApplePayDomainListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/ApplePayDomainRetrieveParams.java b/src/main/java/com/stripe/param/ApplePayDomainRetrieveParams.java index 789b68f1880..2051f923999 100644 --- a/src/main/java/com/stripe/param/ApplePayDomainRetrieveParams.java +++ b/src/main/java/com/stripe/param/ApplePayDomainRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ApplePayDomainRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ApplePayDomainRetrieveParams(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; + + private ApplePayDomainRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ApplePayDomainRetrieveParams build() { - return new ApplePayDomainRetrieveParams(this.expand); + return new ApplePayDomainRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ApplePayDomainRetrieveParams#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 ApplePayDomainRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ApplicationFeeListParams.java b/src/main/java/com/stripe/param/ApplicationFeeListParams.java index c0f79716f54..d997ce60e1d 100644 --- a/src/main/java/com/stripe/param/ApplicationFeeListParams.java +++ b/src/main/java/com/stripe/param/ApplicationFeeListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ApplicationFeeListParams extends ApiRequestParams { /** Only return application fees for the charge specified by this charge ID. */ @@ -28,6 +30,15 @@ public class ApplicationFeeListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -49,12 +60,14 @@ private ApplicationFeeListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.charge = charge; this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -72,6 +85,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -83,6 +98,7 @@ public ApplicationFeeListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -140,6 +156,32 @@ public Builder addAllExpand(List 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 + * ApplicationFeeListParams#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 ApplicationFeeListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -162,6 +204,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -178,7 +229,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -190,6 +242,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -200,7 +254,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ApplicationFeeListParams.Created#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 ApplicationFeeListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/ApplicationFeeRetrieveParams.java b/src/main/java/com/stripe/param/ApplicationFeeRetrieveParams.java index e55b87320de..126e3ff8797 100644 --- a/src/main/java/com/stripe/param/ApplicationFeeRetrieveParams.java +++ b/src/main/java/com/stripe/param/ApplicationFeeRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ApplicationFeeRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ApplicationFeeRetrieveParams(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; + + private ApplicationFeeRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ApplicationFeeRetrieveParams build() { - return new ApplicationFeeRetrieveParams(this.expand); + return new ApplicationFeeRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ApplicationFeeRetrieveParams#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 ApplicationFeeRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/BalanceRetrieveParams.java b/src/main/java/com/stripe/param/BalanceRetrieveParams.java index 04bed51d2c9..073020028e8 100644 --- a/src/main/java/com/stripe/param/BalanceRetrieveParams.java +++ b/src/main/java/com/stripe/param/BalanceRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BalanceRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private BalanceRetrieveParams(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; + + private BalanceRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public BalanceRetrieveParams build() { - return new BalanceRetrieveParams(this.expand); + return new BalanceRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * BalanceRetrieveParams#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 BalanceRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/BalanceTransactionListParams.java b/src/main/java/com/stripe/param/BalanceTransactionListParams.java index b4a34be6bf1..33540425273 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionListParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BalanceTransactionListParams extends ApiRequestParams { @SerializedName("available_on") @@ -30,6 +32,15 @@ public class BalanceTransactionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -71,6 +82,7 @@ private BalanceTransactionListParams( String currency, String endingBefore, List expand, + Map extraParams, Long limit, String payout, String source, @@ -81,6 +93,7 @@ private BalanceTransactionListParams( this.currency = currency; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.payout = payout; this.source = source; @@ -103,6 +116,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String payout; @@ -121,6 +136,7 @@ public BalanceTransactionListParams build() { this.currency, this.endingBefore, this.expand, + this.extraParams, this.limit, this.payout, this.source, @@ -190,6 +206,32 @@ public Builder addAllExpand(List 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 + * BalanceTransactionListParams#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 BalanceTransactionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -237,6 +279,15 @@ public Builder setType(String type) { } public static class AvailableOn { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -253,7 +304,8 @@ public static class AvailableOn { @SerializedName("lte") Long lte; - private AvailableOn(Long gt, Long gte, Long lt, Long lte) { + private AvailableOn(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -265,6 +317,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -275,7 +329,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public AvailableOn build() { - return new AvailableOn(this.gt, this.gte, this.lt, this.lte); + return new AvailableOn(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * BalanceTransactionListParams.AvailableOn#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 BalanceTransactionListParams.AvailableOn#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -305,6 +386,15 @@ public Builder setLte(Long lte) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -321,7 +411,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -333,6 +424,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -343,7 +436,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * BalanceTransactionListParams.Created#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 BalanceTransactionListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/BalanceTransactionRetrieveParams.java b/src/main/java/com/stripe/param/BalanceTransactionRetrieveParams.java index 0af98c3c15b..58682d5a98e 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionRetrieveParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BalanceTransactionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private BalanceTransactionRetrieveParams(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; + + private BalanceTransactionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public BalanceTransactionRetrieveParams build() { - return new BalanceTransactionRetrieveParams(this.expand); + return new BalanceTransactionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * BalanceTransactionRetrieveParams#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 BalanceTransactionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/BankAccountUpdateOnAccountParams.java b/src/main/java/com/stripe/param/BankAccountUpdateOnAccountParams.java index 73e4b804f44..9f3d035261d 100644 --- a/src/main/java/com/stripe/param/BankAccountUpdateOnAccountParams.java +++ b/src/main/java/com/stripe/param/BankAccountUpdateOnAccountParams.java @@ -28,6 +28,15 @@ public class BankAccountUpdateOnAccountParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -36,11 +45,13 @@ private BankAccountUpdateOnAccountParams( ApiRequestParams.EnumParam accountHolderType, Boolean defaultForCurrency, List expand, + Map extraParams, Map metadata) { this.accountHolderName = accountHolderName; this.accountHolderType = accountHolderType; this.defaultForCurrency = defaultForCurrency; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -57,6 +68,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ @@ -66,6 +79,7 @@ public BankAccountUpdateOnAccountParams build() { this.accountHolderType, this.defaultForCurrency, this.expand, + this.extraParams, this.metadata); } @@ -119,6 +133,32 @@ public Builder addAllExpand(List 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 + * BankAccountUpdateOnAccountParams#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 BankAccountUpdateOnAccountParams#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 diff --git a/src/main/java/com/stripe/param/BankAccountUpdateOnCustomerParams.java b/src/main/java/com/stripe/param/BankAccountUpdateOnCustomerParams.java index 3700aaaa354..c80bb79f8ad 100644 --- a/src/main/java/com/stripe/param/BankAccountUpdateOnCustomerParams.java +++ b/src/main/java/com/stripe/param/BankAccountUpdateOnCustomerParams.java @@ -23,6 +23,15 @@ public class BankAccountUpdateOnCustomerParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -30,10 +39,12 @@ private BankAccountUpdateOnCustomerParams( String accountHolderName, AccountHolderType accountHolderType, List expand, + Map extraParams, Map metadata) { this.accountHolderName = accountHolderName; this.accountHolderType = accountHolderType; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -48,12 +59,18 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public BankAccountUpdateOnCustomerParams build() { return new BankAccountUpdateOnCustomerParams( - this.accountHolderName, this.accountHolderType, this.expand, this.metadata); + this.accountHolderName, + this.accountHolderType, + this.expand, + this.extraParams, + this.metadata); } /** The name of the person or business that owns the bank account. */ @@ -94,6 +111,32 @@ public Builder addAllExpand(List 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 + * BankAccountUpdateOnCustomerParams#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 BankAccountUpdateOnCustomerParams#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 diff --git a/src/main/java/com/stripe/param/BankAccountVerifyParams.java b/src/main/java/com/stripe/param/BankAccountVerifyParams.java index 949b3c8719a..fab6e7b7602 100644 --- a/src/main/java/com/stripe/param/BankAccountVerifyParams.java +++ b/src/main/java/com/stripe/param/BankAccountVerifyParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BankAccountVerifyParams extends ApiRequestParams { /** @@ -19,9 +21,20 @@ public class BankAccountVerifyParams extends ApiRequestParams { @SerializedName("expand") List expand; - private BankAccountVerifyParams(List amounts, 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; + + private BankAccountVerifyParams( + List amounts, List expand, Map extraParams) { this.amounts = amounts; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -33,9 +46,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public BankAccountVerifyParams build() { - return new BankAccountVerifyParams(this.amounts, this.expand); + return new BankAccountVerifyParams(this.amounts, this.expand, this.extraParams); } /** @@ -89,5 +104,31 @@ public Builder addAllExpand(List elements) { 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 + * BankAccountVerifyParams#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 BankAccountVerifyParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/BitcoinReceiverListParams.java b/src/main/java/com/stripe/param/BitcoinReceiverListParams.java index 8198a27516a..6030bf175b0 100644 --- a/src/main/java/com/stripe/param/BitcoinReceiverListParams.java +++ b/src/main/java/com/stripe/param/BitcoinReceiverListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BitcoinReceiverListParams extends ApiRequestParams { /** Filter for active receivers. */ @@ -25,6 +27,15 @@ public class BitcoinReceiverListParams extends ApiRequestParams { @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; + /** Filter for filled receivers. */ @SerializedName("filled") Boolean filled; @@ -53,6 +64,7 @@ private BitcoinReceiverListParams( Boolean active, String endingBefore, List expand, + Map extraParams, Boolean filled, Long limit, String startingAfter, @@ -60,6 +72,7 @@ private BitcoinReceiverListParams( this.active = active; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.filled = filled; this.limit = limit; this.startingAfter = startingAfter; @@ -77,6 +90,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean filled; private Long limit; @@ -91,6 +106,7 @@ public BitcoinReceiverListParams build() { this.active, this.endingBefore, this.expand, + this.extraParams, this.filled, this.limit, this.startingAfter, @@ -140,6 +156,32 @@ public Builder addAllExpand(List 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 + * BitcoinReceiverListParams#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 BitcoinReceiverListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Filter for filled receivers. */ public Builder setFilled(Boolean filled) { this.filled = filled; diff --git a/src/main/java/com/stripe/param/BitcoinReceiverRetrieveParams.java b/src/main/java/com/stripe/param/BitcoinReceiverRetrieveParams.java index d32927958d6..f0013e71d41 100644 --- a/src/main/java/com/stripe/param/BitcoinReceiverRetrieveParams.java +++ b/src/main/java/com/stripe/param/BitcoinReceiverRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BitcoinReceiverRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private BitcoinReceiverRetrieveParams(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; + + private BitcoinReceiverRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public BitcoinReceiverRetrieveParams build() { - return new BitcoinReceiverRetrieveParams(this.expand); + return new BitcoinReceiverRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * BitcoinReceiverRetrieveParams#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 BitcoinReceiverRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/BitcoinTransactionCollectionListParams.java b/src/main/java/com/stripe/param/BitcoinTransactionCollectionListParams.java index 049942d7e76..bc3ca67c147 100644 --- a/src/main/java/com/stripe/param/BitcoinTransactionCollectionListParams.java +++ b/src/main/java/com/stripe/param/BitcoinTransactionCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class BitcoinTransactionCollectionListParams extends ApiRequestParams { /** Only return transactions for the customer specified by this customer ID. */ @@ -25,6 +27,15 @@ public class BitcoinTransactionCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -42,10 +53,16 @@ public class BitcoinTransactionCollectionListParams extends ApiRequestParams { String startingAfter; private BitcoinTransactionCollectionListParams( - String customer, String endingBefore, List expand, Long limit, String startingAfter) { + String customer, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -61,6 +78,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -68,7 +87,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public BitcoinTransactionCollectionListParams build() { return new BitcoinTransactionCollectionListParams( - this.customer, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.customer, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } /** Only return transactions for the customer specified by this customer ID. */ @@ -114,6 +138,32 @@ public Builder addAllExpand(List 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 + * BitcoinTransactionCollectionListParams#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 BitcoinTransactionCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/CardUpdateOnAccountParams.java b/src/main/java/com/stripe/param/CardUpdateOnAccountParams.java index 8054816fa59..d7d85201439 100644 --- a/src/main/java/com/stripe/param/CardUpdateOnAccountParams.java +++ b/src/main/java/com/stripe/param/CardUpdateOnAccountParams.java @@ -50,6 +50,15 @@ public class CardUpdateOnAccountParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -68,6 +77,7 @@ private CardUpdateOnAccountParams( String expMonth, String expYear, List expand, + Map extraParams, Map metadata, String name) { this.addressCity = addressCity; @@ -80,6 +90,7 @@ private CardUpdateOnAccountParams( this.expMonth = expMonth; this.expYear = expYear; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; } @@ -109,6 +120,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; @@ -126,6 +139,7 @@ public CardUpdateOnAccountParams build() { this.expMonth, this.expYear, this.expand, + this.extraParams, this.metadata, this.name); } @@ -210,6 +224,32 @@ public Builder addAllExpand(List 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 + * CardUpdateOnAccountParams#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 CardUpdateOnAccountParams#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 diff --git a/src/main/java/com/stripe/param/CardUpdateOnCustomerParams.java b/src/main/java/com/stripe/param/CardUpdateOnCustomerParams.java index eebb369bd53..3b70c6fd364 100644 --- a/src/main/java/com/stripe/param/CardUpdateOnCustomerParams.java +++ b/src/main/java/com/stripe/param/CardUpdateOnCustomerParams.java @@ -46,6 +46,15 @@ public class CardUpdateOnCustomerParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -63,6 +72,7 @@ private CardUpdateOnCustomerParams( String expMonth, String expYear, List expand, + Map extraParams, Map metadata, String name) { this.addressCity = addressCity; @@ -74,6 +84,7 @@ private CardUpdateOnCustomerParams( this.expMonth = expMonth; this.expYear = expYear; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; } @@ -101,6 +112,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; @@ -117,6 +130,7 @@ public CardUpdateOnCustomerParams build() { this.expMonth, this.expYear, this.expand, + this.extraParams, this.metadata, this.name); } @@ -195,6 +209,32 @@ public Builder addAllExpand(List 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 + * CardUpdateOnCustomerParams#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 CardUpdateOnCustomerParams#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 diff --git a/src/main/java/com/stripe/param/ChargeCaptureParams.java b/src/main/java/com/stripe/param/ChargeCaptureParams.java index 301c9d9c5c2..1019d122b3e 100644 --- a/src/main/java/com/stripe/param/ChargeCaptureParams.java +++ b/src/main/java/com/stripe/param/ChargeCaptureParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ChargeCaptureParams extends ApiRequestParams { /** @@ -30,6 +32,15 @@ public class ChargeCaptureParams extends ApiRequestParams { @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; + /** * The email address to send this charge's receipt to. This will override the previously-specified * email address for this charge, if one was set. Receipts will not be sent in test mode. @@ -75,6 +86,7 @@ private ChargeCaptureParams( Long applicationFee, Long applicationFeeAmount, List expand, + Map extraParams, String receiptEmail, String statementDescriptor, TransferData transferData, @@ -83,6 +95,7 @@ private ChargeCaptureParams( this.applicationFee = applicationFee; this.applicationFeeAmount = applicationFeeAmount; this.expand = expand; + this.extraParams = extraParams; this.receiptEmail = receiptEmail; this.statementDescriptor = statementDescriptor; this.transferData = transferData; @@ -102,6 +115,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String receiptEmail; private String statementDescriptor; @@ -117,6 +132,7 @@ public ChargeCaptureParams build() { this.applicationFee, this.applicationFeeAmount, this.expand, + this.extraParams, this.receiptEmail, this.statementDescriptor, this.transferData, @@ -173,6 +189,32 @@ public Builder addAllExpand(List 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 + * ChargeCaptureParams#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 ChargeCaptureParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The email address to send this charge's receipt to. This will override the * previously-specified email address for this charge, if one was set. Receipts will not be sent @@ -231,8 +273,18 @@ public static class TransferData { @SerializedName("amount") Long amount; - private TransferData(Long amount) { + /** + * 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 TransferData(Long amount, Map extraParams) { this.amount = amount; + this.extraParams = extraParams; } public static Builder builder() { @@ -242,9 +294,11 @@ public static Builder builder() { public static class Builder { private Long amount; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.amount); + return new TransferData(this.amount, this.extraParams); } /** @@ -255,6 +309,32 @@ public Builder setAmount(Long amount) { this.amount = amount; 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 + * ChargeCaptureParams.TransferData#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 ChargeCaptureParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } diff --git a/src/main/java/com/stripe/param/ChargeCreateParams.java b/src/main/java/com/stripe/param/ChargeCreateParams.java index 2757911f638..1131b287938 100644 --- a/src/main/java/com/stripe/param/ChargeCreateParams.java +++ b/src/main/java/com/stripe/param/ChargeCreateParams.java @@ -68,6 +68,15 @@ public class ChargeCreateParams extends ApiRequestParams { @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. @@ -154,6 +163,7 @@ private ChargeCreateParams( String description, Destination destination, List expand, + Map extraParams, Map metadata, String onBehalfOf, String receiptEmail, @@ -171,6 +181,7 @@ private ChargeCreateParams( this.description = description; this.destination = destination; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.receiptEmail = receiptEmail; @@ -204,6 +215,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String onBehalfOf; @@ -232,6 +245,7 @@ public ChargeCreateParams build() { this.description, this.destination, this.expand, + this.extraParams, this.metadata, this.onBehalfOf, this.receiptEmail, @@ -339,6 +353,32 @@ public Builder addAllExpand(List 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 + * ChargeCreateParams#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 ChargeCreateParams#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 @@ -462,9 +502,19 @@ public static class Destination { @SerializedName("amount") Long amount; - private Destination(String account, Long amount) { + /** + * 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 Destination(String account, Long amount, Map extraParams) { this.account = account; this.amount = amount; + this.extraParams = extraParams; } public static Builder builder() { @@ -476,9 +526,11 @@ public static class Builder { private Long amount; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Destination build() { - return new Destination(this.account, this.amount); + return new Destination(this.account, this.amount, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -496,6 +548,32 @@ public Builder setAmount(Long amount) { this.amount = amount; 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 + * ChargeCreateParams.Destination#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 ChargeCreateParams.Destination#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } @@ -508,6 +586,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -524,9 +611,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -541,6 +634,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -549,7 +644,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.carrier, this.name, this.phone, this.trackingNumber); + return new Shipping( + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -564,6 +665,32 @@ public Builder setCarrier(String carrier) { 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 + * ChargeCreateParams.Shipping#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 ChargeCreateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -593,6 +720,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -608,12 +744,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -629,6 +767,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -640,7 +780,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -653,6 +799,34 @@ public Builder setCountry(String 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 ChargeCreateParams.Shipping.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 ChargeCreateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -688,9 +862,19 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(Long amount, String destination) { + /** + * 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 TransferData(Long amount, String destination, Map extraParams) { this.amount = amount; this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -702,9 +886,11 @@ public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.amount, this.destination); + return new TransferData(this.amount, this.destination, this.extraParams); } /** @@ -721,6 +907,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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 + * ChargeCreateParams.TransferData#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 ChargeCreateParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } diff --git a/src/main/java/com/stripe/param/ChargeListParams.java b/src/main/java/com/stripe/param/ChargeListParams.java index e7eb93578ca..5a6f26bdabd 100644 --- a/src/main/java/com/stripe/param/ChargeListParams.java +++ b/src/main/java/com/stripe/param/ChargeListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ChargeListParams extends ApiRequestParams { @SerializedName("created") @@ -28,6 +30,15 @@ public class ChargeListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -35,6 +46,12 @@ public class ChargeListParams extends ApiRequestParams { @SerializedName("limit") Long limit; + /** + * Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + */ + @SerializedName("payment_intent") + String paymentIntent; + /** * A cursor for use in pagination. `starting_after` is an object ID that defines your place in the * list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, @@ -53,14 +70,18 @@ private ChargeListParams( String customer, String endingBefore, List expand, + Map extraParams, Long limit, + String paymentIntent, String startingAfter, String transferGroup) { this.created = created; this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; + this.paymentIntent = paymentIntent; this.startingAfter = startingAfter; this.transferGroup = transferGroup; } @@ -78,8 +99,12 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; + private String paymentIntent; + private String startingAfter; private String transferGroup; @@ -91,7 +116,9 @@ public ChargeListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.limit, + this.paymentIntent, this.startingAfter, this.transferGroup); } @@ -149,6 +176,32 @@ public Builder addAllExpand(List 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 + * ChargeListParams#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 ChargeListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -158,6 +211,15 @@ public Builder setLimit(Long limit) { return this; } + /** + * Only return charges that were created by the PaymentIntent specified by this PaymentIntent + * ID. + */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + /** * A cursor for use in pagination. `starting_after` is an object ID that defines your place in * the list. For instance, if you make a list request and receive 100 objects, ending with @@ -177,6 +239,15 @@ public Builder setTransferGroup(String transferGroup) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -193,7 +264,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -205,6 +277,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -215,7 +289,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ChargeListParams.Created#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 ChargeListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/ChargeRetrieveParams.java b/src/main/java/com/stripe/param/ChargeRetrieveParams.java index 58b2cbf98fb..6303033b709 100644 --- a/src/main/java/com/stripe/param/ChargeRetrieveParams.java +++ b/src/main/java/com/stripe/param/ChargeRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ChargeRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ChargeRetrieveParams(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; + + private ChargeRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ChargeRetrieveParams build() { - return new ChargeRetrieveParams(this.expand); + return new ChargeRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ChargeRetrieveParams#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 ChargeRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ChargeUpdateParams.java b/src/main/java/com/stripe/param/ChargeUpdateParams.java index fb7d82846cf..1649857dce3 100644 --- a/src/main/java/com/stripe/param/ChargeUpdateParams.java +++ b/src/main/java/com/stripe/param/ChargeUpdateParams.java @@ -32,6 +32,15 @@ public class ChargeUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs you can attach to a charge giving information about its riskiness. If * you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. @@ -73,6 +82,7 @@ private ChargeUpdateParams( String customer, String description, List expand, + Map extraParams, FraudDetails fraudDetails, Map metadata, String receiptEmail, @@ -81,6 +91,7 @@ private ChargeUpdateParams( this.customer = customer; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.fraudDetails = fraudDetails; this.metadata = metadata; this.receiptEmail = receiptEmail; @@ -99,6 +110,8 @@ public static class Builder { private List expand; + private Map extraParams; + private FraudDetails fraudDetails; private Map metadata; @@ -115,6 +128,7 @@ public ChargeUpdateParams build() { this.customer, this.description, this.expand, + this.extraParams, this.fraudDetails, this.metadata, this.receiptEmail, @@ -168,6 +182,32 @@ public Builder addAllExpand(List 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 + * ChargeUpdateParams#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 ChargeUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A set of key-value pairs you can attach to a charge giving information about its riskiness. * If you believe a charge is fraudulent, include a `user_report` key with a value of @@ -233,10 +273,20 @@ public Builder setTransferGroup(String transferGroup) { } public static class FraudDetails { + /** + * 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; + @SerializedName("user_report") ApiRequestParams.EnumParam userReport; - private FraudDetails(ApiRequestParams.EnumParam userReport) { + private FraudDetails(Map extraParams, ApiRequestParams.EnumParam userReport) { + this.extraParams = extraParams; this.userReport = userReport; } @@ -245,11 +295,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private ApiRequestParams.EnumParam userReport; /** Finalize and obtain parameter instance from this builder. */ public FraudDetails build() { - return new FraudDetails(this.userReport); + return new FraudDetails(this.extraParams, this.userReport); + } + + /** + * 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 + * ChargeUpdateParams.FraudDetails#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 ChargeUpdateParams.FraudDetails#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } public Builder setUserReport(UserReport userReport) { @@ -288,6 +366,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -304,9 +391,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -321,6 +414,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -329,7 +424,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.carrier, this.name, this.phone, this.trackingNumber); + return new Shipping( + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -344,6 +445,32 @@ public Builder setCarrier(String carrier) { 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 + * ChargeUpdateParams.Shipping#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 ChargeUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -373,6 +500,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -388,12 +524,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -409,6 +547,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -420,7 +560,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -433,6 +579,34 @@ public Builder setCountry(String 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 ChargeUpdateParams.Shipping.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 ChargeUpdateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/CountrySpecListParams.java b/src/main/java/com/stripe/param/CountrySpecListParams.java index ba46a797c4f..a665cfdf6cb 100644 --- a/src/main/java/com/stripe/param/CountrySpecListParams.java +++ b/src/main/java/com/stripe/param/CountrySpecListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CountrySpecListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class CountrySpecListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class CountrySpecListParams extends ApiRequestParams { String startingAfter; private CountrySpecListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CountrySpecListParams build() { return new CountrySpecListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * CountrySpecListParams#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 CountrySpecListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/CountrySpecRetrieveParams.java b/src/main/java/com/stripe/param/CountrySpecRetrieveParams.java index cc235b1891d..cc35b6d0805 100644 --- a/src/main/java/com/stripe/param/CountrySpecRetrieveParams.java +++ b/src/main/java/com/stripe/param/CountrySpecRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CountrySpecRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CountrySpecRetrieveParams(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; + + private CountrySpecRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CountrySpecRetrieveParams build() { - return new CountrySpecRetrieveParams(this.expand); + return new CountrySpecRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CountrySpecRetrieveParams#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 CountrySpecRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index cdc47fb86d0..c5db64bc05d 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -43,6 +43,15 @@ public class CouponCreateParams extends ApiRequestParams { @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; + /** * Unique string of your choice that will be used to identify this coupon when applying it to a * customer. This is often a specific code you'll give to your customer to use when signing up @@ -94,6 +103,7 @@ private CouponCreateParams( Duration duration, Long durationInMonths, List expand, + Map extraParams, String id, Long maxRedemptions, Map metadata, @@ -105,6 +115,7 @@ private CouponCreateParams( this.duration = duration; this.durationInMonths = durationInMonths; this.expand = expand; + this.extraParams = extraParams; this.id = id; this.maxRedemptions = maxRedemptions; this.metadata = metadata; @@ -128,6 +139,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String id; private Long maxRedemptions; @@ -148,6 +161,7 @@ public CouponCreateParams build() { this.duration, this.durationInMonths, this.expand, + this.extraParams, this.id, this.maxRedemptions, this.metadata, @@ -217,6 +231,32 @@ public Builder addAllExpand(List 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 + * CouponCreateParams#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 CouponCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Unique string of your choice that will be used to identify this coupon when applying it to a * customer. This is often a specific code you'll give to your customer to use when signing up diff --git a/src/main/java/com/stripe/param/CouponListParams.java b/src/main/java/com/stripe/param/CouponListParams.java index 93a1a008fbc..74cff1997f5 100644 --- a/src/main/java/com/stripe/param/CouponListParams.java +++ b/src/main/java/com/stripe/param/CouponListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CouponListParams extends ApiRequestParams { /** @@ -28,6 +30,15 @@ public class CouponListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -45,10 +56,16 @@ public class CouponListParams extends ApiRequestParams { String startingAfter; private CouponListParams( - Object created, String endingBefore, List expand, Long limit, String startingAfter) { + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -64,6 +81,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -71,7 +90,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CouponListParams build() { return new CouponListParams( - this.created, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } /** @@ -129,6 +153,32 @@ public Builder addAllExpand(List 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 + * CouponListParams#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 CouponListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -151,6 +201,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -167,7 +226,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -179,6 +239,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -189,7 +251,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * CouponListParams.Created#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 CouponListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/CouponRetrieveParams.java b/src/main/java/com/stripe/param/CouponRetrieveParams.java index 34d188bc62d..9c92adc8b27 100644 --- a/src/main/java/com/stripe/param/CouponRetrieveParams.java +++ b/src/main/java/com/stripe/param/CouponRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CouponRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CouponRetrieveParams(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; + + private CouponRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CouponRetrieveParams build() { - return new CouponRetrieveParams(this.expand); + return new CouponRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CouponRetrieveParams#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 CouponRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/CouponUpdateParams.java b/src/main/java/com/stripe/param/CouponUpdateParams.java index 637ae651e3b..f28f476ab4e 100644 --- a/src/main/java/com/stripe/param/CouponUpdateParams.java +++ b/src/main/java/com/stripe/param/CouponUpdateParams.java @@ -14,6 +14,15 @@ public class CouponUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a coupon object. It can be useful for storing * additional information about the coupon in a structured format. @@ -28,8 +37,13 @@ public class CouponUpdateParams extends ApiRequestParams { @SerializedName("name") String name; - private CouponUpdateParams(List expand, Map metadata, String name) { + private CouponUpdateParams( + List expand, + Map extraParams, + Map metadata, + String name) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; } @@ -41,13 +55,15 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; /** Finalize and obtain parameter instance from this builder. */ public CouponUpdateParams build() { - return new CouponUpdateParams(this.expand, this.metadata, this.name); + return new CouponUpdateParams(this.expand, this.extraParams, this.metadata, this.name); } /** @@ -76,6 +92,32 @@ public Builder addAllExpand(List 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 + * CouponUpdateParams#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 CouponUpdateParams#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 diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index 920a5e27535..d272933a146 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -26,6 +26,15 @@ public class CreditNoteCreateParams extends ApiRequestParams { @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; + /** ID of the invoice. */ @SerializedName("invoice") String invoice; @@ -64,6 +73,7 @@ private CreditNoteCreateParams( Long amount, Long creditAmount, List expand, + Map extraParams, String invoice, String memo, Map metadata, @@ -73,6 +83,7 @@ private CreditNoteCreateParams( this.amount = amount; this.creditAmount = creditAmount; this.expand = expand; + this.extraParams = extraParams; this.invoice = invoice; this.memo = memo; this.metadata = metadata; @@ -92,6 +103,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoice; private String memo; @@ -110,6 +123,7 @@ public CreditNoteCreateParams build() { this.amount, this.creditAmount, this.expand, + this.extraParams, this.invoice, this.memo, this.metadata, @@ -159,6 +173,32 @@ public Builder addAllExpand(List 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 + * CreditNoteCreateParams#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 CreditNoteCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** ID of the invoice. */ public Builder setInvoice(String invoice) { this.invoice = invoice; diff --git a/src/main/java/com/stripe/param/CreditNoteListParams.java b/src/main/java/com/stripe/param/CreditNoteListParams.java index 0f7256e5dc8..a0365e52b41 100644 --- a/src/main/java/com/stripe/param/CreditNoteListParams.java +++ b/src/main/java/com/stripe/param/CreditNoteListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CreditNoteListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class CreditNoteListParams extends ApiRequestParams { @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; + /** ID of the invoice. */ @SerializedName("invoice") String invoice; @@ -42,9 +53,15 @@ public class CreditNoteListParams extends ApiRequestParams { String startingAfter; private CreditNoteListParams( - String endingBefore, List expand, String invoice, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + String invoice, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.invoice = invoice; this.limit = limit; this.startingAfter = startingAfter; @@ -59,6 +76,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoice; private Long limit; @@ -68,7 +87,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CreditNoteListParams build() { return new CreditNoteListParams( - this.endingBefore, this.expand, this.invoice, this.limit, this.startingAfter); + this.endingBefore, + this.expand, + this.extraParams, + this.invoice, + this.limit, + this.startingAfter); } /** @@ -108,6 +132,32 @@ public Builder addAllExpand(List 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 + * CreditNoteListParams#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 CreditNoteListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** ID of the invoice. */ public Builder setInvoice(String invoice) { this.invoice = invoice; diff --git a/src/main/java/com/stripe/param/CreditNoteRetrieveParams.java b/src/main/java/com/stripe/param/CreditNoteRetrieveParams.java index 5c664e9ad38..3e875c0a75c 100644 --- a/src/main/java/com/stripe/param/CreditNoteRetrieveParams.java +++ b/src/main/java/com/stripe/param/CreditNoteRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CreditNoteRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CreditNoteRetrieveParams(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; + + private CreditNoteRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CreditNoteRetrieveParams build() { - return new CreditNoteRetrieveParams(this.expand); + return new CreditNoteRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CreditNoteRetrieveParams#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 CreditNoteRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/CreditNoteUpdateParams.java b/src/main/java/com/stripe/param/CreditNoteUpdateParams.java index bfb0d9652da..a5ad2096e0e 100644 --- a/src/main/java/com/stripe/param/CreditNoteUpdateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteUpdateParams.java @@ -14,6 +14,15 @@ public class CreditNoteUpdateParams extends ApiRequestParams { @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; + /** Credit note memo. */ @SerializedName("memo") String memo; @@ -26,8 +35,13 @@ public class CreditNoteUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private CreditNoteUpdateParams(List expand, String memo, Map metadata) { + private CreditNoteUpdateParams( + List expand, + Map extraParams, + String memo, + Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.memo = memo; this.metadata = metadata; } @@ -39,13 +53,15 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String memo; private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public CreditNoteUpdateParams build() { - return new CreditNoteUpdateParams(this.expand, this.memo, this.metadata); + return new CreditNoteUpdateParams(this.expand, this.extraParams, this.memo, this.metadata); } /** @@ -74,6 +90,32 @@ public Builder addAllExpand(List 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 + * CreditNoteUpdateParams#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 CreditNoteUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Credit note memo. */ public Builder setMemo(String memo) { this.memo = memo; diff --git a/src/main/java/com/stripe/param/CreditNoteVoidCreditNoteParams.java b/src/main/java/com/stripe/param/CreditNoteVoidCreditNoteParams.java index f39935b5f13..4842e163cbd 100644 --- a/src/main/java/com/stripe/param/CreditNoteVoidCreditNoteParams.java +++ b/src/main/java/com/stripe/param/CreditNoteVoidCreditNoteParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CreditNoteVoidCreditNoteParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CreditNoteVoidCreditNoteParams(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; + + private CreditNoteVoidCreditNoteParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CreditNoteVoidCreditNoteParams build() { - return new CreditNoteVoidCreditNoteParams(this.expand); + return new CreditNoteVoidCreditNoteParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CreditNoteVoidCreditNoteParams#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 CreditNoteVoidCreditNoteParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index 3ff4b514d14..8b94e8763d1 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -45,6 +45,15 @@ public class CustomerCreateParams extends ApiRequestParams { @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; + /** * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase * letters or numbers. @@ -109,6 +118,7 @@ private CustomerCreateParams( String description, String email, List expand, + Map extraParams, String invoicePrefix, InvoiceSettings invoiceSettings, Map metadata, @@ -127,6 +137,7 @@ private CustomerCreateParams( this.description = description; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.invoicePrefix = invoicePrefix; this.invoiceSettings = invoiceSettings; this.metadata = metadata; @@ -158,6 +169,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoicePrefix; private InvoiceSettings invoiceSettings; @@ -191,6 +204,7 @@ public CustomerCreateParams build() { this.description, this.email, this.expand, + this.extraParams, this.invoicePrefix, this.invoiceSettings, this.metadata, @@ -276,6 +290,32 @@ public Builder addAllExpand(List 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 + * CustomerCreateParams#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 CustomerCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase * letters or numbers. @@ -434,6 +474,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -447,9 +496,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -465,6 +521,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -476,7 +534,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -489,6 +553,32 @@ public Builder setCountry(String 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 + * CustomerCreateParams.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 CustomerCreateParams.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -520,13 +610,27 @@ public static class InvoiceSettings { @SerializedName("default_payment_method") String defaultPaymentMethod; + /** + * 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; + /** Default footer to be displayed on invoices for this customer. */ @SerializedName("footer") String footer; - private InvoiceSettings(Object customFields, String defaultPaymentMethod, String footer) { + private InvoiceSettings( + Object customFields, + String defaultPaymentMethod, + Map extraParams, + String footer) { this.customFields = customFields; this.defaultPaymentMethod = defaultPaymentMethod; + this.extraParams = extraParams; this.footer = footer; } @@ -539,11 +643,14 @@ public static class Builder { private String defaultPaymentMethod; + private Map extraParams; + private String footer; /** Finalize and obtain parameter instance from this builder. */ public InvoiceSettings build() { - return new InvoiceSettings(this.customFields, this.defaultPaymentMethod, this.footer); + return new InvoiceSettings( + this.customFields, this.defaultPaymentMethod, this.extraParams, this.footer); } /** Default custom fields to be displayed on invoices for this customer. */ @@ -564,6 +671,32 @@ public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { 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 + * CustomerCreateParams.InvoiceSettings#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 CustomerCreateParams.InvoiceSettings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Default footer to be displayed on invoices for this customer. */ public Builder setFooter(String footer) { this.footer = footer; @@ -572,6 +705,15 @@ public Builder setFooter(String footer) { } public static class CustomField { + /** + * 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; + /** The name of the custom field. This may be up to 30 characters. */ @SerializedName("name") String name; @@ -580,7 +722,8 @@ public static class CustomField { @SerializedName("value") String value; - private CustomField(String name, String value) { + private CustomField(Map extraParams, String name, String value) { + this.extraParams = extraParams; this.name = name; this.value = value; } @@ -590,13 +733,43 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String name; private String value; /** Finalize and obtain parameter instance from this builder. */ public CustomField build() { - return new CustomField(this.name, this.value); + return new CustomField(this.extraParams, this.name, this.value); + } + + /** + * 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 CustomerCreateParams.InvoiceSettings.CustomField#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 CustomerCreateParams.InvoiceSettings.CustomField#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The name of the custom field. This may be up to 30 characters. */ @@ -619,6 +792,15 @@ public static class Shipping { @SerializedName("address") Address address; + /** + * 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; + /** Customer name. */ @SerializedName("name") String name; @@ -627,8 +809,9 @@ public static class Shipping { @SerializedName("phone") String phone; - private Shipping(Address address, String name, String phone) { + private Shipping(Address address, Map extraParams, String name, String phone) { this.address = address; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -640,13 +823,15 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.name, this.phone); + return new Shipping(this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ @@ -655,6 +840,32 @@ public Builder setAddress(Address address) { 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 + * CustomerCreateParams.Shipping#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 CustomerCreateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Customer name. */ public Builder setName(String name) { this.name = name; @@ -675,6 +886,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -690,12 +910,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -711,6 +933,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -722,7 +946,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -735,6 +965,34 @@ public Builder setCountry(String 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 CustomerCreateParams.Shipping.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 CustomerCreateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -759,6 +1017,15 @@ public Builder setState(String state) { } public static class TaxIdData { + /** + * 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; + /** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */ @SerializedName("type") Type type; @@ -767,7 +1034,8 @@ public static class TaxIdData { @SerializedName("value") String value; - private TaxIdData(Type type, String value) { + private TaxIdData(Map extraParams, Type type, String value) { + this.extraParams = extraParams; this.type = type; this.value = value; } @@ -777,13 +1045,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Type type; private String value; /** Finalize and obtain parameter instance from this builder. */ public TaxIdData build() { - return new TaxIdData(this.type, this.value); + return new TaxIdData(this.extraParams, this.type, this.value); + } + + /** + * 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 + * CustomerCreateParams.TaxIdData#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 CustomerCreateParams.TaxIdData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */ @@ -819,6 +1115,15 @@ public enum Type implements ApiRequestParams.EnumParam { } public static class TaxInfo { + /** + * 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; + /** The customer's tax ID number. */ @SerializedName("tax_id") String taxId; @@ -827,7 +1132,8 @@ public static class TaxInfo { @SerializedName("type") Type type; - private TaxInfo(String taxId, Type type) { + private TaxInfo(Map extraParams, String taxId, Type type) { + this.extraParams = extraParams; this.taxId = taxId; this.type = type; } @@ -837,13 +1143,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String taxId; private Type type; /** Finalize and obtain parameter instance from this builder. */ public TaxInfo build() { - return new TaxInfo(this.taxId, this.type); + return new TaxInfo(this.extraParams, this.taxId, this.type); + } + + /** + * 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 + * CustomerCreateParams.TaxInfo#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 CustomerCreateParams.TaxInfo#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The customer's tax ID number. */ diff --git a/src/main/java/com/stripe/param/CustomerListParams.java b/src/main/java/com/stripe/param/CustomerListParams.java index ab42f0f7729..31141608a9a 100644 --- a/src/main/java/com/stripe/param/CustomerListParams.java +++ b/src/main/java/com/stripe/param/CustomerListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CustomerListParams extends ApiRequestParams { @SerializedName("created") @@ -28,6 +30,15 @@ public class CustomerListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -49,12 +60,14 @@ private CustomerListParams( String email, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.created = created; this.email = email; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -72,6 +85,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -79,7 +94,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CustomerListParams build() { return new CustomerListParams( - this.created, this.email, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.email, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setCreated(Created created) { @@ -135,6 +156,32 @@ public Builder addAllExpand(List 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 + * CustomerListParams#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 CustomerListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -157,6 +204,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -173,7 +229,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -185,6 +242,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -195,7 +254,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * CustomerListParams.Created#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 CustomerListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/CustomerRetrieveParams.java b/src/main/java/com/stripe/param/CustomerRetrieveParams.java index eb60d682cec..86a4cc5b9f4 100644 --- a/src/main/java/com/stripe/param/CustomerRetrieveParams.java +++ b/src/main/java/com/stripe/param/CustomerRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CustomerRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CustomerRetrieveParams(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; + + private CustomerRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CustomerRetrieveParams build() { - return new CustomerRetrieveParams(this.expand); + return new CustomerRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CustomerRetrieveParams#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 CustomerRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/CustomerUpdateParams.java b/src/main/java/com/stripe/param/CustomerUpdateParams.java index 0b4c908af1d..af1f5aaaeae 100644 --- a/src/main/java/com/stripe/param/CustomerUpdateParams.java +++ b/src/main/java/com/stripe/param/CustomerUpdateParams.java @@ -53,6 +53,15 @@ public class CustomerUpdateParams extends ApiRequestParams { @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; + /** * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase * letters or numbers. @@ -121,6 +130,7 @@ private CustomerUpdateParams( String description, String email, List expand, + Map extraParams, String invoicePrefix, InvoiceSettings invoiceSettings, Map metadata, @@ -139,6 +149,7 @@ private CustomerUpdateParams( this.description = description; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.invoicePrefix = invoicePrefix; this.invoiceSettings = invoiceSettings; this.metadata = metadata; @@ -171,6 +182,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoicePrefix; private InvoiceSettings invoiceSettings; @@ -203,6 +216,7 @@ public CustomerUpdateParams build() { this.description, this.email, this.expand, + this.extraParams, this.invoicePrefix, this.invoiceSettings, this.metadata, @@ -298,6 +312,32 @@ public Builder addAllExpand(List 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 + * CustomerUpdateParams#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 CustomerUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase * letters or numbers. @@ -449,6 +489,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -462,9 +511,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -480,6 +536,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -491,7 +549,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -504,6 +568,32 @@ public Builder setCountry(String 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 + * CustomerUpdateParams.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 CustomerUpdateParams.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -535,13 +625,27 @@ public static class InvoiceSettings { @SerializedName("default_payment_method") String defaultPaymentMethod; + /** + * 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; + /** Default footer to be displayed on invoices for this customer. */ @SerializedName("footer") String footer; - private InvoiceSettings(Object customFields, String defaultPaymentMethod, String footer) { + private InvoiceSettings( + Object customFields, + String defaultPaymentMethod, + Map extraParams, + String footer) { this.customFields = customFields; this.defaultPaymentMethod = defaultPaymentMethod; + this.extraParams = extraParams; this.footer = footer; } @@ -554,11 +658,14 @@ public static class Builder { private String defaultPaymentMethod; + private Map extraParams; + private String footer; /** Finalize and obtain parameter instance from this builder. */ public InvoiceSettings build() { - return new InvoiceSettings(this.customFields, this.defaultPaymentMethod, this.footer); + return new InvoiceSettings( + this.customFields, this.defaultPaymentMethod, this.extraParams, this.footer); } /** Default custom fields to be displayed on invoices for this customer. */ @@ -579,6 +686,32 @@ public Builder setDefaultPaymentMethod(String defaultPaymentMethod) { 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 + * CustomerUpdateParams.InvoiceSettings#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 CustomerUpdateParams.InvoiceSettings#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Default footer to be displayed on invoices for this customer. */ public Builder setFooter(String footer) { this.footer = footer; @@ -587,6 +720,15 @@ public Builder setFooter(String footer) { } public static class CustomField { + /** + * 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; + /** The name of the custom field. This may be up to 30 characters. */ @SerializedName("name") String name; @@ -595,7 +737,8 @@ public static class CustomField { @SerializedName("value") String value; - private CustomField(String name, String value) { + private CustomField(Map extraParams, String name, String value) { + this.extraParams = extraParams; this.name = name; this.value = value; } @@ -605,13 +748,43 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String name; private String value; /** Finalize and obtain parameter instance from this builder. */ public CustomField build() { - return new CustomField(this.name, this.value); + return new CustomField(this.extraParams, this.name, this.value); + } + + /** + * 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 CustomerUpdateParams.InvoiceSettings.CustomField#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 CustomerUpdateParams.InvoiceSettings.CustomField#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The name of the custom field. This may be up to 30 characters. */ @@ -634,6 +807,15 @@ public static class Shipping { @SerializedName("address") Address address; + /** + * 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; + /** Customer name. */ @SerializedName("name") String name; @@ -642,8 +824,9 @@ public static class Shipping { @SerializedName("phone") String phone; - private Shipping(Address address, String name, String phone) { + private Shipping(Address address, Map extraParams, String name, String phone) { this.address = address; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -655,13 +838,15 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.name, this.phone); + return new Shipping(this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ @@ -670,6 +855,32 @@ public Builder setAddress(Address address) { 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 + * CustomerUpdateParams.Shipping#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 CustomerUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Customer name. */ public Builder setName(String name) { this.name = name; @@ -690,6 +901,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -705,12 +925,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -726,6 +948,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -737,7 +961,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -750,6 +980,34 @@ public Builder setCountry(String 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 CustomerUpdateParams.Shipping.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 CustomerUpdateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -774,6 +1032,15 @@ public Builder setState(String state) { } public static class TaxInfo { + /** + * 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; + /** The customer's tax ID number. */ @SerializedName("tax_id") String taxId; @@ -782,7 +1049,8 @@ public static class TaxInfo { @SerializedName("type") Type type; - private TaxInfo(String taxId, Type type) { + private TaxInfo(Map extraParams, String taxId, Type type) { + this.extraParams = extraParams; this.taxId = taxId; this.type = type; } @@ -792,13 +1060,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String taxId; private Type type; /** Finalize and obtain parameter instance from this builder. */ public TaxInfo build() { - return new TaxInfo(this.taxId, this.type); + return new TaxInfo(this.extraParams, this.taxId, this.type); + } + + /** + * 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 + * CustomerUpdateParams.TaxInfo#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 CustomerUpdateParams.TaxInfo#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The customer's tax ID number. */ diff --git a/src/main/java/com/stripe/param/DisputeCloseParams.java b/src/main/java/com/stripe/param/DisputeCloseParams.java index a3d2a68921d..9d562002211 100644 --- a/src/main/java/com/stripe/param/DisputeCloseParams.java +++ b/src/main/java/com/stripe/param/DisputeCloseParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class DisputeCloseParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private DisputeCloseParams(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; + + private DisputeCloseParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public DisputeCloseParams build() { - return new DisputeCloseParams(this.expand); + return new DisputeCloseParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * DisputeCloseParams#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 DisputeCloseParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/DisputeListParams.java b/src/main/java/com/stripe/param/DisputeListParams.java index 208cd8e6cc5..3f214049f76 100644 --- a/src/main/java/com/stripe/param/DisputeListParams.java +++ b/src/main/java/com/stripe/param/DisputeListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class DisputeListParams extends ApiRequestParams { @SerializedName("created") @@ -24,6 +26,15 @@ public class DisputeListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -41,10 +52,16 @@ public class DisputeListParams extends ApiRequestParams { String startingAfter; private DisputeListParams( - Object created, String endingBefore, List expand, Long limit, String startingAfter) { + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -60,6 +77,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -67,7 +86,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public DisputeListParams build() { return new DisputeListParams( - this.created, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setCreated(Created created) { @@ -117,6 +141,32 @@ public Builder addAllExpand(List 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 + * DisputeListParams#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 DisputeListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -139,6 +189,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -155,7 +214,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -167,6 +227,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -177,7 +239,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * DisputeListParams.Created#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 DisputeListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/DisputeRetrieveParams.java b/src/main/java/com/stripe/param/DisputeRetrieveParams.java index da538802b43..c79453fab75 100644 --- a/src/main/java/com/stripe/param/DisputeRetrieveParams.java +++ b/src/main/java/com/stripe/param/DisputeRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class DisputeRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private DisputeRetrieveParams(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; + + private DisputeRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public DisputeRetrieveParams build() { - return new DisputeRetrieveParams(this.expand); + return new DisputeRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * DisputeRetrieveParams#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 DisputeRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/DisputeUpdateParams.java b/src/main/java/com/stripe/param/DisputeUpdateParams.java index d5974ab6df4..530b7654fb5 100644 --- a/src/main/java/com/stripe/param/DisputeUpdateParams.java +++ b/src/main/java/com/stripe/param/DisputeUpdateParams.java @@ -22,6 +22,15 @@ public class DisputeUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a dispute object. This can be useful for * storing additional information about the dispute in a structured format. @@ -38,9 +47,14 @@ public class DisputeUpdateParams extends ApiRequestParams { Boolean submit; private DisputeUpdateParams( - Evidence evidence, List expand, Map metadata, Boolean submit) { + Evidence evidence, + List expand, + Map extraParams, + Map metadata, + Boolean submit) { this.evidence = evidence; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.submit = submit; } @@ -54,13 +68,16 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Boolean submit; /** Finalize and obtain parameter instance from this builder. */ public DisputeUpdateParams build() { - return new DisputeUpdateParams(this.evidence, this.expand, this.metadata, this.submit); + return new DisputeUpdateParams( + this.evidence, this.expand, this.extraParams, this.metadata, this.submit); } /** @@ -99,6 +116,32 @@ public Builder addAllExpand(List 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 + * DisputeUpdateParams#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 DisputeUpdateParams#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 @@ -180,6 +223,15 @@ public static class Evidence { @SerializedName("duplicate_charge_id") String duplicateChargeId; + /** + * 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; + /** Has a maximum character count of 20,000. */ @SerializedName("product_description") String productDescription; @@ -240,6 +292,7 @@ private Evidence( String duplicateChargeDocumentation, String duplicateChargeExplanation, String duplicateChargeId, + Map extraParams, String productDescription, String receipt, String refundPolicy, @@ -267,6 +320,7 @@ private Evidence( this.duplicateChargeDocumentation = duplicateChargeDocumentation; this.duplicateChargeExplanation = duplicateChargeExplanation; this.duplicateChargeId = duplicateChargeId; + this.extraParams = extraParams; this.productDescription = productDescription; this.receipt = receipt; this.refundPolicy = refundPolicy; @@ -314,6 +368,8 @@ public static class Builder { private String duplicateChargeId; + private Map extraParams; + private String productDescription; private String receipt; @@ -358,6 +414,7 @@ public Evidence build() { this.duplicateChargeDocumentation, this.duplicateChargeExplanation, this.duplicateChargeId, + this.extraParams, this.productDescription, this.receipt, this.refundPolicy, @@ -443,6 +500,32 @@ public Builder setDuplicateChargeId(String duplicateChargeId) { 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 + * DisputeUpdateParams.Evidence#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 DisputeUpdateParams.Evidence#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Has a maximum character count of 20,000. */ public Builder setProductDescription(String productDescription) { this.productDescription = productDescription; diff --git a/src/main/java/com/stripe/param/ExchangeRateListParams.java b/src/main/java/com/stripe/param/ExchangeRateListParams.java index 19f2d0a01a2..ae843acfb97 100644 --- a/src/main/java/com/stripe/param/ExchangeRateListParams.java +++ b/src/main/java/com/stripe/param/ExchangeRateListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ExchangeRateListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class ExchangeRateListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and total number of * supported payout currencies, and the default is the max. @@ -38,9 +49,14 @@ public class ExchangeRateListParams extends ApiRequestParams { String startingAfter; private ExchangeRateListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ExchangeRateListParams build() { return new ExchangeRateListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * ExchangeRateListParams#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 ExchangeRateListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and total number * of supported payout currencies, and the default is the max. diff --git a/src/main/java/com/stripe/param/ExchangeRateRetrieveParams.java b/src/main/java/com/stripe/param/ExchangeRateRetrieveParams.java index 8a21e33dc67..c3254d512a6 100644 --- a/src/main/java/com/stripe/param/ExchangeRateRetrieveParams.java +++ b/src/main/java/com/stripe/param/ExchangeRateRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ExchangeRateRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ExchangeRateRetrieveParams(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; + + private ExchangeRateRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ExchangeRateRetrieveParams build() { - return new ExchangeRateRetrieveParams(this.expand); + return new ExchangeRateRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ExchangeRateRetrieveParams#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 ExchangeRateRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ExternalAccountCollectionCreateParams.java b/src/main/java/com/stripe/param/ExternalAccountCollectionCreateParams.java index f0efe6897a7..06fef71adec 100644 --- a/src/main/java/com/stripe/param/ExternalAccountCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/ExternalAccountCollectionCreateParams.java @@ -25,6 +25,15 @@ public class ExternalAccountCollectionCreateParams extends ApiRequestParams { @SerializedName("external_account") String externalAccount; + /** + * 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; + /** * A set of key-value pairs that you can attach to an external account object. It can be useful * for storing additional information about the external account in a structured format. @@ -36,10 +45,12 @@ private ExternalAccountCollectionCreateParams( Boolean defaultForCurrency, List expand, String externalAccount, + Map extraParams, Map metadata) { this.defaultForCurrency = defaultForCurrency; this.expand = expand; this.externalAccount = externalAccount; + this.extraParams = extraParams; this.metadata = metadata; } @@ -54,12 +65,18 @@ public static class Builder { private String externalAccount; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public ExternalAccountCollectionCreateParams build() { return new ExternalAccountCollectionCreateParams( - this.defaultForCurrency, this.expand, this.externalAccount, this.metadata); + this.defaultForCurrency, + this.expand, + this.externalAccount, + this.extraParams, + this.metadata); } /** @@ -103,6 +120,32 @@ public Builder setExternalAccount(String externalAccount) { 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 + * ExternalAccountCollectionCreateParams#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 ExternalAccountCollectionCreateParams#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 diff --git a/src/main/java/com/stripe/param/ExternalAccountCollectionListParams.java b/src/main/java/com/stripe/param/ExternalAccountCollectionListParams.java index 9543b42e01a..e27b3c2d883 100644 --- a/src/main/java/com/stripe/param/ExternalAccountCollectionListParams.java +++ b/src/main/java/com/stripe/param/ExternalAccountCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ExternalAccountCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class ExternalAccountCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class ExternalAccountCollectionListParams extends ApiRequestParams { String startingAfter; private ExternalAccountCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ExternalAccountCollectionListParams build() { return new ExternalAccountCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * ExternalAccountCollectionListParams#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 ExternalAccountCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/ExternalAccountCollectionRetrieveParams.java b/src/main/java/com/stripe/param/ExternalAccountCollectionRetrieveParams.java index b4e97b402db..0a36b077747 100644 --- a/src/main/java/com/stripe/param/ExternalAccountCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/ExternalAccountCollectionRetrieveParams.java @@ -5,15 +5,28 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ExternalAccountCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ExternalAccountCollectionRetrieveParams(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; + + private ExternalAccountCollectionRetrieveParams( + List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +36,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ExternalAccountCollectionRetrieveParams build() { - return new ExternalAccountCollectionRetrieveParams(this.expand); + return new ExternalAccountCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +68,31 @@ public Builder addAllExpand(List elements) { 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 + * ExternalAccountCollectionRetrieveParams#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 ExternalAccountCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java b/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java index 12eb7fd13d8..7277b5359c2 100644 --- a/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java +++ b/src/main/java/com/stripe/param/ExternalAccountUpdateParams.java @@ -60,6 +60,15 @@ public class ExternalAccountUpdateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -80,6 +89,7 @@ private ExternalAccountUpdateParams( String expMonth, String expYear, List expand, + Map extraParams, Map metadata, String name) { this.accountHolderName = accountHolderName; @@ -94,6 +104,7 @@ private ExternalAccountUpdateParams( this.expMonth = expMonth; this.expYear = expYear; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; } @@ -127,6 +138,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; @@ -146,6 +159,7 @@ public ExternalAccountUpdateParams build() { this.expMonth, this.expYear, this.expand, + this.extraParams, this.metadata, this.name); } @@ -248,6 +262,32 @@ public Builder addAllExpand(List 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 + * ExternalAccountUpdateParams#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 ExternalAccountUpdateParams#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 diff --git a/src/main/java/com/stripe/param/FeeRefundCollectionCreateParams.java b/src/main/java/com/stripe/param/FeeRefundCollectionCreateParams.java index b4ae6e44efb..5cafa8032bf 100644 --- a/src/main/java/com/stripe/param/FeeRefundCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/FeeRefundCollectionCreateParams.java @@ -21,6 +21,15 @@ public class FeeRefundCollectionCreateParams extends ApiRequestParams { @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 @@ -30,9 +39,13 @@ public class FeeRefundCollectionCreateParams extends ApiRequestParams { Map metadata; private FeeRefundCollectionCreateParams( - Long amount, List expand, Map metadata) { + Long amount, + List expand, + Map extraParams, + Map metadata) { this.amount = amount; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -45,11 +58,14 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public FeeRefundCollectionCreateParams build() { - return new FeeRefundCollectionCreateParams(this.amount, this.expand, this.metadata); + return new FeeRefundCollectionCreateParams( + this.amount, this.expand, this.extraParams, this.metadata); } /** @@ -87,6 +103,32 @@ public Builder addAllExpand(List 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 + * FeeRefundCollectionCreateParams#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 FeeRefundCollectionCreateParams#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 diff --git a/src/main/java/com/stripe/param/FeeRefundCollectionListParams.java b/src/main/java/com/stripe/param/FeeRefundCollectionListParams.java index cb26b44a580..cd0499c903d 100644 --- a/src/main/java/com/stripe/param/FeeRefundCollectionListParams.java +++ b/src/main/java/com/stripe/param/FeeRefundCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class FeeRefundCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class FeeRefundCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class FeeRefundCollectionListParams extends ApiRequestParams { String startingAfter; private FeeRefundCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public FeeRefundCollectionListParams build() { return new FeeRefundCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * FeeRefundCollectionListParams#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 FeeRefundCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/FeeRefundCollectionRetrieveParams.java b/src/main/java/com/stripe/param/FeeRefundCollectionRetrieveParams.java index cd3df7a3c36..79a93c5b97b 100644 --- a/src/main/java/com/stripe/param/FeeRefundCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/FeeRefundCollectionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class FeeRefundCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private FeeRefundCollectionRetrieveParams(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; + + private FeeRefundCollectionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public FeeRefundCollectionRetrieveParams build() { - return new FeeRefundCollectionRetrieveParams(this.expand); + return new FeeRefundCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * FeeRefundCollectionRetrieveParams#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 FeeRefundCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/FeeRefundUpdateParams.java b/src/main/java/com/stripe/param/FeeRefundUpdateParams.java index f0c7b43196d..e6f053a849d 100644 --- a/src/main/java/com/stripe/param/FeeRefundUpdateParams.java +++ b/src/main/java/com/stripe/param/FeeRefundUpdateParams.java @@ -14,6 +14,15 @@ public class FeeRefundUpdateParams extends ApiRequestParams { @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 @@ -22,8 +31,10 @@ public class FeeRefundUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private FeeRefundUpdateParams(List expand, Map metadata) { + private FeeRefundUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -34,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public FeeRefundUpdateParams build() { - return new FeeRefundUpdateParams(this.expand, this.metadata); + return new FeeRefundUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -67,6 +80,32 @@ public Builder addAllExpand(List 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 + * FeeRefundUpdateParams#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 FeeRefundUpdateParams#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 diff --git a/src/main/java/com/stripe/param/FileLinkCreateParams.java b/src/main/java/com/stripe/param/FileLinkCreateParams.java index 2d8e476b719..9b89145ed29 100644 --- a/src/main/java/com/stripe/param/FileLinkCreateParams.java +++ b/src/main/java/com/stripe/param/FileLinkCreateParams.java @@ -18,6 +18,15 @@ public class FileLinkCreateParams extends ApiRequestParams { @SerializedName("expires_at") Long expiresAt; + /** + * 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; + /** * The ID of the file. The file's `purpose` must be one of the following: `business_icon`, * `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, @@ -34,9 +43,14 @@ public class FileLinkCreateParams extends ApiRequestParams { Map metadata; private FileLinkCreateParams( - List expand, Long expiresAt, String file, Map metadata) { + List expand, + Long expiresAt, + Map extraParams, + String file, + Map metadata) { this.expand = expand; this.expiresAt = expiresAt; + this.extraParams = extraParams; this.file = file; this.metadata = metadata; } @@ -50,13 +64,16 @@ public static class Builder { private Long expiresAt; + private Map extraParams; + private String file; private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public FileLinkCreateParams build() { - return new FileLinkCreateParams(this.expand, this.expiresAt, this.file, this.metadata); + return new FileLinkCreateParams( + this.expand, this.expiresAt, this.extraParams, this.file, this.metadata); } /** @@ -91,6 +108,32 @@ public Builder setExpiresAt(Long expiresAt) { 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 + * FileLinkCreateParams#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 FileLinkCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The ID of the file. The file's `purpose` must be one of the following: `business_icon`, * `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, diff --git a/src/main/java/com/stripe/param/FileLinkListParams.java b/src/main/java/com/stripe/param/FileLinkListParams.java index 109aee4c6ab..03ebf8dbae8 100644 --- a/src/main/java/com/stripe/param/FileLinkListParams.java +++ b/src/main/java/com/stripe/param/FileLinkListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class FileLinkListParams extends ApiRequestParams { @SerializedName("created") @@ -28,6 +30,15 @@ public class FileLinkListParams extends ApiRequestParams { @SerializedName("expired") Boolean expired; + /** + * 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; + /** Only return links for the given file. */ @SerializedName("file") String file; @@ -53,6 +64,7 @@ private FileLinkListParams( String endingBefore, List expand, Boolean expired, + Map extraParams, String file, Long limit, String startingAfter) { @@ -60,6 +72,7 @@ private FileLinkListParams( this.endingBefore = endingBefore; this.expand = expand; this.expired = expired; + this.extraParams = extraParams; this.file = file; this.limit = limit; this.startingAfter = startingAfter; @@ -78,6 +91,8 @@ public static class Builder { private Boolean expired; + private Map extraParams; + private String file; private Long limit; @@ -91,6 +106,7 @@ public FileLinkListParams build() { this.endingBefore, this.expand, this.expired, + this.extraParams, this.file, this.limit, this.startingAfter); @@ -149,6 +165,32 @@ public Builder setExpired(Boolean expired) { 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 + * FileLinkListParams#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 FileLinkListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Only return links for the given file. */ public Builder setFile(String file) { this.file = file; @@ -177,6 +219,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -193,7 +244,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -205,6 +257,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -215,7 +269,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * FileLinkListParams.Created#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 FileLinkListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/FileLinkRetrieveParams.java b/src/main/java/com/stripe/param/FileLinkRetrieveParams.java index 6333784544b..a3811be6f4a 100644 --- a/src/main/java/com/stripe/param/FileLinkRetrieveParams.java +++ b/src/main/java/com/stripe/param/FileLinkRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class FileLinkRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private FileLinkRetrieveParams(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; + + private FileLinkRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public FileLinkRetrieveParams build() { - return new FileLinkRetrieveParams(this.expand); + return new FileLinkRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * FileLinkRetrieveParams#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 FileLinkRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/FileLinkUpdateParams.java b/src/main/java/com/stripe/param/FileLinkUpdateParams.java index 439806c09a0..6e811e8d833 100644 --- a/src/main/java/com/stripe/param/FileLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/FileLinkUpdateParams.java @@ -23,6 +23,15 @@ public class FileLinkUpdateParams extends ApiRequestParams { @SerializedName("expires_at") Object expiresAt; + /** + * 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. @@ -31,9 +40,13 @@ public class FileLinkUpdateParams extends ApiRequestParams { Map metadata; private FileLinkUpdateParams( - List expand, Object expiresAt, Map metadata) { + List expand, + Object expiresAt, + Map extraParams, + Map metadata) { this.expand = expand; this.expiresAt = expiresAt; + this.extraParams = extraParams; this.metadata = metadata; } @@ -46,11 +59,13 @@ public static class Builder { private Object expiresAt; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public FileLinkUpdateParams build() { - return new FileLinkUpdateParams(this.expand, this.expiresAt, this.metadata); + return new FileLinkUpdateParams(this.expand, this.expiresAt, this.extraParams, this.metadata); } /** @@ -106,6 +121,32 @@ public Builder setExpiresAt(Long expiresAt) { 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 + * FileLinkUpdateParams#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 FileLinkUpdateParams#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 diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index fa948af5ea7..4d63ec40753 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -86,6 +86,15 @@ public class InvoiceCreateParams extends ApiRequestParams { @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; + /** Footer to be displayed on the invoice. */ @SerializedName("footer") String footer; @@ -140,6 +149,7 @@ private InvoiceCreateParams( String description, Long dueDate, List expand, + Map extraParams, String footer, Map metadata, String statementDescriptor, @@ -158,6 +168,7 @@ private InvoiceCreateParams( this.description = description; this.dueDate = dueDate; this.expand = expand; + this.extraParams = extraParams; this.footer = footer; this.metadata = metadata; this.statementDescriptor = statementDescriptor; @@ -195,6 +206,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String footer; private Map metadata; @@ -222,6 +235,7 @@ public InvoiceCreateParams build() { this.description, this.dueDate, this.expand, + this.extraParams, this.footer, this.metadata, this.statementDescriptor, @@ -374,6 +388,32 @@ public Builder addAllExpand(List 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 + * InvoiceCreateParams#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#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Footer to be displayed on the invoice. */ public Builder setFooter(String footer) { this.footer = footer; @@ -450,6 +490,15 @@ public Builder setTransferData(TransferData transferData) { } public static class CustomField { + /** + * 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; + /** The name of the custom field. This may be up to 30 characters. */ @SerializedName("name") String name; @@ -458,7 +507,8 @@ public static class CustomField { @SerializedName("value") String value; - private CustomField(String name, String value) { + private CustomField(Map extraParams, String name, String value) { + this.extraParams = extraParams; this.name = name; this.value = value; } @@ -468,13 +518,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String name; private String value; /** Finalize and obtain parameter instance from this builder. */ public CustomField build() { - return new CustomField(this.name, this.value); + return new CustomField(this.extraParams, this.name, this.value); + } + + /** + * 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.CustomField#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.CustomField#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The name of the custom field. This may be up to 30 characters. */ @@ -496,8 +574,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -507,9 +595,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -517,6 +607,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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.TransferData#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.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceFinalizeInvoiceParams.java b/src/main/java/com/stripe/param/InvoiceFinalizeInvoiceParams.java index 336a2129f21..8146f834302 100644 --- a/src/main/java/com/stripe/param/InvoiceFinalizeInvoiceParams.java +++ b/src/main/java/com/stripe/param/InvoiceFinalizeInvoiceParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceFinalizeInvoiceParams extends ApiRequestParams { /** @@ -20,9 +22,20 @@ public class InvoiceFinalizeInvoiceParams extends ApiRequestParams { @SerializedName("expand") List expand; - private InvoiceFinalizeInvoiceParams(Boolean autoAdvance, 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; + + private InvoiceFinalizeInvoiceParams( + Boolean autoAdvance, List expand, Map extraParams) { this.autoAdvance = autoAdvance; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -34,9 +47,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceFinalizeInvoiceParams build() { - return new InvoiceFinalizeInvoiceParams(this.autoAdvance, this.expand); + return new InvoiceFinalizeInvoiceParams(this.autoAdvance, this.expand, this.extraParams); } /** @@ -74,5 +89,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceFinalizeInvoiceParams#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 InvoiceFinalizeInvoiceParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java index 9a9fa3a08ac..18b7d89f648 100644 --- a/src/main/java/com/stripe/param/InvoiceItemCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemCreateParams.java @@ -46,6 +46,15 @@ public class InvoiceItemCreateParams extends ApiRequestParams { @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; + /** * The ID of an existing invoice to add this invoice item to. When left blank, the invoice item * will be added to the next upcoming scheduled invoice. This is useful when adding invoice items @@ -100,6 +109,7 @@ private InvoiceItemCreateParams( String description, Boolean discountable, List expand, + Map extraParams, String invoice, Map metadata, Period period, @@ -113,6 +123,7 @@ private InvoiceItemCreateParams( this.description = description; this.discountable = discountable; this.expand = expand; + this.extraParams = extraParams; this.invoice = invoice; this.metadata = metadata; this.period = period; @@ -139,6 +150,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoice; private Map metadata; @@ -162,6 +175,7 @@ public InvoiceItemCreateParams build() { this.description, this.discountable, this.expand, + this.extraParams, this.invoice, this.metadata, this.period, @@ -239,6 +253,32 @@ public Builder addAllExpand(List 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 + * InvoiceItemCreateParams#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 InvoiceItemCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The ID of an existing invoice to add this invoice item to. When left blank, the invoice item * will be added to the next upcoming scheduled invoice. This is useful when adding invoice @@ -342,12 +382,22 @@ public static class Period { @SerializedName("end") Long end; + /** + * 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; + /** The start of the period. */ @SerializedName("start") Long start; - private Period(Long end, Long start) { + private Period(Long end, Map extraParams, Long start) { this.end = end; + this.extraParams = extraParams; this.start = start; } @@ -358,11 +408,13 @@ public static Builder builder() { public static class Builder { private Long end; + private Map extraParams; + private Long start; /** Finalize and obtain parameter instance from this builder. */ public Period build() { - return new Period(this.end, this.start); + return new Period(this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -371,6 +423,32 @@ public Builder setEnd(Long end) { 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 + * InvoiceItemCreateParams.Period#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 InvoiceItemCreateParams.Period#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The start of the period. */ public Builder setStart(Long start) { this.start = start; diff --git a/src/main/java/com/stripe/param/InvoiceItemListParams.java b/src/main/java/com/stripe/param/InvoiceItemListParams.java index 557cf7f0753..ca76b350ad9 100644 --- a/src/main/java/com/stripe/param/InvoiceItemListParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceItemListParams extends ApiRequestParams { @SerializedName("created") @@ -31,6 +33,15 @@ public class InvoiceItemListParams extends ApiRequestParams { @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; + /** * Only return invoice items belonging to this invoice. If none is provided, all invoice items * will be returned. If specifying an invoice, no customer identifier is needed. @@ -67,6 +78,7 @@ private InvoiceItemListParams( String customer, String endingBefore, List expand, + Map extraParams, String invoice, Long limit, Boolean pending, @@ -75,6 +87,7 @@ private InvoiceItemListParams( this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.invoice = invoice; this.limit = limit; this.pending = pending; @@ -94,6 +107,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String invoice; private Long limit; @@ -109,6 +124,7 @@ public InvoiceItemListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.invoice, this.limit, this.pending, @@ -171,6 +187,32 @@ public Builder addAllExpand(List 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 + * InvoiceItemListParams#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 InvoiceItemListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Only return invoice items belonging to this invoice. If none is provided, all invoice items * will be returned. If specifying an invoice, no customer identifier is needed. @@ -212,6 +254,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -228,7 +279,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -240,6 +292,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -250,7 +304,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * InvoiceItemListParams.Created#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 InvoiceItemListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/InvoiceItemRetrieveParams.java b/src/main/java/com/stripe/param/InvoiceItemRetrieveParams.java index 1094ea96538..0da9c13fe1f 100644 --- a/src/main/java/com/stripe/param/InvoiceItemRetrieveParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceItemRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private InvoiceItemRetrieveParams(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; + + private InvoiceItemRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceItemRetrieveParams build() { - return new InvoiceItemRetrieveParams(this.expand); + return new InvoiceItemRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceItemRetrieveParams#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 InvoiceItemRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java index c7a8c8ae782..3a7286ec9f1 100644 --- a/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceItemUpdateParams.java @@ -37,6 +37,15 @@ public class InvoiceItemUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to an invoice item object. It can be useful for * storing additional information about the invoice item in a structured format. @@ -72,6 +81,7 @@ private InvoiceItemUpdateParams( String description, Boolean discountable, List expand, + Map extraParams, Map metadata, Period period, Long quantity, @@ -81,6 +91,7 @@ private InvoiceItemUpdateParams( this.description = description; this.discountable = discountable; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.period = period; this.quantity = quantity; @@ -101,6 +112,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Period period; @@ -118,6 +131,7 @@ public InvoiceItemUpdateParams build() { this.description, this.discountable, this.expand, + this.extraParams, this.metadata, this.period, this.quantity, @@ -179,6 +193,32 @@ public Builder addAllExpand(List 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 + * InvoiceItemUpdateParams#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 InvoiceItemUpdateParams#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 @@ -251,12 +291,22 @@ public static class Period { @SerializedName("end") Long end; + /** + * 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; + /** The start of the period. */ @SerializedName("start") Long start; - private Period(Long end, Long start) { + private Period(Long end, Map extraParams, Long start) { this.end = end; + this.extraParams = extraParams; this.start = start; } @@ -267,11 +317,13 @@ public static Builder builder() { public static class Builder { private Long end; + private Map extraParams; + private Long start; /** Finalize and obtain parameter instance from this builder. */ public Period build() { - return new Period(this.end, this.start); + return new Period(this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -280,6 +332,32 @@ public Builder setEnd(Long end) { 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 + * InvoiceItemUpdateParams.Period#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 InvoiceItemUpdateParams.Period#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The start of the period. */ public Builder setStart(Long start) { this.start = start; diff --git a/src/main/java/com/stripe/param/InvoiceLineItemCollectionListParams.java b/src/main/java/com/stripe/param/InvoiceLineItemCollectionListParams.java index 90cc34f45cd..84611733580 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemCollectionListParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceLineItemCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class InvoiceLineItemCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class InvoiceLineItemCollectionListParams extends ApiRequestParams { String startingAfter; private InvoiceLineItemCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public InvoiceLineItemCollectionListParams build() { return new InvoiceLineItemCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * InvoiceLineItemCollectionListParams#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 InvoiceLineItemCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/InvoiceListParams.java b/src/main/java/com/stripe/param/InvoiceListParams.java index 00a152cddb2..c9654cd5312 100644 --- a/src/main/java/com/stripe/param/InvoiceListParams.java +++ b/src/main/java/com/stripe/param/InvoiceListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class InvoiceListParams extends ApiRequestParams { @@ -38,6 +40,15 @@ public class InvoiceListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -65,6 +76,7 @@ private InvoiceListParams( Object dueDate, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, String subscription) { @@ -74,6 +86,7 @@ private InvoiceListParams( this.dueDate = dueDate; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.subscription = subscription; @@ -96,6 +109,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -111,6 +126,7 @@ public InvoiceListParams build() { this.dueDate, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.subscription); @@ -187,6 +203,32 @@ public Builder addAllExpand(List 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 + * InvoiceListParams#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 InvoiceListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -215,6 +257,15 @@ public Builder setSubscription(String subscription) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -231,7 +282,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -243,6 +295,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -253,7 +307,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * InvoiceListParams.Created#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 InvoiceListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -283,6 +363,15 @@ public Builder setLte(Long lte) { } public static class DueDate { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -299,7 +388,8 @@ public static class DueDate { @SerializedName("lte") Long lte; - private DueDate(Long gt, Long gte, Long lt, Long lte) { + private DueDate(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -311,6 +401,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -321,7 +413,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public DueDate build() { - return new DueDate(this.gt, this.gte, this.lt, this.lte); + return new DueDate(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * InvoiceListParams.DueDate#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 InvoiceListParams.DueDate#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/InvoiceMarkUncollectibleParams.java b/src/main/java/com/stripe/param/InvoiceMarkUncollectibleParams.java index 1e26218bb9d..3c161c2c2c0 100644 --- a/src/main/java/com/stripe/param/InvoiceMarkUncollectibleParams.java +++ b/src/main/java/com/stripe/param/InvoiceMarkUncollectibleParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceMarkUncollectibleParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private InvoiceMarkUncollectibleParams(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; + + private InvoiceMarkUncollectibleParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceMarkUncollectibleParams build() { - return new InvoiceMarkUncollectibleParams(this.expand); + return new InvoiceMarkUncollectibleParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceMarkUncollectibleParams#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 InvoiceMarkUncollectibleParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoicePayParams.java b/src/main/java/com/stripe/param/InvoicePayParams.java index 5ba3585506a..b89cc8e56b0 100644 --- a/src/main/java/com/stripe/param/InvoicePayParams.java +++ b/src/main/java/com/stripe/param/InvoicePayParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoicePayParams extends ApiRequestParams { /** 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; + /** * In cases where the source used to pay the invoice has insufficient funds, passing * `forgive=true` controls whether a charge should be attempted for the full amount available on @@ -48,11 +59,13 @@ public class InvoicePayParams extends ApiRequestParams { private InvoicePayParams( List expand, + Map extraParams, Boolean forgive, Boolean paidOutOfBand, String paymentMethod, String source) { this.expand = expand; + this.extraParams = extraParams; this.forgive = forgive; this.paidOutOfBand = paidOutOfBand; this.paymentMethod = paymentMethod; @@ -66,6 +79,8 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Boolean forgive; private Boolean paidOutOfBand; @@ -77,7 +92,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public InvoicePayParams build() { return new InvoicePayParams( - this.expand, this.forgive, this.paidOutOfBand, this.paymentMethod, this.source); + this.expand, + this.extraParams, + this.forgive, + this.paidOutOfBand, + this.paymentMethod, + this.source); } /** @@ -106,6 +126,32 @@ public Builder addAllExpand(List 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 + * InvoicePayParams#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 InvoicePayParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * In cases where the source used to pay the invoice has insufficient funds, passing * `forgive=true` controls whether a charge should be attempted for the full amount available on diff --git a/src/main/java/com/stripe/param/InvoiceRetrieveParams.java b/src/main/java/com/stripe/param/InvoiceRetrieveParams.java index e1cebdce24e..2fdfdb7411a 100644 --- a/src/main/java/com/stripe/param/InvoiceRetrieveParams.java +++ b/src/main/java/com/stripe/param/InvoiceRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private InvoiceRetrieveParams(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; + + private InvoiceRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceRetrieveParams build() { - return new InvoiceRetrieveParams(this.expand); + return new InvoiceRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceRetrieveParams#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 InvoiceRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceSendInvoiceParams.java b/src/main/java/com/stripe/param/InvoiceSendInvoiceParams.java index 3024e25fc94..bd947abb858 100644 --- a/src/main/java/com/stripe/param/InvoiceSendInvoiceParams.java +++ b/src/main/java/com/stripe/param/InvoiceSendInvoiceParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceSendInvoiceParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private InvoiceSendInvoiceParams(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; + + private InvoiceSendInvoiceParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceSendInvoiceParams build() { - return new InvoiceSendInvoiceParams(this.expand); + return new InvoiceSendInvoiceParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceSendInvoiceParams#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 InvoiceSendInvoiceParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java index 9bd63408808..a9eb4d90f66 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java @@ -31,6 +31,15 @@ public class InvoiceUpcomingParams extends ApiRequestParams { @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; + /** List of invoice items to add or update in the upcoming invoice preview. */ @SerializedName("invoice_items") List invoiceItems; @@ -115,6 +124,7 @@ private InvoiceUpcomingParams( String coupon, String customer, List expand, + Map extraParams, List invoiceItems, String subscription, Object subscriptionBillingCycleAnchor, @@ -130,6 +140,7 @@ private InvoiceUpcomingParams( this.coupon = coupon; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.invoiceItems = invoiceItems; this.subscription = subscription; this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor; @@ -155,6 +166,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List invoiceItems; private String subscription; @@ -185,6 +198,7 @@ public InvoiceUpcomingParams build() { this.coupon, this.customer, this.expand, + this.extraParams, this.invoiceItems, this.subscription, this.subscriptionBillingCycleAnchor, @@ -243,6 +257,32 @@ public Builder addAllExpand(List 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 + * InvoiceUpcomingParams#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 InvoiceUpcomingParams#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 an element to `invoiceItems` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -443,6 +483,15 @@ public static class InvoiceItem { @SerializedName("discountable") Boolean discountable; + /** + * 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; + /** * The ID of the invoice item to update in preview. If not specified, a new invoice item will be * added to the preview of the upcoming invoice. @@ -481,6 +530,7 @@ private InvoiceItem( String currency, String description, Boolean discountable, + Map extraParams, String invoiceitem, Map metadata, Period period, @@ -491,6 +541,7 @@ private InvoiceItem( this.currency = currency; this.description = description; this.discountable = discountable; + this.extraParams = extraParams; this.invoiceitem = invoiceitem; this.metadata = metadata; this.period = period; @@ -512,6 +563,8 @@ public static class Builder { private Boolean discountable; + private Map extraParams; + private String invoiceitem; private Map metadata; @@ -531,6 +584,7 @@ public InvoiceItem build() { this.currency, this.description, this.discountable, + this.extraParams, this.invoiceitem, this.metadata, this.period, @@ -573,6 +627,32 @@ public Builder setDiscountable(Boolean discountable) { 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 + * InvoiceUpcomingParams.InvoiceItem#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 InvoiceUpcomingParams.InvoiceItem#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The ID of the invoice item to update in preview. If not specified, a new invoice item will * be added to the preview of the upcoming invoice. @@ -646,12 +726,22 @@ public static class Period { @SerializedName("end") Long end; + /** + * 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; + /** The start of the period. */ @SerializedName("start") Long start; - private Period(Long end, Long start) { + private Period(Long end, Map extraParams, Long start) { this.end = end; + this.extraParams = extraParams; this.start = start; } @@ -662,11 +752,13 @@ public static Builder builder() { public static class Builder { private Long end; + private Map extraParams; + private Long start; /** Finalize and obtain parameter instance from this builder. */ public Period build() { - return new Period(this.end, this.start); + return new Period(this.end, this.extraParams, this.start); } /** The end of the period, which must be greater than or equal to the start. */ @@ -675,6 +767,34 @@ public Builder setEnd(Long end) { 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 InvoiceUpcomingParams.InvoiceItem.Period#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 InvoiceUpcomingParams.InvoiceItem.Period#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The start of the period. */ public Builder setStart(Long start) { this.start = start; @@ -703,6 +823,15 @@ public static class SubscriptionItem { @SerializedName("deleted") Boolean deleted; + /** + * 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; + /** Subscription item to update. */ @SerializedName("id") String id; @@ -733,6 +862,7 @@ private SubscriptionItem( Object billingThresholds, Boolean clearUsage, Boolean deleted, + Map extraParams, String id, Map metadata, String plan, @@ -741,6 +871,7 @@ private SubscriptionItem( this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; this.deleted = deleted; + this.extraParams = extraParams; this.id = id; this.metadata = metadata; this.plan = plan; @@ -759,6 +890,8 @@ public static class Builder { private Boolean deleted; + private Map extraParams; + private String id; private Map metadata; @@ -775,6 +908,7 @@ public SubscriptionItem build() { this.billingThresholds, this.clearUsage, this.deleted, + this.extraParams, this.id, this.metadata, this.plan, @@ -815,6 +949,32 @@ public Builder setDeleted(Boolean deleted) { 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 + * InvoiceUpcomingParams.SubscriptionItem#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 InvoiceUpcomingParams.SubscriptionItem#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Subscription item to update. */ public Builder setId(String id) { this.id = id; @@ -879,11 +1039,21 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -893,11 +1063,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 InvoiceUpcomingParams.SubscriptionItem.BillingThresholds#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 InvoiceUpcomingParams.SubscriptionItem.BillingThresholds#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 92b227c7974..b9a1e1ba672 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -75,6 +75,15 @@ public class InvoiceUpdateParams extends ApiRequestParams { @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; + /** Footer to be displayed on the invoice. */ @SerializedName("footer") String footer; @@ -120,6 +129,7 @@ private InvoiceUpdateParams( String description, Long dueDate, List expand, + Map extraParams, String footer, Map metadata, String statementDescriptor, @@ -135,6 +145,7 @@ private InvoiceUpdateParams( this.description = description; this.dueDate = dueDate; this.expand = expand; + this.extraParams = extraParams; this.footer = footer; this.metadata = metadata; this.statementDescriptor = statementDescriptor; @@ -167,6 +178,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String footer; private Map metadata; @@ -190,6 +203,7 @@ public InvoiceUpdateParams build() { this.description, this.dueDate, this.expand, + this.extraParams, this.footer, this.metadata, this.statementDescriptor, @@ -316,6 +330,32 @@ public Builder addAllExpand(List 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 + * InvoiceUpdateParams#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 InvoiceUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Footer to be displayed on the invoice. */ public Builder setFooter(String footer) { this.footer = footer; @@ -405,6 +445,15 @@ public Builder setTransferData(EmptyParam transferData) { } public static class CustomField { + /** + * 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; + /** The name of the custom field. This may be up to 30 characters. */ @SerializedName("name") String name; @@ -413,7 +462,8 @@ public static class CustomField { @SerializedName("value") String value; - private CustomField(String name, String value) { + private CustomField(Map extraParams, String name, String value) { + this.extraParams = extraParams; this.name = name; this.value = value; } @@ -423,13 +473,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String name; private String value; /** Finalize and obtain parameter instance from this builder. */ public CustomField build() { - return new CustomField(this.name, this.value); + return new CustomField(this.extraParams, this.name, this.value); + } + + /** + * 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 + * InvoiceUpdateParams.CustomField#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 InvoiceUpdateParams.CustomField#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The name of the custom field. This may be up to 30 characters. */ @@ -451,8 +529,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -462,9 +550,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -472,6 +562,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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 + * InvoiceUpdateParams.TransferData#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 InvoiceUpdateParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } diff --git a/src/main/java/com/stripe/param/InvoiceVoidInvoiceParams.java b/src/main/java/com/stripe/param/InvoiceVoidInvoiceParams.java index 142d0d0fb44..d77e689be56 100644 --- a/src/main/java/com/stripe/param/InvoiceVoidInvoiceParams.java +++ b/src/main/java/com/stripe/param/InvoiceVoidInvoiceParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class InvoiceVoidInvoiceParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private InvoiceVoidInvoiceParams(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; + + private InvoiceVoidInvoiceParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceVoidInvoiceParams build() { - return new InvoiceVoidInvoiceParams(this.expand); + return new InvoiceVoidInvoiceParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * InvoiceVoidInvoiceParams#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 InvoiceVoidInvoiceParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/IssuerFraudRecordListParams.java b/src/main/java/com/stripe/param/IssuerFraudRecordListParams.java index 858244a2c6a..a4cd237cae1 100644 --- a/src/main/java/com/stripe/param/IssuerFraudRecordListParams.java +++ b/src/main/java/com/stripe/param/IssuerFraudRecordListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class IssuerFraudRecordListParams extends ApiRequestParams { /** Only return issuer fraud records for the charge specified by this charge ID. */ @@ -25,6 +27,15 @@ public class IssuerFraudRecordListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -42,10 +53,16 @@ public class IssuerFraudRecordListParams extends ApiRequestParams { String startingAfter; private IssuerFraudRecordListParams( - String charge, String endingBefore, List expand, Long limit, String startingAfter) { + String charge, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.charge = charge; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -61,6 +78,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -68,7 +87,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public IssuerFraudRecordListParams build() { return new IssuerFraudRecordListParams( - this.charge, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.charge, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } /** Only return issuer fraud records for the charge specified by this charge ID. */ @@ -114,6 +138,32 @@ public Builder addAllExpand(List 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 + * IssuerFraudRecordListParams#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 IssuerFraudRecordListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/IssuerFraudRecordRetrieveParams.java b/src/main/java/com/stripe/param/IssuerFraudRecordRetrieveParams.java index c9c80e45159..9e92f13c51e 100644 --- a/src/main/java/com/stripe/param/IssuerFraudRecordRetrieveParams.java +++ b/src/main/java/com/stripe/param/IssuerFraudRecordRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class IssuerFraudRecordRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private IssuerFraudRecordRetrieveParams(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; + + private IssuerFraudRecordRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public IssuerFraudRecordRetrieveParams build() { - return new IssuerFraudRecordRetrieveParams(this.expand); + return new IssuerFraudRecordRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * IssuerFraudRecordRetrieveParams#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 IssuerFraudRecordRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/LoginLinkCreateOnAccountParams.java b/src/main/java/com/stripe/param/LoginLinkCreateOnAccountParams.java index 2612503bfb6..46790adf185 100644 --- a/src/main/java/com/stripe/param/LoginLinkCreateOnAccountParams.java +++ b/src/main/java/com/stripe/param/LoginLinkCreateOnAccountParams.java @@ -5,19 +5,32 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class LoginLinkCreateOnAccountParams extends ApiRequestParams { /** 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; + /** Where to redirect the user after they log out of their dashboard. */ @SerializedName("redirect_url") String redirectUrl; - private LoginLinkCreateOnAccountParams(List expand, String redirectUrl) { + private LoginLinkCreateOnAccountParams( + List expand, Map extraParams, String redirectUrl) { this.expand = expand; + this.extraParams = extraParams; this.redirectUrl = redirectUrl; } @@ -28,11 +41,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String redirectUrl; /** Finalize and obtain parameter instance from this builder. */ public LoginLinkCreateOnAccountParams build() { - return new LoginLinkCreateOnAccountParams(this.expand, this.redirectUrl); + return new LoginLinkCreateOnAccountParams(this.expand, this.extraParams, this.redirectUrl); } /** @@ -61,6 +76,32 @@ public Builder addAllExpand(List 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 + * LoginLinkCreateOnAccountParams#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 LoginLinkCreateOnAccountParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Where to redirect the user after they log out of their dashboard. */ public Builder setRedirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; diff --git a/src/main/java/com/stripe/param/OrderCreateParams.java b/src/main/java/com/stripe/param/OrderCreateParams.java index b919abb9d5c..91a4d778273 100644 --- a/src/main/java/com/stripe/param/OrderCreateParams.java +++ b/src/main/java/com/stripe/param/OrderCreateParams.java @@ -42,6 +42,15 @@ public class OrderCreateParams extends ApiRequestParams { @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; + /** List of items constituting the order. An order can have up to 25 items. */ @SerializedName("items") List items; @@ -67,6 +76,7 @@ private OrderCreateParams( String customer, String email, List expand, + Map extraParams, List items, Map metadata, Shipping shipping) { @@ -75,6 +85,7 @@ private OrderCreateParams( this.customer = customer; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.items = items; this.metadata = metadata; this.shipping = shipping; @@ -95,6 +106,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List items; private Map metadata; @@ -109,6 +122,7 @@ public OrderCreateParams build() { this.customer, this.email, this.expand, + this.extraParams, this.items, this.metadata, this.shipping); @@ -175,6 +189,32 @@ public Builder addAllExpand(List 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 + * OrderCreateParams#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 OrderCreateParams#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 an element to `items` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -247,6 +287,15 @@ public static class Item { @SerializedName("description") String description; + /** + * 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; + /** The ID of the SKU being ordered. */ @SerializedName("parent") String parent; @@ -262,10 +311,17 @@ public static class Item { Type type; private Item( - Long amount, String currency, String description, String parent, Long quantity, Type type) { + Long amount, + String currency, + String description, + Map extraParams, + String parent, + Long quantity, + Type type) { this.amount = amount; this.currency = currency; this.description = description; + this.extraParams = extraParams; this.parent = parent; this.quantity = quantity; this.type = type; @@ -282,6 +338,8 @@ public static class Builder { private String description; + private Map extraParams; + private String parent; private Long quantity; @@ -291,7 +349,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Item build() { return new Item( - this.amount, this.currency, this.description, this.parent, this.quantity, this.type); + this.amount, + this.currency, + this.description, + this.extraParams, + this.parent, + this.quantity, + this.type); } public Builder setAmount(Long amount) { @@ -309,6 +373,32 @@ public Builder setDescription(String description) { 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 + * OrderCreateParams.Item#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 OrderCreateParams.Item#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The ID of the SKU being ordered. */ public Builder setParent(String parent) { this.parent = parent; @@ -357,6 +447,15 @@ public static class Shipping { @SerializedName("address") Address address; + /** + * 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; + /** Customer name. */ @SerializedName("name") String name; @@ -365,8 +464,9 @@ public static class Shipping { @SerializedName("phone") String phone; - private Shipping(Address address, String name, String phone) { + private Shipping(Address address, Map extraParams, String name, String phone) { this.address = address; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -378,13 +478,15 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.name, this.phone); + return new Shipping(this.address, this.extraParams, this.name, this.phone); } /** Customer shipping address. */ @@ -393,6 +495,32 @@ public Builder setAddress(Address address) { 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 + * OrderCreateParams.Shipping#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 OrderCreateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Customer name. */ public Builder setName(String name) { this.name = name; @@ -413,6 +541,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -428,12 +565,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -449,6 +588,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -460,7 +601,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -473,6 +620,34 @@ public Builder setCountry(String 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 OrderCreateParams.Shipping.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 OrderCreateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/OrderListParams.java b/src/main/java/com/stripe/param/OrderListParams.java index 85119a324e5..98955d54bd5 100644 --- a/src/main/java/com/stripe/param/OrderListParams.java +++ b/src/main/java/com/stripe/param/OrderListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class OrderListParams extends ApiRequestParams { /** Date this order was created. */ @@ -29,6 +31,15 @@ public class OrderListParams extends ApiRequestParams { @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; + /** Only return orders with the given IDs. */ @SerializedName("ids") List ids; @@ -69,6 +80,7 @@ private OrderListParams( String customer, String endingBefore, List expand, + Map extraParams, List ids, Long limit, String startingAfter, @@ -79,6 +91,7 @@ private OrderListParams( this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.ids = ids; this.limit = limit; this.startingAfter = startingAfter; @@ -100,6 +113,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List ids; private Long limit; @@ -119,6 +134,7 @@ public OrderListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.ids, this.limit, this.startingAfter, @@ -182,6 +198,32 @@ public Builder addAllExpand(List 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 + * OrderListParams#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 OrderListParams#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 an element to `ids` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -271,6 +313,15 @@ public Builder addAllUpstreamId(List elements) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -287,7 +338,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -299,6 +351,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -309,7 +363,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * OrderListParams.Created#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 OrderListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -343,6 +423,15 @@ public static class StatusTransitions { @SerializedName("canceled") Object canceled; + /** + * 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; + /** Date this order was fulfilled. */ @SerializedName("fulfilled") Object fulfilled; @@ -355,8 +444,14 @@ public static class StatusTransitions { @SerializedName("returned") Object returned; - private StatusTransitions(Object canceled, Object fulfilled, Object paid, Object returned) { + private StatusTransitions( + Object canceled, + Map extraParams, + Object fulfilled, + Object paid, + Object returned) { this.canceled = canceled; + this.extraParams = extraParams; this.fulfilled = fulfilled; this.paid = paid; this.returned = returned; @@ -369,6 +464,8 @@ public static Builder builder() { public static class Builder { private Object canceled; + private Map extraParams; + private Object fulfilled; private Object paid; @@ -377,7 +474,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public StatusTransitions build() { - return new StatusTransitions(this.canceled, this.fulfilled, this.paid, this.returned); + return new StatusTransitions( + this.canceled, this.extraParams, this.fulfilled, this.paid, this.returned); } /** Date this order was canceled. */ @@ -392,6 +490,32 @@ public Builder setCanceled(Long canceled) { 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 + * OrderListParams.StatusTransitions#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 OrderListParams.StatusTransitions#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Date this order was fulfilled. */ public Builder setFulfilled(Fulfilled fulfilled) { this.fulfilled = fulfilled; @@ -430,6 +554,15 @@ public Builder setReturned(Long returned) { } public static class Canceled { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -446,7 +579,8 @@ public static class Canceled { @SerializedName("lte") Long lte; - private Canceled(Long gt, Long gte, Long lt, Long lte) { + private Canceled(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -458,6 +592,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -468,7 +604,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Canceled build() { - return new Canceled(this.gt, this.gte, this.lt, this.lte); + return new Canceled(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 OrderListParams.StatusTransitions.Canceled#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 OrderListParams.StatusTransitions.Canceled#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -498,6 +662,15 @@ public Builder setLte(Long lte) { } public static class Fulfilled { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -514,7 +687,8 @@ public static class Fulfilled { @SerializedName("lte") Long lte; - private Fulfilled(Long gt, Long gte, Long lt, Long lte) { + private Fulfilled(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -526,6 +700,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -536,7 +712,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Fulfilled build() { - return new Fulfilled(this.gt, this.gte, this.lt, this.lte); + return new Fulfilled(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 OrderListParams.StatusTransitions.Fulfilled#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 OrderListParams.StatusTransitions.Fulfilled#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -566,6 +770,15 @@ public Builder setLte(Long lte) { } public static class Paid { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -582,7 +795,8 @@ public static class Paid { @SerializedName("lte") Long lte; - private Paid(Long gt, Long gte, Long lt, Long lte) { + private Paid(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -594,6 +808,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -604,7 +820,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Paid build() { - return new Paid(this.gt, this.gte, this.lt, this.lte); + return new Paid(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 OrderListParams.StatusTransitions.Paid#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 OrderListParams.StatusTransitions.Paid#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -634,6 +878,15 @@ public Builder setLte(Long lte) { } public static class Returned { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -650,7 +903,8 @@ public static class Returned { @SerializedName("lte") Long lte; - private Returned(Long gt, Long gte, Long lt, Long lte) { + private Returned(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -662,6 +916,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -672,7 +928,35 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Returned build() { - return new Returned(this.gt, this.gte, this.lt, this.lte); + return new Returned(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 OrderListParams.StatusTransitions.Returned#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 OrderListParams.StatusTransitions.Returned#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/OrderPayParams.java b/src/main/java/com/stripe/param/OrderPayParams.java index a9321b754af..62b87b14c6f 100644 --- a/src/main/java/com/stripe/param/OrderPayParams.java +++ b/src/main/java/com/stripe/param/OrderPayParams.java @@ -32,6 +32,15 @@ public class OrderPayParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to an order object. Limited to 500 characters. * Metadata can be useful for storing additional information about the order in a structured @@ -55,12 +64,14 @@ private OrderPayParams( String customer, String email, List expand, + Map extraParams, Map metadata, String source) { this.applicationFee = applicationFee; this.customer = customer; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.source = source; } @@ -78,6 +89,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String source; @@ -85,7 +98,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OrderPayParams build() { return new OrderPayParams( - this.applicationFee, this.customer, this.email, this.expand, this.metadata, this.source); + this.applicationFee, + this.customer, + this.email, + this.expand, + this.extraParams, + this.metadata, + this.source); } public Builder setApplicationFee(Long applicationFee) { @@ -138,6 +157,32 @@ public Builder addAllExpand(List 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 + * OrderPayParams#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 OrderPayParams#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 diff --git a/src/main/java/com/stripe/param/OrderRetrieveParams.java b/src/main/java/com/stripe/param/OrderRetrieveParams.java index e8b93a0cf25..48a7be1f062 100644 --- a/src/main/java/com/stripe/param/OrderRetrieveParams.java +++ b/src/main/java/com/stripe/param/OrderRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class OrderRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private OrderRetrieveParams(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; + + private OrderRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public OrderRetrieveParams build() { - return new OrderRetrieveParams(this.expand); + return new OrderRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * OrderRetrieveParams#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 OrderRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/OrderReturnListParams.java b/src/main/java/com/stripe/param/OrderReturnListParams.java index 50a6773b632..bf8a5b4bd18 100644 --- a/src/main/java/com/stripe/param/OrderReturnListParams.java +++ b/src/main/java/com/stripe/param/OrderReturnListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class OrderReturnListParams extends ApiRequestParams { /** Date this return was created. */ @@ -25,6 +27,15 @@ public class OrderReturnListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -49,12 +60,14 @@ private OrderReturnListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String order, String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.order = order; this.startingAfter = startingAfter; @@ -71,6 +84,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String order; @@ -80,7 +95,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OrderReturnListParams build() { return new OrderReturnListParams( - this.created, this.endingBefore, this.expand, this.limit, this.order, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.order, + this.startingAfter); } /** Date this return was created. */ @@ -132,6 +153,32 @@ public Builder addAllExpand(List 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 + * OrderReturnListParams#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 OrderReturnListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -160,6 +207,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -176,7 +232,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -188,6 +245,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -198,7 +257,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * OrderReturnListParams.Created#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 OrderReturnListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/OrderReturnOrderParams.java b/src/main/java/com/stripe/param/OrderReturnOrderParams.java index 9d26add4a16..106b8035c84 100644 --- a/src/main/java/com/stripe/param/OrderReturnOrderParams.java +++ b/src/main/java/com/stripe/param/OrderReturnOrderParams.java @@ -6,7 +6,9 @@ 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; import lombok.Getter; public class OrderReturnOrderParams extends ApiRequestParams { @@ -14,12 +16,23 @@ public class OrderReturnOrderParams extends ApiRequestParams { @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; + /** List of items to return. */ @SerializedName("items") Object items; - private OrderReturnOrderParams(List expand, Object items) { + private OrderReturnOrderParams( + List expand, Map extraParams, Object items) { this.expand = expand; + this.extraParams = extraParams; this.items = items; } @@ -30,11 +43,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Object items; /** Finalize and obtain parameter instance from this builder. */ public OrderReturnOrderParams build() { - return new OrderReturnOrderParams(this.expand, this.items); + return new OrderReturnOrderParams(this.expand, this.extraParams, this.items); } /** @@ -63,6 +78,32 @@ public Builder addAllExpand(List 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 + * OrderReturnOrderParams#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 OrderReturnOrderParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** List of items to return. */ public Builder setItems(EmptyParam items) { this.items = items; @@ -85,6 +126,15 @@ public static class Item { @SerializedName("description") String description; + /** + * 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; + /** The ID of the SKU, tax, or shipping item being returned. */ @SerializedName("parent") String parent; @@ -97,9 +147,16 @@ public static class Item { @SerializedName("type") Type type; - private Item(Long amount, String description, String parent, Long quantity, Type type) { + private Item( + Long amount, + String description, + Map extraParams, + String parent, + Long quantity, + Type type) { this.amount = amount; this.description = description; + this.extraParams = extraParams; this.parent = parent; this.quantity = quantity; this.type = type; @@ -114,6 +171,8 @@ public static class Builder { private String description; + private Map extraParams; + private String parent; private Long quantity; @@ -122,7 +181,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Item build() { - return new Item(this.amount, this.description, this.parent, this.quantity, this.type); + return new Item( + this.amount, this.description, this.extraParams, this.parent, this.quantity, this.type); } /** The amount (price) for this order item to return. */ @@ -137,6 +197,32 @@ public Builder setDescription(String description) { 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 + * OrderReturnOrderParams.Item#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 OrderReturnOrderParams.Item#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The ID of the SKU, tax, or shipping item being returned. */ public Builder setParent(String parent) { this.parent = parent; diff --git a/src/main/java/com/stripe/param/OrderReturnRetrieveParams.java b/src/main/java/com/stripe/param/OrderReturnRetrieveParams.java index 210534c2456..f1ff3762efe 100644 --- a/src/main/java/com/stripe/param/OrderReturnRetrieveParams.java +++ b/src/main/java/com/stripe/param/OrderReturnRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class OrderReturnRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private OrderReturnRetrieveParams(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; + + private OrderReturnRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public OrderReturnRetrieveParams build() { - return new OrderReturnRetrieveParams(this.expand); + return new OrderReturnRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * OrderReturnRetrieveParams#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 OrderReturnRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/OrderUpdateParams.java b/src/main/java/com/stripe/param/OrderUpdateParams.java index 84914e6bfc1..3cd8bd9d0ab 100644 --- a/src/main/java/com/stripe/param/OrderUpdateParams.java +++ b/src/main/java/com/stripe/param/OrderUpdateParams.java @@ -22,6 +22,15 @@ public class OrderUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a product object. It can be useful for storing * additional information about the order in a structured format. @@ -52,12 +61,14 @@ public class OrderUpdateParams extends ApiRequestParams { private OrderUpdateParams( String coupon, List expand, + Map extraParams, Map metadata, String selectedShippingMethod, Shipping shipping, Status status) { this.coupon = coupon; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.selectedShippingMethod = selectedShippingMethod; this.shipping = shipping; @@ -73,6 +84,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String selectedShippingMethod; @@ -86,6 +99,7 @@ public OrderUpdateParams build() { return new OrderUpdateParams( this.coupon, this.expand, + this.extraParams, this.metadata, this.selectedShippingMethod, this.shipping, @@ -127,6 +141,32 @@ public Builder addAllExpand(List 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 + * OrderUpdateParams#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 OrderUpdateParams#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 @@ -185,12 +225,22 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** The tracking number provided by the carrier. */ @SerializedName("tracking_number") String trackingNumber; - private Shipping(String carrier, String trackingNumber) { + private Shipping(String carrier, Map extraParams, String trackingNumber) { this.carrier = carrier; + this.extraParams = extraParams; this.trackingNumber = trackingNumber; } @@ -201,11 +251,13 @@ public static Builder builder() { public static class Builder { private String carrier; + private Map extraParams; + private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.carrier, this.trackingNumber); + return new Shipping(this.carrier, this.extraParams, this.trackingNumber); } /** The name of the carrier like `USPS`, `UPS`, or `FedEx`. */ @@ -214,6 +266,32 @@ public Builder setCarrier(String carrier) { 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 + * OrderUpdateParams.Shipping#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 OrderUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The tracking number provided by the carrier. */ public Builder setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; diff --git a/src/main/java/com/stripe/param/PaymentIntentCancelParams.java b/src/main/java/com/stripe/param/PaymentIntentCancelParams.java index a3c8e25394c..444a09592ec 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCancelParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCancelParams.java @@ -5,13 +5,15 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class PaymentIntentCancelParams extends ApiRequestParams { /** * Reason for canceling this PaymentIntent. If set, possible values are `duplicate`, `fraudulent`, - * `requested_by_customer`, or `failed_invoice` + * or `requested_by_customer` */ @SerializedName("cancellation_reason") CancellationReason cancellationReason; @@ -20,9 +22,20 @@ public class PaymentIntentCancelParams extends ApiRequestParams { @SerializedName("expand") List expand; - private PaymentIntentCancelParams(CancellationReason cancellationReason, 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; + + private PaymentIntentCancelParams( + CancellationReason cancellationReason, List expand, Map extraParams) { this.cancellationReason = cancellationReason; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -34,14 +47,16 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCancelParams build() { - return new PaymentIntentCancelParams(this.cancellationReason, this.expand); + return new PaymentIntentCancelParams(this.cancellationReason, this.expand, this.extraParams); } /** * Reason for canceling this PaymentIntent. If set, possible values are `duplicate`, - * `fraudulent`, `requested_by_customer`, or `failed_invoice` + * `fraudulent`, or `requested_by_customer` */ public Builder setCancellationReason(CancellationReason cancellationReason) { this.cancellationReason = cancellationReason; @@ -73,6 +88,32 @@ public Builder addAllExpand(List elements) { 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 + * PaymentIntentCancelParams#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 PaymentIntentCancelParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } public enum CancellationReason implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index 237d711ea4d..bb76395fc3e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentIntentCaptureParams extends ApiRequestParams { /** @@ -28,11 +30,24 @@ public class PaymentIntentCaptureParams extends ApiRequestParams { @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; + private PaymentIntentCaptureParams( - Long amountToCapture, Long applicationFeeAmount, List expand) { + Long amountToCapture, + Long applicationFeeAmount, + List expand, + Map extraParams) { this.amountToCapture = amountToCapture; this.applicationFeeAmount = applicationFeeAmount; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -46,10 +61,12 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCaptureParams build() { return new PaymentIntentCaptureParams( - this.amountToCapture, this.applicationFeeAmount, this.expand); + this.amountToCapture, this.applicationFeeAmount, this.expand, this.extraParams); } /** @@ -97,5 +114,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentIntentCaptureParams#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 PaymentIntentCaptureParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 4590151c2c5..161854d0a1e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -6,13 +6,24 @@ 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 PaymentIntentConfirmParams extends ApiRequestParams { /** 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; + /** ID of the payment method to attach to this PaymentIntent. */ @SerializedName("payment_method") String paymentMethod; @@ -31,11 +42,13 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { String returnUrl; /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or `payment_method`) - * to the associated customer. If the payment method is already attached, this parameter does - * nothing. This parameter defaults to `false` and applies to the payment method passed in the - * same request or the current payment method attached to the PaymentIntent and must be specified - * again if a new payment method is added. + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method + * passed in the same request or the current payment method attached to the PaymentIntent and must + * be specified again if a new payment method is added. */ @SerializedName("save_payment_method") Boolean savePaymentMethod; @@ -50,6 +63,7 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { private PaymentIntentConfirmParams( List expand, + Map extraParams, String paymentMethod, String receiptEmail, String returnUrl, @@ -57,6 +71,7 @@ private PaymentIntentConfirmParams( Object shipping, String source) { this.expand = expand; + this.extraParams = extraParams; this.paymentMethod = paymentMethod; this.receiptEmail = receiptEmail; this.returnUrl = returnUrl; @@ -72,6 +87,8 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String paymentMethod; private String receiptEmail; @@ -88,6 +105,7 @@ public static class Builder { public PaymentIntentConfirmParams build() { return new PaymentIntentConfirmParams( this.expand, + this.extraParams, this.paymentMethod, this.receiptEmail, this.returnUrl, @@ -122,6 +140,32 @@ public Builder addAllExpand(List 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 + * PaymentIntentConfirmParams#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 PaymentIntentConfirmParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** ID of the payment method to attach to this PaymentIntent. */ public Builder setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -146,9 +190,11 @@ public Builder setReturnUrl(String returnUrl) { } /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or - * `payment_method`) to the associated customer. If the payment method is already attached, this - * parameter does nothing. This parameter defaults to `false` and applies to the payment method + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method * passed in the same request or the current payment method attached to the PaymentIntent and * must be specified again if a new payment method is added. */ @@ -185,6 +231,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -201,9 +256,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -218,6 +279,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -226,7 +289,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.carrier, this.name, this.phone, this.trackingNumber); + return new Shipping( + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -241,6 +310,32 @@ public Builder setCarrier(String carrier) { 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 + * PaymentIntentConfirmParams.Shipping#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 PaymentIntentConfirmParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -270,6 +365,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -285,12 +389,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -306,6 +412,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -317,7 +425,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -330,6 +444,34 @@ public Builder setCountry(String 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 PaymentIntentConfirmParams.Shipping.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 PaymentIntentConfirmParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 7ae383d6b27..0400cda2f53 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -77,6 +77,15 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @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. @@ -115,11 +124,13 @@ public class PaymentIntentCreateParams extends ApiRequestParams { String returnUrl; /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or `payment_method`) - * to the associated customer. If the payment method is already attached, this parameter does - * nothing. This parameter defaults to `false` and applies to the payment method passed in the - * same request or the current payment method attached to the PaymentIntent and must be specified - * again if a new payment method is added. + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method + * passed in the same request or the current payment method attached to the PaymentIntent and must + * be specified again if a new payment method is added. */ @SerializedName("save_payment_method") Boolean savePaymentMethod; @@ -165,6 +176,7 @@ private PaymentIntentCreateParams( String customer, String description, List expand, + Map extraParams, Map metadata, String onBehalfOf, String paymentMethod, @@ -186,6 +198,7 @@ private PaymentIntentCreateParams( this.customer = customer; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.paymentMethod = paymentMethod; @@ -223,6 +236,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String onBehalfOf; @@ -259,6 +274,7 @@ public PaymentIntentCreateParams build() { this.customer, this.description, this.expand, + this.extraParams, this.metadata, this.onBehalfOf, this.paymentMethod, @@ -377,6 +393,32 @@ public Builder addAllExpand(List 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 + * PaymentIntentCreateParams#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 PaymentIntentCreateParams#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 @@ -462,9 +504,11 @@ public Builder setReturnUrl(String returnUrl) { } /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or - * `payment_method`) to the associated customer. If the payment method is already attached, this - * parameter does nothing. This parameter defaults to `false` and applies to the payment method + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method * passed in the same request or the current payment method attached to the PaymentIntent and * must be specified again if a new payment method is added. */ @@ -524,6 +568,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -540,9 +593,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -557,6 +616,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -565,7 +626,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.carrier, this.name, this.phone, this.trackingNumber); + return new Shipping( + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -580,6 +647,32 @@ public Builder setCarrier(String carrier) { 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 + * PaymentIntentCreateParams.Shipping#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 PaymentIntentCreateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -609,6 +702,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -624,12 +726,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -645,6 +749,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -656,7 +762,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -669,6 +781,34 @@ public Builder setCountry(String 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 PaymentIntentCreateParams.Shipping.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 PaymentIntentCreateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -701,8 +841,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -712,9 +862,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** @@ -726,6 +878,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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 + * PaymentIntentCreateParams.TransferData#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 PaymentIntentCreateParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentIntentListParams.java b/src/main/java/com/stripe/param/PaymentIntentListParams.java index 75e3aea01b9..3c8b4b1117d 100644 --- a/src/main/java/com/stripe/param/PaymentIntentListParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentIntentListParams extends ApiRequestParams { /** @@ -32,6 +34,15 @@ public class PaymentIntentListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -53,12 +64,14 @@ private PaymentIntentListParams( String customer, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.created = created; this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -76,6 +89,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -87,6 +102,7 @@ public PaymentIntentListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -152,6 +168,32 @@ public Builder addAllExpand(List 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 + * PaymentIntentListParams#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 PaymentIntentListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -174,6 +216,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -190,7 +241,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -202,6 +254,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -212,7 +266,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * PaymentIntentListParams.Created#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 PaymentIntentListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/PaymentIntentRetrieveParams.java b/src/main/java/com/stripe/param/PaymentIntentRetrieveParams.java index 29b1b466ca9..ccefb16da6a 100644 --- a/src/main/java/com/stripe/param/PaymentIntentRetrieveParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentRetrieveParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentIntentRetrieveParams extends ApiRequestParams { /** @@ -19,9 +21,20 @@ public class PaymentIntentRetrieveParams extends ApiRequestParams { @SerializedName("expand") List expand; - private PaymentIntentRetrieveParams(String clientSecret, 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; + + private PaymentIntentRetrieveParams( + String clientSecret, List expand, Map extraParams) { this.clientSecret = clientSecret; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -33,9 +46,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentRetrieveParams build() { - return new PaymentIntentRetrieveParams(this.clientSecret, this.expand); + return new PaymentIntentRetrieveParams(this.clientSecret, this.expand, this.extraParams); } /** @@ -72,5 +87,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentIntentRetrieveParams#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 PaymentIntentRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index ea076ebf458..eb01fb2aa46 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -42,6 +42,15 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { @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. @@ -62,11 +71,13 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { String receiptEmail; /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or `payment_method`) - * to the associated customer. If the payment method is already attached, this parameter does - * nothing. This parameter defaults to `false` and applies to the payment method passed in the - * same request or the current payment method attached to the PaymentIntent and must be specified - * again if a new payment method is added. + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method + * passed in the same request or the current payment method attached to the PaymentIntent and must + * be specified again if a new payment method is added. */ @SerializedName("save_payment_method") Boolean savePaymentMethod; @@ -101,6 +112,7 @@ private PaymentIntentUpdateParams( String customer, String description, List expand, + Map extraParams, Map metadata, String paymentMethod, List paymentMethodTypes, @@ -116,6 +128,7 @@ private PaymentIntentUpdateParams( this.customer = customer; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.paymentMethod = paymentMethod; this.paymentMethodTypes = paymentMethodTypes; @@ -144,6 +157,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String paymentMethod; @@ -171,6 +186,7 @@ public PaymentIntentUpdateParams build() { this.customer, this.description, this.expand, + this.extraParams, this.metadata, this.paymentMethod, this.paymentMethodTypes, @@ -255,6 +271,32 @@ public Builder addAllExpand(List 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 + * PaymentIntentUpdateParams#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 PaymentIntentUpdateParams#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 @@ -320,9 +362,11 @@ public Builder setReceiptEmail(String receiptEmail) { } /** - * Set to `true` to save the PaymentIntent's payment method (either `source` or - * `payment_method`) to the associated customer. If the payment method is already attached, this - * parameter does nothing. This parameter defaults to `false` and applies to the payment method + * Set to `true` to [save the PaymentIntent's payment + * method](https://stripe.com/docs/payments/payment-methods/saving) (either `source` or + * `payment_method`) to the associated customer. Defaults to `false`. If the payment method is + * already attached, this parameter does nothing. This parameter errors for payment methods that + * are not permitted to be attached to customers. The parameter applies to the payment method * passed in the same request or the current payment method attached to the PaymentIntent and * must be specified again if a new payment method is added. */ @@ -378,6 +422,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -394,9 +447,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -411,6 +470,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -419,7 +480,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.carrier, this.name, this.phone, this.trackingNumber); + return new Shipping( + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -434,6 +501,32 @@ public Builder setCarrier(String carrier) { 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 + * PaymentIntentUpdateParams.Shipping#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 PaymentIntentUpdateParams.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -463,6 +556,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -478,12 +580,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -499,6 +603,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -510,7 +616,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -523,6 +635,34 @@ public Builder setCountry(String 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 PaymentIntentUpdateParams.Shipping.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 PaymentIntentUpdateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/PaymentMethodAttachParams.java b/src/main/java/com/stripe/param/PaymentMethodAttachParams.java index 33933ba1de8..a57c6426108 100644 --- a/src/main/java/com/stripe/param/PaymentMethodAttachParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodAttachParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentMethodAttachParams extends ApiRequestParams { /** The ID of the customer to which to attach the PaymentMethod. */ @@ -16,9 +18,20 @@ public class PaymentMethodAttachParams extends ApiRequestParams { @SerializedName("expand") List expand; - private PaymentMethodAttachParams(String customer, 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; + + private PaymentMethodAttachParams( + String customer, List expand, Map extraParams) { this.customer = customer; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -30,9 +43,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodAttachParams build() { - return new PaymentMethodAttachParams(this.customer, this.expand); + return new PaymentMethodAttachParams(this.customer, this.expand, this.extraParams); } /** The ID of the customer to which to attach the PaymentMethod. */ @@ -66,5 +81,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentMethodAttachParams#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 PaymentMethodAttachParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 2a0957df018..8d9232185dd 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -37,6 +37,15 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @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. @@ -63,6 +72,7 @@ private PaymentMethodCreateParams( Object card, String customer, List expand, + Map extraParams, Map metadata, String paymentMethod, Type type) { @@ -70,6 +80,7 @@ private PaymentMethodCreateParams( this.card = card; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.paymentMethod = paymentMethod; this.type = type; @@ -88,6 +99,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String paymentMethod; @@ -101,6 +114,7 @@ public PaymentMethodCreateParams build() { this.card, this.customer, this.expand, + this.extraParams, this.metadata, this.paymentMethod, this.type); @@ -173,6 +187,32 @@ public Builder addAllExpand(List 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 + * PaymentMethodCreateParams#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 PaymentMethodCreateParams#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 @@ -227,6 +267,15 @@ public static class BillingDetails { @SerializedName("email") String 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") String name; @@ -235,9 +284,11 @@ public static class BillingDetails { @SerializedName("phone") String phone; - private BillingDetails(Address address, String email, String name, String phone) { + private BillingDetails( + Address address, String email, Map extraParams, String name, String phone) { this.address = address; this.email = email; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -251,13 +302,16 @@ public static class Builder { private String email; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public BillingDetails build() { - return new BillingDetails(this.address, this.email, this.name, this.phone); + return new BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ @@ -272,6 +326,33 @@ public Builder setEmail(String 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 + * PaymentMethodCreateParams.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 PaymentMethodCreateParams.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; @@ -292,6 +373,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -307,12 +397,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -328,6 +420,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -339,7 +433,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -352,6 +452,34 @@ public Builder setCountry(String 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 PaymentMethodCreateParams.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 PaymentMethodCreateParams.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -388,14 +516,25 @@ public static class CardDetails { @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; + /** The card number, as a string without any separators. */ @SerializedName("number") String number; - private CardDetails(String cvc, Long expMonth, Long expYear, String number) { + private CardDetails( + String cvc, Long expMonth, Long expYear, Map extraParams, String number) { this.cvc = cvc; this.expMonth = expMonth; this.expYear = expYear; + this.extraParams = extraParams; this.number = number; } @@ -410,11 +549,14 @@ public static class Builder { private Long expYear; + private Map extraParams; + private String number; /** Finalize and obtain parameter instance from this builder. */ public CardDetails build() { - return new CardDetails(this.cvc, this.expMonth, this.expYear, this.number); + return new CardDetails( + this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); } /** The card's CVC. It is highly recommended to always include this value. */ @@ -435,6 +577,32 @@ public Builder setExpYear(Long 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 + * PaymentMethodCreateParams.CardDetails#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 PaymentMethodCreateParams.CardDetails#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The card number, as a string without any separators. */ public Builder setNumber(String number) { this.number = number; @@ -444,10 +612,20 @@ public Builder setNumber(String number) { } public static class Token { + /** + * 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; + @SerializedName("token") String token; - private Token(String token) { + private Token(Map extraParams, String token) { + this.extraParams = extraParams; this.token = token; } @@ -456,11 +634,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String token; /** Finalize and obtain parameter instance from this builder. */ public Token build() { - return new Token(this.token); + return new Token(this.extraParams, this.token); + } + + /** + * 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 + * PaymentMethodCreateParams.Token#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 PaymentMethodCreateParams.Token#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } public Builder setToken(String token) { diff --git a/src/main/java/com/stripe/param/PaymentMethodDetachParams.java b/src/main/java/com/stripe/param/PaymentMethodDetachParams.java index 1f97f8305a5..65b10534134 100644 --- a/src/main/java/com/stripe/param/PaymentMethodDetachParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodDetachParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentMethodDetachParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PaymentMethodDetachParams(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; + + private PaymentMethodDetachParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodDetachParams build() { - return new PaymentMethodDetachParams(this.expand); + return new PaymentMethodDetachParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentMethodDetachParams#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 PaymentMethodDetachParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index d47264d8dea..33df3416efc 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class PaymentMethodListParams extends ApiRequestParams { @@ -26,6 +28,15 @@ public class PaymentMethodListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -50,12 +61,14 @@ private PaymentMethodListParams( String customer, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, Type type) { this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.type = type; @@ -72,6 +85,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -81,7 +96,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodListParams build() { return new PaymentMethodListParams( - this.customer, this.endingBefore, this.expand, this.limit, this.startingAfter, this.type); + this.customer, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.type); } /** The ID of the customer whose PaymentMethods will be retrieved. */ @@ -127,6 +148,32 @@ public Builder addAllExpand(List 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 + * PaymentMethodListParams#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 PaymentMethodListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/PaymentMethodRetrieveParams.java b/src/main/java/com/stripe/param/PaymentMethodRetrieveParams.java index 1b25384d442..1f6da0041f4 100644 --- a/src/main/java/com/stripe/param/PaymentMethodRetrieveParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentMethodRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PaymentMethodRetrieveParams(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; + + private PaymentMethodRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodRetrieveParams build() { - return new PaymentMethodRetrieveParams(this.expand); + return new PaymentMethodRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentMethodRetrieveParams#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 PaymentMethodRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java index d12156d17ed..4fd5d71b98d 100644 --- a/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java @@ -24,6 +24,15 @@ public class PaymentMethodUpdateParams extends ApiRequestParams { @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. @@ -32,10 +41,15 @@ public class PaymentMethodUpdateParams extends ApiRequestParams { Map metadata; private PaymentMethodUpdateParams( - BillingDetails billingDetails, Card card, List expand, Map metadata) { + BillingDetails billingDetails, + Card card, + List expand, + Map extraParams, + Map metadata) { this.billingDetails = billingDetails; this.card = card; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -50,12 +64,14 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public PaymentMethodUpdateParams build() { return new PaymentMethodUpdateParams( - this.billingDetails, this.card, this.expand, this.metadata); + this.billingDetails, this.card, this.expand, this.extraParams, this.metadata); } /** @@ -98,6 +114,32 @@ public Builder addAllExpand(List 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 @@ -134,6 +176,15 @@ public static class BillingDetails { @SerializedName("email") String 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") String name; @@ -142,9 +193,11 @@ public static class BillingDetails { @SerializedName("phone") String phone; - private BillingDetails(Address address, String email, String name, String phone) { + private BillingDetails( + Address address, String email, Map extraParams, String name, String phone) { this.address = address; this.email = email; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -158,13 +211,16 @@ public static class Builder { private String email; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public BillingDetails build() { - return new BillingDetails(this.address, this.email, this.name, this.phone); + return new BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); } /** Billing address. */ @@ -179,6 +235,33 @@ public Builder setEmail(String 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; @@ -199,6 +282,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -214,12 +306,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -235,6 +329,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -246,7 +342,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -259,6 +361,34 @@ public Builder setCountry(String 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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -291,9 +421,19 @@ public static class Card { @SerializedName("exp_year") Long expYear; - private Card(Long expMonth, 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() { @@ -305,9 +445,11 @@ public static class Builder { private Long expYear; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Card build() { - return new Card(this.expMonth, this.expYear); + return new Card(this.expMonth, this.expYear, this.extraParams); } /** Two-digit number representing the card's expiration month. */ @@ -321,6 +463,32 @@ 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; + } + + /** + * 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 Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } } diff --git a/src/main/java/com/stripe/param/PaymentSourceCollectionCreateParams.java b/src/main/java/com/stripe/param/PaymentSourceCollectionCreateParams.java index d8b7597e881..5806946b2e5 100644 --- a/src/main/java/com/stripe/param/PaymentSourceCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentSourceCollectionCreateParams.java @@ -14,6 +14,15 @@ public class PaymentSourceCollectionCreateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a card object. It can be useful for storing * additional information about the card in a structured format. @@ -26,8 +35,12 @@ public class PaymentSourceCollectionCreateParams extends ApiRequestParams { String source; private PaymentSourceCollectionCreateParams( - List expand, Map metadata, String source) { + List expand, + Map extraParams, + Map metadata, + String source) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.source = source; } @@ -39,13 +52,16 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String source; /** Finalize and obtain parameter instance from this builder. */ public PaymentSourceCollectionCreateParams build() { - return new PaymentSourceCollectionCreateParams(this.expand, this.metadata, this.source); + return new PaymentSourceCollectionCreateParams( + this.expand, this.extraParams, this.metadata, this.source); } /** @@ -74,6 +90,32 @@ public Builder addAllExpand(List 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 + * PaymentSourceCollectionCreateParams#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 PaymentSourceCollectionCreateParams#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 diff --git a/src/main/java/com/stripe/param/PaymentSourceCollectionListParams.java b/src/main/java/com/stripe/param/PaymentSourceCollectionListParams.java index 80df90849b7..196d7f54cdc 100644 --- a/src/main/java/com/stripe/param/PaymentSourceCollectionListParams.java +++ b/src/main/java/com/stripe/param/PaymentSourceCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentSourceCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class PaymentSourceCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -42,9 +53,15 @@ public class PaymentSourceCollectionListParams extends ApiRequestParams { String startingAfter; private PaymentSourceCollectionListParams( - String endingBefore, List expand, Long limit, String object, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String object, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.object = object; this.startingAfter = startingAfter; @@ -59,6 +76,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String object; @@ -68,7 +87,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentSourceCollectionListParams build() { return new PaymentSourceCollectionListParams( - this.endingBefore, this.expand, this.limit, this.object, this.startingAfter); + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.object, + this.startingAfter); } /** @@ -108,6 +132,32 @@ public Builder addAllExpand(List 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 + * PaymentSourceCollectionListParams#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 PaymentSourceCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/PaymentSourceCollectionRetrieveParams.java b/src/main/java/com/stripe/param/PaymentSourceCollectionRetrieveParams.java index a0d7df59928..dfe29f8a421 100644 --- a/src/main/java/com/stripe/param/PaymentSourceCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/PaymentSourceCollectionRetrieveParams.java @@ -5,15 +5,28 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PaymentSourceCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PaymentSourceCollectionRetrieveParams(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; + + private PaymentSourceCollectionRetrieveParams( + List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +36,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PaymentSourceCollectionRetrieveParams build() { - return new PaymentSourceCollectionRetrieveParams(this.expand); + return new PaymentSourceCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +68,31 @@ public Builder addAllExpand(List elements) { 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 + * PaymentSourceCollectionRetrieveParams#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 PaymentSourceCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PayoutCancelParams.java b/src/main/java/com/stripe/param/PayoutCancelParams.java index 3321ce35508..1ac46d5b753 100644 --- a/src/main/java/com/stripe/param/PayoutCancelParams.java +++ b/src/main/java/com/stripe/param/PayoutCancelParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PayoutCancelParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PayoutCancelParams(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; + + private PayoutCancelParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PayoutCancelParams build() { - return new PayoutCancelParams(this.expand); + return new PayoutCancelParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PayoutCancelParams#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 PayoutCancelParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PayoutCreateParams.java b/src/main/java/com/stripe/param/PayoutCreateParams.java index 26a9f51efc9..7d2d9d950c8 100644 --- a/src/main/java/com/stripe/param/PayoutCreateParams.java +++ b/src/main/java/com/stripe/param/PayoutCreateParams.java @@ -37,6 +37,15 @@ public class PayoutCreateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a payout object. It can be useful for storing * additional information about the payout in a structured format. @@ -74,6 +83,7 @@ private PayoutCreateParams( String description, String destination, List expand, + Map extraParams, Map metadata, Method method, SourceType sourceType, @@ -83,6 +93,7 @@ private PayoutCreateParams( this.description = description; this.destination = destination; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.method = method; this.sourceType = sourceType; @@ -104,6 +115,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Method method; @@ -120,6 +133,7 @@ public PayoutCreateParams build() { this.description, this.destination, this.expand, + this.extraParams, this.metadata, this.method, this.sourceType, @@ -182,6 +196,32 @@ public Builder addAllExpand(List 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 + * PayoutCreateParams#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 PayoutCreateParams#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 diff --git a/src/main/java/com/stripe/param/PayoutListParams.java b/src/main/java/com/stripe/param/PayoutListParams.java index a383c3ba314..da6bd61dc90 100644 --- a/src/main/java/com/stripe/param/PayoutListParams.java +++ b/src/main/java/com/stripe/param/PayoutListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PayoutListParams extends ApiRequestParams { @SerializedName("arrival_date") @@ -31,6 +33,15 @@ public class PayoutListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -57,6 +68,7 @@ private PayoutListParams( String destination, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, String status) { @@ -65,6 +77,7 @@ private PayoutListParams( this.destination = destination; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.status = status; @@ -85,6 +98,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -99,6 +114,7 @@ public PayoutListParams build() { this.destination, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.status); @@ -167,6 +183,32 @@ public Builder addAllExpand(List 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 + * PayoutListParams#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 PayoutListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -197,6 +239,15 @@ public Builder setStatus(String status) { } public static class ArrivalDate { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -213,7 +264,8 @@ public static class ArrivalDate { @SerializedName("lte") Long lte; - private ArrivalDate(Long gt, Long gte, Long lt, Long lte) { + private ArrivalDate(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -225,6 +277,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -235,7 +289,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ArrivalDate build() { - return new ArrivalDate(this.gt, this.gte, this.lt, this.lte); + return new ArrivalDate(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * PayoutListParams.ArrivalDate#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 PayoutListParams.ArrivalDate#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -265,6 +345,15 @@ public Builder setLte(Long lte) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -281,7 +370,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -293,6 +383,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -303,7 +395,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * PayoutListParams.Created#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 PayoutListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/PayoutRetrieveParams.java b/src/main/java/com/stripe/param/PayoutRetrieveParams.java index e3314846176..9202a5a2c27 100644 --- a/src/main/java/com/stripe/param/PayoutRetrieveParams.java +++ b/src/main/java/com/stripe/param/PayoutRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PayoutRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PayoutRetrieveParams(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; + + private PayoutRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PayoutRetrieveParams build() { - return new PayoutRetrieveParams(this.expand); + return new PayoutRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PayoutRetrieveParams#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 PayoutRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PayoutUpdateParams.java b/src/main/java/com/stripe/param/PayoutUpdateParams.java index e7fb51c4f70..599d943bbc4 100644 --- a/src/main/java/com/stripe/param/PayoutUpdateParams.java +++ b/src/main/java/com/stripe/param/PayoutUpdateParams.java @@ -14,6 +14,15 @@ public class PayoutUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a payout object. It can be useful for storing * additional information about the payout in a structured format. @@ -21,8 +30,10 @@ public class PayoutUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private PayoutUpdateParams(List expand, Map metadata) { + private PayoutUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -33,11 +44,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public PayoutUpdateParams build() { - return new PayoutUpdateParams(this.expand, this.metadata); + return new PayoutUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -66,6 +79,32 @@ public Builder addAllExpand(List 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 + * PayoutUpdateParams#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 PayoutUpdateParams#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 diff --git a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java index 90176d1cba1..c25f3678c0b 100644 --- a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java @@ -36,6 +36,15 @@ public class PersonCollectionCreateParams extends ApiRequestParams { @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; + /** The person's first name. */ @SerializedName("first_name") String firstName; @@ -115,6 +124,7 @@ private PersonCollectionCreateParams( Dob dob, String email, List expand, + Map extraParams, String firstName, String firstNameKana, String firstNameKanji, @@ -136,6 +146,7 @@ private PersonCollectionCreateParams( this.dob = dob; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.firstName = firstName; this.firstNameKana = firstNameKana; this.firstNameKanji = firstNameKanji; @@ -170,6 +181,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String firstName; private String firstNameKana; @@ -209,6 +222,7 @@ public PersonCollectionCreateParams build() { this.dob, this.email, this.expand, + this.extraParams, this.firstName, this.firstNameKana, this.firstNameKanji, @@ -282,6 +296,32 @@ public Builder addAllExpand(List 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 + * PersonCollectionCreateParams#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 PersonCollectionCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The person's first name. */ public Builder setFirstName(String firstName) { this.firstName = firstName; @@ -413,6 +453,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -430,9 +479,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -448,6 +504,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -459,7 +517,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -477,6 +541,32 @@ public Builder setCountry(String 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 + * PersonCollectionCreateParams.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 PersonCollectionCreateParams.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; @@ -515,6 +605,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -538,6 +637,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -545,6 +645,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -561,6 +662,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -576,6 +679,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -598,6 +702,33 @@ public Builder setCountry(String 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 + * PersonCollectionCreateParams.AddressKana#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 PersonCollectionCreateParams.AddressKana#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -642,6 +773,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -665,6 +805,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -672,6 +813,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -688,6 +830,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -703,6 +847,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -725,6 +870,33 @@ public Builder setCountry(String 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 + * PersonCollectionCreateParams.AddressKanji#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 PersonCollectionCreateParams.AddressKanji#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -762,6 +934,15 @@ public static class Dob { @SerializedName("day") Long day; + /** + * 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; + /** The month of birth, between 1 and 12. */ @SerializedName("month") Long month; @@ -770,8 +951,9 @@ public static class Dob { @SerializedName("year") Long year; - private Dob(Long day, Long month, Long year) { + private Dob(Long day, Map extraParams, Long month, Long year) { this.day = day; + this.extraParams = extraParams; this.month = month; this.year = year; } @@ -783,13 +965,15 @@ public static Builder builder() { public static class Builder { private Long day; + private Map extraParams; + private Long month; private Long year; /** Finalize and obtain parameter instance from this builder. */ public Dob build() { - return new Dob(this.day, this.month, this.year); + return new Dob(this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -798,6 +982,32 @@ public Builder setDay(Long day) { 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 + * PersonCollectionCreateParams.Dob#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 PersonCollectionCreateParams.Dob#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The month of birth, between 1 and 12. */ public Builder setMonth(Long month) { this.month = month; @@ -828,6 +1038,15 @@ public static class Relationship { @SerializedName("director") Boolean director; + /** + * 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; + /** Whether the person is an owner of the account’s legal entity. */ @SerializedName("owner") Boolean owner; @@ -843,11 +1062,13 @@ public static class Relationship { private Relationship( Boolean accountOpener, Boolean director, + Map extraParams, Boolean owner, Object percentOwnership, String title) { this.accountOpener = accountOpener; this.director = director; + this.extraParams = extraParams; this.owner = owner; this.percentOwnership = percentOwnership; this.title = title; @@ -862,6 +1083,8 @@ public static class Builder { private Boolean director; + private Map extraParams; + private Boolean owner; private Object percentOwnership; @@ -871,7 +1094,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Relationship build() { return new Relationship( - this.accountOpener, this.director, this.owner, this.percentOwnership, this.title); + this.accountOpener, + this.director, + this.extraParams, + this.owner, + this.percentOwnership, + this.title); } /** @@ -893,6 +1121,33 @@ public Builder setDirector(Boolean director) { 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 + * PersonCollectionCreateParams.Relationship#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 PersonCollectionCreateParams.Relationship#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Whether the person is an owner of the account’s legal entity. */ public Builder setOwner(Boolean owner) { this.owner = owner; @@ -924,8 +1179,18 @@ public static class Verification { @SerializedName("document") Document document; - private Verification(Document document) { + /** + * 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 Verification(Document document, Map extraParams) { this.document = document; + this.extraParams = extraParams; } public static Builder builder() { @@ -935,9 +1200,11 @@ public static Builder builder() { public static class Builder { private Document document; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Verification build() { - return new Verification(this.document); + return new Verification(this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ @@ -945,6 +1212,33 @@ public Builder setDocument(Document document) { this.document = document; 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 + * PersonCollectionCreateParams.Verification#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 PersonCollectionCreateParams.Verification#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } public static class Document { @@ -955,6 +1249,15 @@ public static class Document { @SerializedName("back") String back; + /** + * 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; + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -962,8 +1265,9 @@ public static class Document { @SerializedName("front") String front; - private Document(String back, String front) { + private Document(String back, Map extraParams, String front) { this.back = back; + this.extraParams = extraParams; this.front = front; } @@ -974,11 +1278,13 @@ public static Builder builder() { public static class Builder { private String back; + private Map extraParams; + private String front; /** Finalize and obtain parameter instance from this builder. */ public Document build() { - return new Document(this.back, this.front); + return new Document(this.back, this.extraParams, this.front); } /** @@ -990,6 +1296,34 @@ public Builder setBack(String back) { 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 PersonCollectionCreateParams.Verification.Document#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 PersonCollectionCreateParams.Verification.Document#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. diff --git a/src/main/java/com/stripe/param/PersonCollectionListParams.java b/src/main/java/com/stripe/param/PersonCollectionListParams.java index 0ad15e829e0..644b57648ee 100644 --- a/src/main/java/com/stripe/param/PersonCollectionListParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PersonCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class PersonCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -47,11 +58,13 @@ public class PersonCollectionListParams extends ApiRequestParams { private PersonCollectionListParams( String endingBefore, List expand, + Map extraParams, Long limit, Relationship relationship, String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.relationship = relationship; this.startingAfter = startingAfter; @@ -66,6 +79,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private Relationship relationship; @@ -75,7 +90,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PersonCollectionListParams build() { return new PersonCollectionListParams( - this.endingBefore, this.expand, this.limit, this.relationship, this.startingAfter); + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.relationship, + this.startingAfter); } /** @@ -115,6 +135,32 @@ public Builder addAllExpand(List 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 + * PersonCollectionListParams#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 PersonCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -160,6 +206,15 @@ public static class Relationship { @SerializedName("director") Boolean director; + /** + * 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; + /** * A filter on the list of people returned based on whether these people are owners of the * account's company. @@ -167,9 +222,11 @@ public static class Relationship { @SerializedName("owner") Boolean owner; - private Relationship(Boolean accountOpener, Boolean director, Boolean owner) { + private Relationship( + Boolean accountOpener, Boolean director, Map extraParams, Boolean owner) { this.accountOpener = accountOpener; this.director = director; + this.extraParams = extraParams; this.owner = owner; } @@ -182,11 +239,13 @@ public static class Builder { private Boolean director; + private Map extraParams; + private Boolean owner; /** Finalize and obtain parameter instance from this builder. */ public Relationship build() { - return new Relationship(this.accountOpener, this.director, this.owner); + return new Relationship(this.accountOpener, this.director, this.extraParams, this.owner); } /** @@ -207,6 +266,33 @@ public Builder setDirector(Boolean director) { 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 + * PersonCollectionListParams.Relationship#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 PersonCollectionListParams.Relationship#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A filter on the list of people returned based on whether these people are owners of the * account's company. diff --git a/src/main/java/com/stripe/param/PersonCollectionRetrieveParams.java b/src/main/java/com/stripe/param/PersonCollectionRetrieveParams.java index 79748b19094..ccb82b0f9ce 100644 --- a/src/main/java/com/stripe/param/PersonCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PersonCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PersonCollectionRetrieveParams(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; + + private PersonCollectionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PersonCollectionRetrieveParams build() { - return new PersonCollectionRetrieveParams(this.expand); + return new PersonCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PersonCollectionRetrieveParams#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 PersonCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PersonUpdateParams.java b/src/main/java/com/stripe/param/PersonUpdateParams.java index 8ee9e65bcb7..2efbe63df4e 100644 --- a/src/main/java/com/stripe/param/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/PersonUpdateParams.java @@ -36,6 +36,15 @@ public class PersonUpdateParams extends ApiRequestParams { @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; + /** The person's first name. */ @SerializedName("first_name") String firstName; @@ -115,6 +124,7 @@ private PersonUpdateParams( Dob dob, String email, List expand, + Map extraParams, String firstName, String firstNameKana, String firstNameKanji, @@ -136,6 +146,7 @@ private PersonUpdateParams( this.dob = dob; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.firstName = firstName; this.firstNameKana = firstNameKana; this.firstNameKanji = firstNameKanji; @@ -170,6 +181,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String firstName; private String firstNameKana; @@ -209,6 +222,7 @@ public PersonUpdateParams build() { this.dob, this.email, this.expand, + this.extraParams, this.firstName, this.firstNameKana, this.firstNameKanji, @@ -282,6 +296,32 @@ public Builder addAllExpand(List 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 + * PersonUpdateParams#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 PersonUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The person's first name. */ public Builder setFirstName(String firstName) { this.firstName = firstName; @@ -413,6 +453,15 @@ public static class Address { @SerializedName("country") String 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") String line1; @@ -430,9 +479,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -448,6 +504,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -459,7 +517,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } /** City, district, suburb, town, or village. */ @@ -477,6 +541,32 @@ public Builder setCountry(String 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 + * PersonUpdateParams.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 PersonUpdateParams.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; @@ -515,6 +605,15 @@ public static class AddressKana { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -538,6 +637,7 @@ public static class AddressKana { private AddressKana( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -545,6 +645,7 @@ private AddressKana( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -561,6 +662,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -576,6 +679,7 @@ public AddressKana build() { return new AddressKana( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -598,6 +702,32 @@ public Builder setCountry(String 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 + * PersonUpdateParams.AddressKana#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 PersonUpdateParams.AddressKana#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -642,6 +772,15 @@ public static class AddressKanji { @SerializedName("country") String 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; + /** Block or building number. */ @SerializedName("line1") String line1; @@ -665,6 +804,7 @@ public static class AddressKanji { private AddressKanji( String city, String country, + Map extraParams, String line1, String line2, String postalCode, @@ -672,6 +812,7 @@ private AddressKanji( String town) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -688,6 +829,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -703,6 +846,7 @@ public AddressKanji build() { return new AddressKanji( this.city, this.country, + this.extraParams, this.line1, this.line2, this.postalCode, @@ -725,6 +869,32 @@ public Builder setCountry(String 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 + * PersonUpdateParams.AddressKanji#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 PersonUpdateParams.AddressKanji#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Block or building number. */ public Builder setLine1(String line1) { this.line1 = line1; @@ -762,6 +932,15 @@ public static class Dob { @SerializedName("day") Long day; + /** + * 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; + /** The month of birth, between 1 and 12. */ @SerializedName("month") Long month; @@ -770,8 +949,9 @@ public static class Dob { @SerializedName("year") Long year; - private Dob(Long day, Long month, Long year) { + private Dob(Long day, Map extraParams, Long month, Long year) { this.day = day; + this.extraParams = extraParams; this.month = month; this.year = year; } @@ -783,13 +963,15 @@ public static Builder builder() { public static class Builder { private Long day; + private Map extraParams; + private Long month; private Long year; /** Finalize and obtain parameter instance from this builder. */ public Dob build() { - return new Dob(this.day, this.month, this.year); + return new Dob(this.day, this.extraParams, this.month, this.year); } /** The day of birth, between 1 and 31. */ @@ -798,6 +980,32 @@ public Builder setDay(Long day) { 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 + * PersonUpdateParams.Dob#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 PersonUpdateParams.Dob#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The month of birth, between 1 and 12. */ public Builder setMonth(Long month) { this.month = month; @@ -828,6 +1036,15 @@ public static class Relationship { @SerializedName("director") Boolean director; + /** + * 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; + /** Whether the person is an owner of the account’s legal entity. */ @SerializedName("owner") Boolean owner; @@ -843,11 +1060,13 @@ public static class Relationship { private Relationship( Boolean accountOpener, Boolean director, + Map extraParams, Boolean owner, Object percentOwnership, String title) { this.accountOpener = accountOpener; this.director = director; + this.extraParams = extraParams; this.owner = owner; this.percentOwnership = percentOwnership; this.title = title; @@ -862,6 +1081,8 @@ public static class Builder { private Boolean director; + private Map extraParams; + private Boolean owner; private Object percentOwnership; @@ -871,7 +1092,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Relationship build() { return new Relationship( - this.accountOpener, this.director, this.owner, this.percentOwnership, this.title); + this.accountOpener, + this.director, + this.extraParams, + this.owner, + this.percentOwnership, + this.title); } /** @@ -893,6 +1119,32 @@ public Builder setDirector(Boolean director) { 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 + * PersonUpdateParams.Relationship#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 PersonUpdateParams.Relationship#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Whether the person is an owner of the account’s legal entity. */ public Builder setOwner(Boolean owner) { this.owner = owner; @@ -924,8 +1176,18 @@ public static class Verification { @SerializedName("document") Document document; - private Verification(Document document) { + /** + * 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 Verification(Document document, Map extraParams) { this.document = document; + this.extraParams = extraParams; } public static Builder builder() { @@ -935,9 +1197,11 @@ public static Builder builder() { public static class Builder { private Document document; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public Verification build() { - return new Verification(this.document); + return new Verification(this.document, this.extraParams); } /** An identifying document, either a passport or local ID card. */ @@ -945,6 +1209,32 @@ public Builder setDocument(Document document) { this.document = document; 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 + * PersonUpdateParams.Verification#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 PersonUpdateParams.Verification#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } public static class Document { @@ -955,6 +1245,15 @@ public static class Document { @SerializedName("back") String back; + /** + * 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; + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. @@ -962,8 +1261,9 @@ public static class Document { @SerializedName("front") String front; - private Document(String back, String front) { + private Document(String back, Map extraParams, String front) { this.back = back; + this.extraParams = extraParams; this.front = front; } @@ -974,11 +1274,13 @@ public static Builder builder() { public static class Builder { private String back; + private Map extraParams; + private String front; /** Finalize and obtain parameter instance from this builder. */ public Document build() { - return new Document(this.back, this.front); + return new Document(this.back, this.extraParams, this.front); } /** @@ -990,6 +1292,34 @@ public Builder setBack(String back) { 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 PersonUpdateParams.Verification.Document#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 PersonUpdateParams.Verification.Document#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The front of an ID returned by a [file upload](#create_file) with a `purpose` value of * `identity_document`. diff --git a/src/main/java/com/stripe/param/PlanCreateParams.java b/src/main/java/com/stripe/param/PlanCreateParams.java index fa135ce3e10..bc98195ef47 100644 --- a/src/main/java/com/stripe/param/PlanCreateParams.java +++ b/src/main/java/com/stripe/param/PlanCreateParams.java @@ -53,6 +53,15 @@ public class PlanCreateParams extends ApiRequestParams { @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; + /** * An identifier randomly generated by Stripe. Used to identify this plan when subscribing a * customer. You can optionally override this ID, but the ID must be unique across all plans in @@ -132,6 +141,7 @@ private PlanCreateParams( BillingScheme billingScheme, String currency, List expand, + Map extraParams, String id, Interval interval, Long intervalCount, @@ -149,6 +159,7 @@ private PlanCreateParams( this.billingScheme = billingScheme; this.currency = currency; this.expand = expand; + this.extraParams = extraParams; this.id = id; this.interval = interval; this.intervalCount = intervalCount; @@ -179,6 +190,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String id; private Interval interval; @@ -210,6 +223,7 @@ public PlanCreateParams build() { this.billingScheme, this.currency, this.expand, + this.extraParams, this.id, this.interval, this.intervalCount, @@ -297,6 +311,32 @@ public Builder addAllExpand(List 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 + * PlanCreateParams#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 PlanCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * An identifier randomly generated by Stripe. Used to identify this plan when subscribing a * customer. You can optionally override this ID, but the ID must be unique across all plans in @@ -436,6 +476,15 @@ public static class Product { @SerializedName("active") Boolean active; + /** + * 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; + /** * The identifier for the product. Must be unique. If not provided, an identifier will be * randomly generated. @@ -459,8 +508,14 @@ public static class Product { @SerializedName("unit_label") String unitLabel; - private Product(Boolean active, String id, Map metadata, String unitLabel) { + private Product( + Boolean active, + Map extraParams, + String id, + Map metadata, + String unitLabel) { this.active = active; + this.extraParams = extraParams; this.id = id; this.metadata = metadata; this.unitLabel = unitLabel; @@ -473,6 +528,8 @@ public static Builder builder() { public static class Builder { private Boolean active; + private Map extraParams; + private String id; private Map metadata; @@ -481,7 +538,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Product build() { - return new Product(this.active, this.id, this.metadata, this.unitLabel); + return new Product(this.active, this.extraParams, this.id, this.metadata, this.unitLabel); } /** Whether the product is currently available for purchase. Defaults to `true`. */ @@ -490,6 +547,32 @@ public Builder setActive(Boolean active) { 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 + * PlanCreateParams.Product#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 PlanCreateParams.Product#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The identifier for the product. Must be unique. If not provided, an identifier will be * randomly generated. @@ -537,6 +620,15 @@ public Builder setUnitLabel(String unitLabel) { } public static class Tier { + /** + * 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; + /** * The flat billing amount for an entire tier, regardless of the number of units in the tier. */ @@ -554,7 +646,8 @@ public static class Tier { @SerializedName("up_to") Object upTo; - private Tier(Long flatAmount, Long unitAmount, Object upTo) { + private Tier(Map extraParams, Long flatAmount, Long unitAmount, Object upTo) { + this.extraParams = extraParams; this.flatAmount = flatAmount; this.unitAmount = unitAmount; this.upTo = upTo; @@ -565,6 +658,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long flatAmount; private Long unitAmount; @@ -573,7 +668,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Tier build() { - return new Tier(this.flatAmount, this.unitAmount, this.upTo); + return new Tier(this.extraParams, this.flatAmount, this.unitAmount, this.upTo); + } + + /** + * 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 + * PlanCreateParams.Tier#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 PlanCreateParams.Tier#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -627,12 +748,22 @@ public static class TransformUsage { @SerializedName("divide_by") Long divideBy; + /** + * 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; + /** After division, either round the result `up` or `down`. */ @SerializedName("round") Round round; - private TransformUsage(Long divideBy, Round round) { + private TransformUsage(Long divideBy, Map extraParams, Round round) { this.divideBy = divideBy; + this.extraParams = extraParams; this.round = round; } @@ -643,11 +774,13 @@ public static Builder builder() { public static class Builder { private Long divideBy; + private Map extraParams; + private Round round; /** Finalize and obtain parameter instance from this builder. */ public TransformUsage build() { - return new TransformUsage(this.divideBy, this.round); + return new TransformUsage(this.divideBy, this.extraParams, this.round); } /** Divide usage by this number. */ @@ -656,6 +789,32 @@ public Builder setDivideBy(Long divideBy) { 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 + * PlanCreateParams.TransformUsage#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 PlanCreateParams.TransformUsage#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** After division, either round the result `up` or `down`. */ public Builder setRound(Round round) { this.round = round; diff --git a/src/main/java/com/stripe/param/PlanListParams.java b/src/main/java/com/stripe/param/PlanListParams.java index 8751d14427b..a13b164ffc1 100644 --- a/src/main/java/com/stripe/param/PlanListParams.java +++ b/src/main/java/com/stripe/param/PlanListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PlanListParams extends ApiRequestParams { /** @@ -35,6 +37,15 @@ public class PlanListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -60,6 +71,7 @@ private PlanListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String product, String startingAfter) { @@ -67,6 +79,7 @@ private PlanListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.product = product; this.startingAfter = startingAfter; @@ -85,6 +98,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String product; @@ -98,6 +113,7 @@ public PlanListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.product, this.startingAfter); @@ -167,6 +183,32 @@ public Builder addAllExpand(List 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 + * PlanListParams#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 PlanListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -195,6 +237,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -211,7 +262,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -223,6 +275,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -233,7 +287,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * PlanListParams.Created#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 PlanListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/PlanRetrieveParams.java b/src/main/java/com/stripe/param/PlanRetrieveParams.java index fb97570b49e..b8743d9174e 100644 --- a/src/main/java/com/stripe/param/PlanRetrieveParams.java +++ b/src/main/java/com/stripe/param/PlanRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PlanRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private PlanRetrieveParams(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; + + private PlanRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public PlanRetrieveParams build() { - return new PlanRetrieveParams(this.expand); + return new PlanRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * PlanRetrieveParams#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 PlanRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/PlanUpdateParams.java b/src/main/java/com/stripe/param/PlanUpdateParams.java index 70f95a7be8e..cacd9277223 100644 --- a/src/main/java/com/stripe/param/PlanUpdateParams.java +++ b/src/main/java/com/stripe/param/PlanUpdateParams.java @@ -18,6 +18,15 @@ public class PlanUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a plan object. It can be useful for storing * additional information about the plan in a structured format. @@ -46,12 +55,14 @@ public class PlanUpdateParams extends ApiRequestParams { private PlanUpdateParams( Boolean active, List expand, + Map extraParams, Map metadata, String nickname, String product, Long trialPeriodDays) { this.active = active; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.nickname = nickname; this.product = product; @@ -67,6 +78,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String nickname; @@ -80,6 +93,7 @@ public PlanUpdateParams build() { return new PlanUpdateParams( this.active, this.expand, + this.extraParams, this.metadata, this.nickname, this.product, @@ -118,6 +132,32 @@ public Builder addAllExpand(List 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 + * PlanUpdateParams#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 PlanUpdateParams#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 diff --git a/src/main/java/com/stripe/param/ProductCreateParams.java b/src/main/java/com/stripe/param/ProductCreateParams.java index 1c14eefc230..dfbbf1e9d54 100644 --- a/src/main/java/com/stripe/param/ProductCreateParams.java +++ b/src/main/java/com/stripe/param/ProductCreateParams.java @@ -45,6 +45,15 @@ public class ProductCreateParams extends ApiRequestParams { @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; + /** * An identifier will be randomly generated by Stripe. You can optionally override this ID, but * the ID must be unique across all products in your Stripe account. Applicable to both `service` @@ -124,6 +133,7 @@ private ProductCreateParams( List deactivateOn, String description, List expand, + Map extraParams, String id, List images, Map metadata, @@ -140,6 +150,7 @@ private ProductCreateParams( this.deactivateOn = deactivateOn; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.id = id; this.images = images; this.metadata = metadata; @@ -169,6 +180,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String id; private List images; @@ -198,6 +211,7 @@ public ProductCreateParams build() { this.deactivateOn, this.description, this.expand, + this.extraParams, this.id, this.images, this.metadata, @@ -312,6 +326,32 @@ public Builder addAllExpand(List 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 + * ProductCreateParams#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 ProductCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * An identifier will be randomly generated by Stripe. You can optionally override this ID, but * the ID must be unique across all products in your Stripe account. Applicable to both @@ -440,6 +480,15 @@ public Builder setUrl(String url) { } public static class PackageDimensions { + /** + * 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; + /** Height, in inches. Maximum precision is 2 decimal places. */ @SerializedName("height") BigDecimal height; @@ -457,7 +506,12 @@ public static class PackageDimensions { BigDecimal width; private PackageDimensions( - BigDecimal height, BigDecimal length, BigDecimal weight, BigDecimal width) { + Map extraParams, + BigDecimal height, + BigDecimal length, + BigDecimal weight, + BigDecimal width) { + this.extraParams = extraParams; this.height = height; this.length = length; this.weight = weight; @@ -469,6 +523,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private BigDecimal height; private BigDecimal length; @@ -479,7 +535,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PackageDimensions build() { - return new PackageDimensions(this.height, this.length, this.weight, this.width); + return new PackageDimensions( + this.extraParams, this.height, this.length, this.weight, this.width); + } + + /** + * 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 + * ProductCreateParams.PackageDimensions#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 ProductCreateParams.PackageDimensions#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Height, in inches. Maximum precision is 2 decimal places. */ diff --git a/src/main/java/com/stripe/param/ProductListParams.java b/src/main/java/com/stripe/param/ProductListParams.java index 9546be42e08..5179d389824 100644 --- a/src/main/java/com/stripe/param/ProductListParams.java +++ b/src/main/java/com/stripe/param/ProductListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class ProductListParams extends ApiRequestParams { @@ -33,6 +35,15 @@ public class ProductListParams extends ApiRequestParams { @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; + /** Only return products with the given IDs. */ @SerializedName("ids") List ids; @@ -70,6 +81,7 @@ private ProductListParams( Object created, String endingBefore, List expand, + Map extraParams, List ids, Long limit, Boolean shippable, @@ -80,6 +92,7 @@ private ProductListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.ids = ids; this.limit = limit; this.shippable = shippable; @@ -101,6 +114,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List ids; private Long limit; @@ -120,6 +135,7 @@ public ProductListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.ids, this.limit, this.shippable, @@ -186,6 +202,32 @@ public Builder addAllExpand(List 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 + * ProductListParams#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 ProductListParams#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 an element to `ids` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -252,6 +294,15 @@ public Builder setUrl(String url) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -268,7 +319,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -280,6 +332,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -290,7 +344,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ProductListParams.Created#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 ProductListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/ProductRetrieveParams.java b/src/main/java/com/stripe/param/ProductRetrieveParams.java index a901e072903..8e50b6510d6 100644 --- a/src/main/java/com/stripe/param/ProductRetrieveParams.java +++ b/src/main/java/com/stripe/param/ProductRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ProductRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ProductRetrieveParams(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; + + private ProductRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ProductRetrieveParams build() { - return new ProductRetrieveParams(this.expand); + return new ProductRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ProductRetrieveParams#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 ProductRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ProductUpdateParams.java b/src/main/java/com/stripe/param/ProductUpdateParams.java index 554d40f0a72..98fc05a4978 100644 --- a/src/main/java/com/stripe/param/ProductUpdateParams.java +++ b/src/main/java/com/stripe/param/ProductUpdateParams.java @@ -44,6 +44,15 @@ public class ProductUpdateParams extends ApiRequestParams { @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; + /** A list of up to 8 URLs of images for this product, meant to be displayable to the customer. */ @SerializedName("images") Object images; @@ -101,6 +110,7 @@ private ProductUpdateParams( List deactivateOn, String description, List expand, + Map extraParams, Object images, Map metadata, String name, @@ -115,6 +125,7 @@ private ProductUpdateParams( this.deactivateOn = deactivateOn; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.images = images; this.metadata = metadata; this.name = name; @@ -142,6 +153,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Object images; private Map metadata; @@ -167,6 +180,7 @@ public ProductUpdateParams build() { this.deactivateOn, this.description, this.expand, + this.extraParams, this.images, this.metadata, this.name, @@ -269,6 +283,32 @@ public Builder addAllExpand(List 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 + * ProductUpdateParams#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 ProductUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. */ @@ -374,6 +414,15 @@ public Builder setUrl(String url) { } public static class PackageDimensions { + /** + * 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; + /** Height, in inches. Maximum precision is 2 decimal places. */ @SerializedName("height") BigDecimal height; @@ -391,7 +440,12 @@ public static class PackageDimensions { BigDecimal width; private PackageDimensions( - BigDecimal height, BigDecimal length, BigDecimal weight, BigDecimal width) { + Map extraParams, + BigDecimal height, + BigDecimal length, + BigDecimal weight, + BigDecimal width) { + this.extraParams = extraParams; this.height = height; this.length = length; this.weight = weight; @@ -403,6 +457,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private BigDecimal height; private BigDecimal length; @@ -413,7 +469,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PackageDimensions build() { - return new PackageDimensions(this.height, this.length, this.weight, this.width); + return new PackageDimensions( + this.extraParams, this.height, this.length, this.weight, this.width); + } + + /** + * 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 + * ProductUpdateParams.PackageDimensions#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 ProductUpdateParams.PackageDimensions#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Height, in inches. Maximum precision is 2 decimal places. */ diff --git a/src/main/java/com/stripe/param/RecipientCreateParams.java b/src/main/java/com/stripe/param/RecipientCreateParams.java index 6f57f98e3e1..3a97e4c09b9 100644 --- a/src/main/java/com/stripe/param/RecipientCreateParams.java +++ b/src/main/java/com/stripe/param/RecipientCreateParams.java @@ -46,6 +46,15 @@ public class RecipientCreateParams extends ApiRequestParams { @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 @@ -79,6 +88,7 @@ private RecipientCreateParams( String description, String email, List expand, + Map extraParams, Map metadata, String name, String taxId, @@ -88,6 +98,7 @@ private RecipientCreateParams( this.description = description; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; this.taxId = taxId; @@ -109,6 +120,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; @@ -125,6 +138,7 @@ public RecipientCreateParams build() { this.description, this.email, this.expand, + this.extraParams, this.metadata, this.name, this.taxId, @@ -197,6 +211,32 @@ public Builder addAllExpand(List 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 + * RecipientCreateParams#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 RecipientCreateParams#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 diff --git a/src/main/java/com/stripe/param/RecipientListParams.java b/src/main/java/com/stripe/param/RecipientListParams.java index eecb3b7bd20..03068167c80 100644 --- a/src/main/java/com/stripe/param/RecipientListParams.java +++ b/src/main/java/com/stripe/param/RecipientListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class RecipientListParams extends ApiRequestParams { @@ -25,6 +27,15 @@ public class RecipientListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -52,6 +63,7 @@ private RecipientListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, Type type, @@ -59,6 +71,7 @@ private RecipientListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.type = type; @@ -76,6 +89,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -90,6 +105,7 @@ public RecipientListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.type, @@ -143,6 +159,32 @@ public Builder addAllExpand(List 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 + * RecipientListParams#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 RecipientListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -176,6 +218,15 @@ public Builder setVerified(Boolean verified) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -192,7 +243,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -204,6 +256,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -214,7 +268,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * RecipientListParams.Created#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 RecipientListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/RecipientRetrieveParams.java b/src/main/java/com/stripe/param/RecipientRetrieveParams.java index dca5ced43c5..92b20c70871 100644 --- a/src/main/java/com/stripe/param/RecipientRetrieveParams.java +++ b/src/main/java/com/stripe/param/RecipientRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class RecipientRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private RecipientRetrieveParams(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; + + private RecipientRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public RecipientRetrieveParams build() { - return new RecipientRetrieveParams(this.expand); + return new RecipientRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * RecipientRetrieveParams#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 RecipientRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/RecipientUpdateParams.java b/src/main/java/com/stripe/param/RecipientUpdateParams.java index a517e6c057d..6b54e3dc0bc 100644 --- a/src/main/java/com/stripe/param/RecipientUpdateParams.java +++ b/src/main/java/com/stripe/param/RecipientUpdateParams.java @@ -52,6 +52,15 @@ public class RecipientUpdateParams extends ApiRequestParams { @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 @@ -82,6 +91,7 @@ private RecipientUpdateParams( String description, String email, List expand, + Map extraParams, Map metadata, String name, String taxId) { @@ -91,6 +101,7 @@ private RecipientUpdateParams( this.description = description; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; this.taxId = taxId; @@ -113,6 +124,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; @@ -128,6 +141,7 @@ public RecipientUpdateParams build() { this.description, this.email, this.expand, + this.extraParams, this.metadata, this.name, this.taxId); @@ -208,6 +222,32 @@ public Builder addAllExpand(List 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 + * RecipientUpdateParams#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 RecipientUpdateParams#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 diff --git a/src/main/java/com/stripe/param/RefundCollectionListParams.java b/src/main/java/com/stripe/param/RefundCollectionListParams.java index f7691035219..b137abcf339 100644 --- a/src/main/java/com/stripe/param/RefundCollectionListParams.java +++ b/src/main/java/com/stripe/param/RefundCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class RefundCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class RefundCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class RefundCollectionListParams extends ApiRequestParams { String startingAfter; private RefundCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public RefundCollectionListParams build() { return new RefundCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * RefundCollectionListParams#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 RefundCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/RefundCollectionRetrieveParams.java b/src/main/java/com/stripe/param/RefundCollectionRetrieveParams.java index 9663423cd69..c9cbe118439 100644 --- a/src/main/java/com/stripe/param/RefundCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/RefundCollectionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class RefundCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private RefundCollectionRetrieveParams(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; + + private RefundCollectionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public RefundCollectionRetrieveParams build() { - return new RefundCollectionRetrieveParams(this.expand); + return new RefundCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * RefundCollectionRetrieveParams#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 RefundCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/RefundCreateParams.java b/src/main/java/com/stripe/param/RefundCreateParams.java index e2c8ccc70fd..9d839ac1b5c 100644 --- a/src/main/java/com/stripe/param/RefundCreateParams.java +++ b/src/main/java/com/stripe/param/RefundCreateParams.java @@ -21,6 +21,15 @@ public class RefundCreateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -37,6 +46,7 @@ private RefundCreateParams( Long amount, String charge, List expand, + Map extraParams, Map metadata, Reason reason, Boolean refundApplicationFee, @@ -44,6 +54,7 @@ private RefundCreateParams( this.amount = amount; this.charge = charge; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.reason = reason; this.refundApplicationFee = refundApplicationFee; @@ -61,6 +72,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Reason reason; @@ -75,6 +88,7 @@ public RefundCreateParams build() { this.amount, this.charge, this.expand, + this.extraParams, this.metadata, this.reason, this.refundApplicationFee, @@ -117,6 +131,32 @@ public Builder addAllExpand(List 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 + * RefundCreateParams#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 RefundCreateParams#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 diff --git a/src/main/java/com/stripe/param/RefundListParams.java b/src/main/java/com/stripe/param/RefundListParams.java index b4b27b10039..96799800964 100644 --- a/src/main/java/com/stripe/param/RefundListParams.java +++ b/src/main/java/com/stripe/param/RefundListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class RefundListParams extends ApiRequestParams { /** Only return refunds for the charge specified by this charge ID. */ @@ -28,6 +30,15 @@ public class RefundListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -49,12 +60,14 @@ private RefundListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.charge = charge; this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -72,6 +85,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -83,6 +98,7 @@ public RefundListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -140,6 +156,32 @@ public Builder addAllExpand(List 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 + * RefundListParams#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 RefundListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -162,6 +204,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -178,7 +229,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -190,6 +242,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -200,7 +254,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * RefundListParams.Created#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 RefundListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/RefundRetrieveParams.java b/src/main/java/com/stripe/param/RefundRetrieveParams.java index 31092f26242..46eeea8288c 100644 --- a/src/main/java/com/stripe/param/RefundRetrieveParams.java +++ b/src/main/java/com/stripe/param/RefundRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class RefundRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private RefundRetrieveParams(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; + + private RefundRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public RefundRetrieveParams build() { - return new RefundRetrieveParams(this.expand); + return new RefundRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * RefundRetrieveParams#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 RefundRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/RefundUpdateParams.java b/src/main/java/com/stripe/param/RefundUpdateParams.java index 31c8c1b77da..4fe60725978 100644 --- a/src/main/java/com/stripe/param/RefundUpdateParams.java +++ b/src/main/java/com/stripe/param/RefundUpdateParams.java @@ -14,6 +14,15 @@ public class RefundUpdateParams extends ApiRequestParams { @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 @@ -22,8 +31,10 @@ public class RefundUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private RefundUpdateParams(List expand, Map metadata) { + private RefundUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -34,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public RefundUpdateParams build() { - return new RefundUpdateParams(this.expand, this.metadata); + return new RefundUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -67,6 +80,32 @@ public Builder addAllExpand(List 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 + * RefundUpdateParams#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 RefundUpdateParams#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 diff --git a/src/main/java/com/stripe/param/ReviewApproveParams.java b/src/main/java/com/stripe/param/ReviewApproveParams.java index bfddccfc3ce..91aa606b77d 100644 --- a/src/main/java/com/stripe/param/ReviewApproveParams.java +++ b/src/main/java/com/stripe/param/ReviewApproveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReviewApproveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ReviewApproveParams(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; + + private ReviewApproveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ReviewApproveParams build() { - return new ReviewApproveParams(this.expand); + return new ReviewApproveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ReviewApproveParams#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 ReviewApproveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/ReviewListParams.java b/src/main/java/com/stripe/param/ReviewListParams.java index 55aca4e9b96..7067608fc0a 100644 --- a/src/main/java/com/stripe/param/ReviewListParams.java +++ b/src/main/java/com/stripe/param/ReviewListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReviewListParams extends ApiRequestParams { @SerializedName("created") @@ -24,6 +26,15 @@ public class ReviewListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -41,10 +52,16 @@ public class ReviewListParams extends ApiRequestParams { String startingAfter; private ReviewListParams( - Object created, String endingBefore, List expand, Long limit, String startingAfter) { + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -60,6 +77,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -67,7 +86,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ReviewListParams build() { return new ReviewListParams( - this.created, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setCreated(Created created) { @@ -117,6 +141,32 @@ public Builder addAllExpand(List 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 + * ReviewListParams#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 ReviewListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -139,6 +189,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -155,7 +214,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -167,6 +227,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -177,7 +239,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ReviewListParams.Created#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 ReviewListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/ReviewRetrieveParams.java b/src/main/java/com/stripe/param/ReviewRetrieveParams.java index 1fce2daede6..49de5a8b474 100644 --- a/src/main/java/com/stripe/param/ReviewRetrieveParams.java +++ b/src/main/java/com/stripe/param/ReviewRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReviewRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ReviewRetrieveParams(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; + + private ReviewRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ReviewRetrieveParams build() { - return new ReviewRetrieveParams(this.expand); + return new ReviewRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ReviewRetrieveParams#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 ReviewRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SkuCreateParams.java b/src/main/java/com/stripe/param/SkuCreateParams.java index 6ff7b9680c0..e82c0efc1fa 100644 --- a/src/main/java/com/stripe/param/SkuCreateParams.java +++ b/src/main/java/com/stripe/param/SkuCreateParams.java @@ -36,6 +36,15 @@ public class SkuCreateParams extends ApiRequestParams { @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; + /** * The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly * generated. @@ -78,6 +87,7 @@ private SkuCreateParams( Map attributes, String currency, List expand, + Map extraParams, String id, String image, Inventory inventory, @@ -89,6 +99,7 @@ private SkuCreateParams( this.attributes = attributes; this.currency = currency; this.expand = expand; + this.extraParams = extraParams; this.id = id; this.image = image; this.inventory = inventory; @@ -111,6 +122,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String id; private String image; @@ -132,6 +145,7 @@ public SkuCreateParams build() { this.attributes, this.currency, this.expand, + this.extraParams, this.id, this.image, this.inventory, @@ -208,6 +222,32 @@ public Builder addAllExpand(List 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 + * SkuCreateParams#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 SkuCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly * generated. @@ -278,6 +318,15 @@ public Builder setProduct(String product) { } public static class Inventory { + /** + * 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; + /** The count of inventory available. Required if `type` is `finite`. */ @SerializedName("quantity") Long quantity; @@ -293,7 +342,12 @@ public static class Inventory { @SerializedName("value") ApiRequestParams.EnumParam value; - private Inventory(Long quantity, Type type, ApiRequestParams.EnumParam value) { + private Inventory( + Map extraParams, + Long quantity, + Type type, + ApiRequestParams.EnumParam value) { + this.extraParams = extraParams; this.quantity = quantity; this.type = type; this.value = value; @@ -304,6 +358,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long quantity; private Type type; @@ -312,7 +368,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Inventory build() { - return new Inventory(this.quantity, this.type, this.value); + return new Inventory(this.extraParams, this.quantity, this.type, this.value); + } + + /** + * 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 + * SkuCreateParams.Inventory#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 SkuCreateParams.Inventory#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The count of inventory available. Required if `type` is `finite`. */ @@ -386,6 +468,15 @@ public enum Value implements ApiRequestParams.EnumParam { } public static class PackageDimensions { + /** + * 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; + /** Height, in inches. Maximum precision is 2 decimal places. */ @SerializedName("height") BigDecimal height; @@ -403,7 +494,12 @@ public static class PackageDimensions { BigDecimal width; private PackageDimensions( - BigDecimal height, BigDecimal length, BigDecimal weight, BigDecimal width) { + Map extraParams, + BigDecimal height, + BigDecimal length, + BigDecimal weight, + BigDecimal width) { + this.extraParams = extraParams; this.height = height; this.length = length; this.weight = weight; @@ -415,6 +511,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private BigDecimal height; private BigDecimal length; @@ -425,7 +523,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PackageDimensions build() { - return new PackageDimensions(this.height, this.length, this.weight, this.width); + return new PackageDimensions( + this.extraParams, this.height, this.length, this.weight, this.width); + } + + /** + * 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 + * SkuCreateParams.PackageDimensions#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 SkuCreateParams.PackageDimensions#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Height, in inches. Maximum precision is 2 decimal places. */ diff --git a/src/main/java/com/stripe/param/SkuListParams.java b/src/main/java/com/stripe/param/SkuListParams.java index 6ff9f466d51..8eee8011d0f 100644 --- a/src/main/java/com/stripe/param/SkuListParams.java +++ b/src/main/java/com/stripe/param/SkuListParams.java @@ -39,6 +39,15 @@ public class SkuListParams extends ApiRequestParams { @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; + /** Only return SKUs with the given IDs. */ @SerializedName("ids") List ids; @@ -75,6 +84,7 @@ private SkuListParams( Map attributes, String endingBefore, List expand, + Map extraParams, List ids, Boolean inStock, Long limit, @@ -84,6 +94,7 @@ private SkuListParams( this.attributes = attributes; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.ids = ids; this.inStock = inStock; this.limit = limit; @@ -104,6 +115,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List ids; private Boolean inStock; @@ -121,6 +134,7 @@ public SkuListParams build() { this.attributes, this.endingBefore, this.expand, + this.extraParams, this.ids, this.inStock, this.limit, @@ -200,6 +214,32 @@ public Builder addAllExpand(List 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 + * SkuListParams#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 SkuListParams#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 an element to `ids` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link SkuListParams#ids} diff --git a/src/main/java/com/stripe/param/SkuRetrieveParams.java b/src/main/java/com/stripe/param/SkuRetrieveParams.java index 754294094d3..a7ded91a13a 100644 --- a/src/main/java/com/stripe/param/SkuRetrieveParams.java +++ b/src/main/java/com/stripe/param/SkuRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SkuRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SkuRetrieveParams(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; + + private SkuRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SkuRetrieveParams build() { - return new SkuRetrieveParams(this.expand); + return new SkuRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * SkuRetrieveParams#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 SkuRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SkuUpdateParams.java b/src/main/java/com/stripe/param/SkuUpdateParams.java index 87b92f24afd..f6da34c8df0 100644 --- a/src/main/java/com/stripe/param/SkuUpdateParams.java +++ b/src/main/java/com/stripe/param/SkuUpdateParams.java @@ -37,6 +37,15 @@ public class SkuUpdateParams extends ApiRequestParams { @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; + /** The URL of an image for this SKU, meant to be displayable to the customer. */ @SerializedName("image") String image; @@ -75,6 +84,7 @@ private SkuUpdateParams( Map attributes, String currency, List expand, + Map extraParams, String image, Inventory inventory, Map metadata, @@ -85,6 +95,7 @@ private SkuUpdateParams( this.attributes = attributes; this.currency = currency; this.expand = expand; + this.extraParams = extraParams; this.image = image; this.inventory = inventory; this.metadata = metadata; @@ -106,6 +117,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String image; private Inventory inventory; @@ -125,6 +138,7 @@ public SkuUpdateParams build() { this.attributes, this.currency, this.expand, + this.extraParams, this.image, this.inventory, this.metadata, @@ -200,6 +214,32 @@ public Builder addAllExpand(List 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 + * SkuUpdateParams#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 SkuUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The URL of an image for this SKU, meant to be displayable to the customer. */ public Builder setImage(String image) { this.image = image; @@ -270,6 +310,15 @@ public Builder setProduct(String product) { } public static class Inventory { + /** + * 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; + /** The count of inventory available. Required if `type` is `finite`. */ @SerializedName("quantity") Long quantity; @@ -285,7 +334,12 @@ public static class Inventory { @SerializedName("value") ApiRequestParams.EnumParam value; - private Inventory(Long quantity, Type type, ApiRequestParams.EnumParam value) { + private Inventory( + Map extraParams, + Long quantity, + Type type, + ApiRequestParams.EnumParam value) { + this.extraParams = extraParams; this.quantity = quantity; this.type = type; this.value = value; @@ -296,6 +350,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long quantity; private Type type; @@ -304,7 +360,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Inventory build() { - return new Inventory(this.quantity, this.type, this.value); + return new Inventory(this.extraParams, this.quantity, this.type, this.value); + } + + /** + * 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 + * SkuUpdateParams.Inventory#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 SkuUpdateParams.Inventory#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The count of inventory available. Required if `type` is `finite`. */ @@ -378,6 +460,15 @@ public enum Value implements ApiRequestParams.EnumParam { } public static class PackageDimensions { + /** + * 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; + /** Height, in inches. Maximum precision is 2 decimal places. */ @SerializedName("height") BigDecimal height; @@ -395,7 +486,12 @@ public static class PackageDimensions { BigDecimal width; private PackageDimensions( - BigDecimal height, BigDecimal length, BigDecimal weight, BigDecimal width) { + Map extraParams, + BigDecimal height, + BigDecimal length, + BigDecimal weight, + BigDecimal width) { + this.extraParams = extraParams; this.height = height; this.length = length; this.weight = weight; @@ -407,6 +503,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private BigDecimal height; private BigDecimal length; @@ -417,7 +515,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PackageDimensions build() { - return new PackageDimensions(this.height, this.length, this.weight, this.width); + return new PackageDimensions( + this.extraParams, this.height, this.length, this.weight, this.width); + } + + /** + * 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 + * SkuUpdateParams.PackageDimensions#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 SkuUpdateParams.PackageDimensions#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Height, in inches. Maximum precision is 2 decimal places. */ diff --git a/src/main/java/com/stripe/param/SourceCreateParams.java b/src/main/java/com/stripe/param/SourceCreateParams.java index e7d2d5c97a1..0f29de18204 100644 --- a/src/main/java/com/stripe/param/SourceCreateParams.java +++ b/src/main/java/com/stripe/param/SourceCreateParams.java @@ -36,6 +36,15 @@ public class SourceCreateParams extends ApiRequestParams { @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; + /** * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, * `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. @@ -107,6 +116,7 @@ private SourceCreateParams( String currency, String customer, List expand, + Map extraParams, Flow flow, Map metadata, String originalSource, @@ -121,6 +131,7 @@ private SourceCreateParams( this.currency = currency; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.flow = flow; this.metadata = metadata; this.originalSource = originalSource; @@ -146,6 +157,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Flow flow; private Map metadata; @@ -173,6 +186,7 @@ public SourceCreateParams build() { this.currency, this.customer, this.expand, + this.extraParams, this.flow, this.metadata, this.originalSource, @@ -238,6 +252,32 @@ public Builder addAllExpand(List 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 + * SourceCreateParams#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 SourceCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, * `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. @@ -351,6 +391,15 @@ public static class Owner { @SerializedName("email") String 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; + /** Owner's full name. */ @SerializedName("name") String name; @@ -359,9 +408,11 @@ public static class Owner { @SerializedName("phone") String phone; - private Owner(Address address, String email, String name, String phone) { + private Owner( + Address address, String email, Map extraParams, String name, String phone) { this.address = address; this.email = email; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -375,13 +426,15 @@ public static class Builder { private String email; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public Owner build() { - return new Owner(this.address, this.email, this.name, this.phone); + return new Owner(this.address, this.email, this.extraParams, this.name, this.phone); } /** Owner's address. */ @@ -396,6 +449,32 @@ public Builder setEmail(String 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 + * SourceCreateParams.Owner#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 SourceCreateParams.Owner#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Owner's full name. */ public Builder setName(String name) { this.name = name; @@ -416,6 +495,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -431,12 +519,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -452,6 +542,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -463,7 +555,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -476,6 +574,34 @@ public Builder setCountry(String 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 SourceCreateParams.Owner.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 SourceCreateParams.Owner.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -500,6 +626,15 @@ public Builder setState(String state) { } public static class Receiver { + /** + * 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; + /** * The method Stripe should use to request information needed to process a refund or mispayment. * Either `email` (an email is sent directly to the customer) or `manual` (a @@ -509,7 +644,9 @@ public static class Receiver { @SerializedName("refund_attributes_method") RefundAttributesMethod refundAttributesMethod; - private Receiver(RefundAttributesMethod refundAttributesMethod) { + private Receiver( + Map extraParams, RefundAttributesMethod refundAttributesMethod) { + this.extraParams = extraParams; this.refundAttributesMethod = refundAttributesMethod; } @@ -518,11 +655,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private RefundAttributesMethod refundAttributesMethod; /** Finalize and obtain parameter instance from this builder. */ public Receiver build() { - return new Receiver(this.refundAttributesMethod); + return new Receiver(this.extraParams, this.refundAttributesMethod); + } + + /** + * 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 + * SourceCreateParams.Receiver#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 SourceCreateParams.Receiver#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -557,6 +722,15 @@ public enum RefundAttributesMethod implements ApiRequestParams.EnumParam { } public static class Redirect { + /** + * 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; + /** * The URL you provide to redirect the customer back to you after they authenticated their * payment. It can use your application URI scheme in the context of a mobile application. @@ -564,7 +738,8 @@ public static class Redirect { @SerializedName("return_url") String returnUrl; - private Redirect(String returnUrl) { + private Redirect(Map extraParams, String returnUrl) { + this.extraParams = extraParams; this.returnUrl = returnUrl; } @@ -573,11 +748,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ public Redirect build() { - return new Redirect(this.returnUrl); + return new Redirect(this.extraParams, this.returnUrl); + } + + /** + * 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 + * SourceCreateParams.Redirect#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 SourceCreateParams.Redirect#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/SourceRetrieveParams.java b/src/main/java/com/stripe/param/SourceRetrieveParams.java index 32d894df8f9..2fe466431ce 100644 --- a/src/main/java/com/stripe/param/SourceRetrieveParams.java +++ b/src/main/java/com/stripe/param/SourceRetrieveParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SourceRetrieveParams extends ApiRequestParams { /** @@ -18,9 +20,20 @@ public class SourceRetrieveParams extends ApiRequestParams { @SerializedName("expand") List expand; - private SourceRetrieveParams(String clientSecret, 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; + + private SourceRetrieveParams( + String clientSecret, List expand, Map extraParams) { this.clientSecret = clientSecret; this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -32,9 +45,11 @@ public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SourceRetrieveParams build() { - return new SourceRetrieveParams(this.clientSecret, this.expand); + return new SourceRetrieveParams(this.clientSecret, this.expand, this.extraParams); } /** @@ -71,5 +86,31 @@ public Builder addAllExpand(List elements) { 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 + * SourceRetrieveParams#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 SourceRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SourceSourceTransactionsParams.java b/src/main/java/com/stripe/param/SourceSourceTransactionsParams.java index 431c16ee58c..ea872bcb040 100644 --- a/src/main/java/com/stripe/param/SourceSourceTransactionsParams.java +++ b/src/main/java/com/stripe/param/SourceSourceTransactionsParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SourceSourceTransactionsParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class SourceSourceTransactionsParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class SourceSourceTransactionsParams extends ApiRequestParams { String startingAfter; private SourceSourceTransactionsParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SourceSourceTransactionsParams build() { return new SourceSourceTransactionsParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * SourceSourceTransactionsParams#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 SourceSourceTransactionsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/SourceUpdateParams.java b/src/main/java/com/stripe/param/SourceUpdateParams.java index 3d353dc75c5..d6d5b62b752 100644 --- a/src/main/java/com/stripe/param/SourceUpdateParams.java +++ b/src/main/java/com/stripe/param/SourceUpdateParams.java @@ -14,6 +14,15 @@ public class SourceUpdateParams extends ApiRequestParams { @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; + /** * A set of key-value pairs that you can attach to a source object. It can be useful for storing * additional information about the source in a structured format. @@ -28,8 +37,13 @@ public class SourceUpdateParams extends ApiRequestParams { @SerializedName("owner") Owner owner; - private SourceUpdateParams(List expand, Map metadata, Owner owner) { + private SourceUpdateParams( + List expand, + Map extraParams, + Map metadata, + Owner owner) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.owner = owner; } @@ -41,13 +55,15 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Owner owner; /** Finalize and obtain parameter instance from this builder. */ public SourceUpdateParams build() { - return new SourceUpdateParams(this.expand, this.metadata, this.owner); + return new SourceUpdateParams(this.expand, this.extraParams, this.metadata, this.owner); } /** @@ -76,6 +92,32 @@ public Builder addAllExpand(List 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 + * SourceUpdateParams#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 SourceUpdateParams#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 @@ -121,6 +163,15 @@ public static class Owner { @SerializedName("email") String 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; + /** Owner's full name. */ @SerializedName("name") String name; @@ -129,9 +180,11 @@ public static class Owner { @SerializedName("phone") String phone; - private Owner(Address address, String email, String name, String phone) { + private Owner( + Address address, String email, Map extraParams, String name, String phone) { this.address = address; this.email = email; + this.extraParams = extraParams; this.name = name; this.phone = phone; } @@ -145,13 +198,15 @@ public static class Builder { private String email; + private Map extraParams; + private String name; private String phone; /** Finalize and obtain parameter instance from this builder. */ public Owner build() { - return new Owner(this.address, this.email, this.name, this.phone); + return new Owner(this.address, this.email, this.extraParams, this.name, this.phone); } /** Owner's address. */ @@ -166,6 +221,32 @@ public Builder setEmail(String 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 + * SourceUpdateParams.Owner#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 SourceUpdateParams.Owner#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Owner's full name. */ public Builder setName(String name) { this.name = name; @@ -186,6 +267,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -201,12 +291,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -222,6 +314,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -233,7 +327,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -246,6 +346,34 @@ public Builder setCountry(String 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 SourceUpdateParams.Owner.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 SourceUpdateParams.Owner.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/SourceVerifyParams.java b/src/main/java/com/stripe/param/SourceVerifyParams.java index b6a518778ac..65a20d33d93 100644 --- a/src/main/java/com/stripe/param/SourceVerifyParams.java +++ b/src/main/java/com/stripe/param/SourceVerifyParams.java @@ -5,19 +5,32 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SourceVerifyParams extends ApiRequestParams { /** 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; + /** The values needed to verify the source. */ @SerializedName("values") List values; - private SourceVerifyParams(List expand, List values) { + private SourceVerifyParams( + List expand, Map extraParams, List values) { this.expand = expand; + this.extraParams = extraParams; this.values = values; } @@ -28,11 +41,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private List values; /** Finalize and obtain parameter instance from this builder. */ public SourceVerifyParams build() { - return new SourceVerifyParams(this.expand, this.values); + return new SourceVerifyParams(this.expand, this.extraParams, this.values); } /** @@ -61,6 +76,32 @@ public Builder addAllExpand(List 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 + * SourceVerifyParams#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 SourceVerifyParams#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 an element to `values` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link diff --git a/src/main/java/com/stripe/param/SubscriptionCancelParams.java b/src/main/java/com/stripe/param/SubscriptionCancelParams.java index 97eeccf3c1c..90a3cb9959b 100644 --- a/src/main/java/com/stripe/param/SubscriptionCancelParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCancelParams.java @@ -4,8 +4,19 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; public class SubscriptionCancelParams extends ApiRequestParams { + /** + * 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; + /** * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending * proration invoice items. @@ -20,7 +31,9 @@ public class SubscriptionCancelParams extends ApiRequestParams { @SerializedName("prorate") Boolean prorate; - private SubscriptionCancelParams(Boolean invoiceNow, Boolean prorate) { + private SubscriptionCancelParams( + Map extraParams, Boolean invoiceNow, Boolean prorate) { + this.extraParams = extraParams; this.invoiceNow = invoiceNow; this.prorate = prorate; } @@ -30,13 +43,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Boolean invoiceNow; private Boolean prorate; /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCancelParams build() { - return new SubscriptionCancelParams(this.invoiceNow, this.prorate); + return new SubscriptionCancelParams(this.extraParams, this.invoiceNow, this.prorate); + } + + /** + * 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 + * SubscriptionCancelParams#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 SubscriptionCancelParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index cc9cfdd70c6..4e0cfebef20 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -114,6 +114,15 @@ public class SubscriptionCreateParams extends ApiRequestParams { @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; + /** List of subscription items, each with an attached plan. */ @SerializedName("items") List items; @@ -195,6 +204,7 @@ private SubscriptionCreateParams( String defaultSource, Object defaultTaxRates, List expand, + Map extraParams, List items, Map metadata, Boolean prorate, @@ -217,6 +227,7 @@ private SubscriptionCreateParams( this.defaultSource = defaultSource; this.defaultTaxRates = defaultTaxRates; this.expand = expand; + this.extraParams = extraParams; this.items = items; this.metadata = metadata; this.prorate = prorate; @@ -260,6 +271,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List items; private Map metadata; @@ -293,6 +306,7 @@ public SubscriptionCreateParams build() { this.defaultSource, this.defaultTaxRates, this.expand, + this.extraParams, this.items, this.metadata, this.prorate, @@ -470,6 +484,32 @@ public Builder addAllExpand(List 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 + * SubscriptionCreateParams#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 SubscriptionCreateParams#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 an element to `items` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -621,6 +661,15 @@ public static class BillingThresholds { @SerializedName("amount_gte") Long amountGte; + /** + * 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; + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, * `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; @@ -629,8 +678,10 @@ public static class BillingThresholds { @SerializedName("reset_billing_cycle_anchor") Boolean resetBillingCycleAnchor; - private BillingThresholds(Long amountGte, Boolean resetBillingCycleAnchor) { + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { this.amountGte = amountGte; + this.extraParams = extraParams; this.resetBillingCycleAnchor = resetBillingCycleAnchor; } @@ -641,11 +692,14 @@ public static Builder builder() { public static class Builder { private Long amountGte; + private Map extraParams; + private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.amountGte, this.resetBillingCycleAnchor); + return new BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } /** Monetary threshold that triggers the subscription to advance to a new billing period. */ @@ -654,6 +708,33 @@ public Builder setAmountGte(Long amountGte) { 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 + * SubscriptionCreateParams.BillingThresholds#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 SubscriptionCreateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If * true, `billing_cycle_anchor` will be updated to the date/time the threshold was last @@ -674,6 +755,15 @@ public static class Item { @SerializedName("billing_thresholds") Object billingThresholds; + /** + * 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. @@ -698,11 +788,13 @@ public static class Item { private Item( Object billingThresholds, + Map extraParams, Map metadata, String plan, Long quantity, Object taxRates) { this.billingThresholds = billingThresholds; + this.extraParams = extraParams; this.metadata = metadata; this.plan = plan; this.quantity = quantity; @@ -716,6 +808,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private Map extraParams; + private Map metadata; private String plan; @@ -727,7 +821,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Item build() { return new Item( - this.billingThresholds, this.metadata, this.plan, this.quantity, this.taxRates); + this.billingThresholds, + this.extraParams, + this.metadata, + this.plan, + this.quantity, + this.taxRates); } /** @@ -748,6 +847,32 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { 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 + * SubscriptionCreateParams.Item#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 SubscriptionCreateParams.Item#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 @@ -806,11 +931,21 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -819,11 +954,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 SubscriptionCreateParams.Item.BillingThresholds#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 SubscriptionCreateParams.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ @@ -840,8 +1005,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -851,9 +1026,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -861,6 +1038,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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 + * SubscriptionCreateParams.TransferData#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 SubscriptionCreateParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index 692b16fa82e..5288f2e1867 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -22,6 +22,15 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { @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. @@ -66,6 +75,7 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { private SubscriptionItemCreateParams( Object billingThresholds, List expand, + Map extraParams, Map metadata, String plan, Boolean prorate, @@ -75,6 +85,7 @@ private SubscriptionItemCreateParams( Object taxRates) { this.billingThresholds = billingThresholds; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.plan = plan; this.prorate = prorate; @@ -93,6 +104,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String plan; @@ -112,6 +125,7 @@ public SubscriptionItemCreateParams build() { return new SubscriptionItemCreateParams( this.billingThresholds, this.expand, + this.extraParams, this.metadata, this.plan, this.prorate, @@ -165,6 +179,32 @@ public Builder addAllExpand(List 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 + * SubscriptionItemCreateParams#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 SubscriptionItemCreateParams#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 @@ -249,11 +289,21 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -262,11 +312,40 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 + * SubscriptionItemCreateParams.BillingThresholds#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 SubscriptionItemCreateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ diff --git a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java index f85b6a6109f..f61d49cdb1f 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemDeleteParams.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; public class SubscriptionItemDeleteParams extends ApiRequestParams { /** @@ -13,6 +15,15 @@ public class SubscriptionItemDeleteParams extends ApiRequestParams { @SerializedName("clear_usage") Boolean clearUsage; + /** + * 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; + /** * Flag indicating whether to [prorate](https://stripe.com/docs/billing/subscriptions/prorations) * switching plans during a billing cycle. @@ -28,8 +39,10 @@ public class SubscriptionItemDeleteParams extends ApiRequestParams { @SerializedName("proration_date") Long prorationDate; - private SubscriptionItemDeleteParams(Boolean clearUsage, Boolean prorate, Long prorationDate) { + private SubscriptionItemDeleteParams( + Boolean clearUsage, Map extraParams, Boolean prorate, Long prorationDate) { this.clearUsage = clearUsage; + this.extraParams = extraParams; this.prorate = prorate; this.prorationDate = prorationDate; } @@ -41,13 +54,16 @@ public static Builder builder() { public static class Builder { private Boolean clearUsage; + private Map extraParams; + private Boolean prorate; private Long prorationDate; /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemDeleteParams build() { - return new SubscriptionItemDeleteParams(this.clearUsage, this.prorate, this.prorationDate); + return new SubscriptionItemDeleteParams( + this.clearUsage, this.extraParams, this.prorate, this.prorationDate); } /** @@ -59,6 +75,32 @@ public Builder setClearUsage(Boolean clearUsage) { 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 + * SubscriptionItemDeleteParams#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 SubscriptionItemDeleteParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Flag indicating whether to * [prorate](https://stripe.com/docs/billing/subscriptions/prorations) switching plans during a diff --git a/src/main/java/com/stripe/param/SubscriptionItemListParams.java b/src/main/java/com/stripe/param/SubscriptionItemListParams.java index 28d13410a0c..c1dbe9e92ff 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionItemListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class SubscriptionItemListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -44,11 +55,13 @@ public class SubscriptionItemListParams extends ApiRequestParams { private SubscriptionItemListParams( String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, String subscription) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.subscription = subscription; @@ -63,6 +76,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -72,7 +87,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemListParams build() { return new SubscriptionItemListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter, this.subscription); + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter, + this.subscription); } /** @@ -112,6 +132,32 @@ public Builder addAllExpand(List 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 + * SubscriptionItemListParams#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 SubscriptionItemListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/SubscriptionItemRetrieveParams.java b/src/main/java/com/stripe/param/SubscriptionItemRetrieveParams.java index f797d53f3c8..002aab82dd2 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemRetrieveParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionItemRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SubscriptionItemRetrieveParams(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; + + private SubscriptionItemRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemRetrieveParams build() { - return new SubscriptionItemRetrieveParams(this.expand); + return new SubscriptionItemRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * SubscriptionItemRetrieveParams#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 SubscriptionItemRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index 3403ad9c977..8c22b29e10c 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -22,6 +22,15 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { @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. @@ -62,6 +71,7 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { private SubscriptionItemUpdateParams( Object billingThresholds, List expand, + Map extraParams, Map metadata, String plan, Boolean prorate, @@ -70,6 +80,7 @@ private SubscriptionItemUpdateParams( Object taxRates) { this.billingThresholds = billingThresholds; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.plan = plan; this.prorate = prorate; @@ -87,6 +98,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String plan; @@ -104,6 +117,7 @@ public SubscriptionItemUpdateParams build() { return new SubscriptionItemUpdateParams( this.billingThresholds, this.expand, + this.extraParams, this.metadata, this.plan, this.prorate, @@ -156,6 +170,32 @@ public Builder addAllExpand(List 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 + * SubscriptionItemUpdateParams#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 SubscriptionItemUpdateParams#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 @@ -234,11 +274,21 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -247,11 +297,40 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 + * SubscriptionItemUpdateParams.BillingThresholds#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 SubscriptionItemUpdateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ diff --git a/src/main/java/com/stripe/param/SubscriptionItemUsageRecordSummariesParams.java b/src/main/java/com/stripe/param/SubscriptionItemUsageRecordSummariesParams.java index f019dbf2179..3c5ef027c4f 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUsageRecordSummariesParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUsageRecordSummariesParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionItemUsageRecordSummariesParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class SubscriptionItemUsageRecordSummariesParams extends ApiRequestParams @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class SubscriptionItemUsageRecordSummariesParams extends ApiRequestParams String startingAfter; private SubscriptionItemUsageRecordSummariesParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemUsageRecordSummariesParams build() { return new SubscriptionItemUsageRecordSummariesParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,33 @@ public Builder addAllExpand(List 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 + * SubscriptionItemUsageRecordSummariesParams#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 SubscriptionItemUsageRecordSummariesParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/SubscriptionListParams.java b/src/main/java/com/stripe/param/SubscriptionListParams.java index 676f8f2d37d..69564a8934f 100644 --- a/src/main/java/com/stripe/param/SubscriptionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class SubscriptionListParams extends ApiRequestParams { @@ -42,6 +44,15 @@ public class SubscriptionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -79,6 +90,7 @@ private SubscriptionListParams( String customer, String endingBefore, List expand, + Map extraParams, Long limit, String plan, String startingAfter, @@ -90,6 +102,7 @@ private SubscriptionListParams( this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.plan = plan; this.startingAfter = startingAfter; @@ -115,6 +128,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String plan; @@ -133,6 +148,7 @@ public SubscriptionListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.limit, this.plan, this.startingAfter, @@ -221,6 +237,32 @@ public Builder addAllExpand(List 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 + * SubscriptionListParams#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#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -260,6 +302,15 @@ public Builder setStatus(Status status) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -276,7 +327,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -288,6 +340,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -298,7 +352,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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.Created#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.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -328,6 +408,15 @@ public Builder setLte(Long lte) { } public static class CurrentPeriodEnd { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -344,7 +433,9 @@ public static class CurrentPeriodEnd { @SerializedName("lte") Long lte; - private CurrentPeriodEnd(Long gt, Long gte, Long lt, Long lte) { + private CurrentPeriodEnd( + Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -356,6 +447,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -366,7 +459,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CurrentPeriodEnd build() { - return new CurrentPeriodEnd(this.gt, this.gte, this.lt, this.lte); + return new CurrentPeriodEnd(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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.CurrentPeriodEnd#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.CurrentPeriodEnd#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -396,6 +516,15 @@ public Builder setLte(Long lte) { } public static class CurrentPeriodStart { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -412,7 +541,9 @@ public static class CurrentPeriodStart { @SerializedName("lte") Long lte; - private CurrentPeriodStart(Long gt, Long gte, Long lt, Long lte) { + private CurrentPeriodStart( + Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -424,6 +555,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -434,7 +567,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CurrentPeriodStart build() { - return new CurrentPeriodStart(this.gt, this.gte, this.lt, this.lte); + return new CurrentPeriodStart(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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.CurrentPeriodStart#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.CurrentPeriodStart#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/SubscriptionRetrieveParams.java b/src/main/java/com/stripe/param/SubscriptionRetrieveParams.java index c3254c55d2b..45096008398 100644 --- a/src/main/java/com/stripe/param/SubscriptionRetrieveParams.java +++ b/src/main/java/com/stripe/param/SubscriptionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SubscriptionRetrieveParams(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; + + private SubscriptionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionRetrieveParams build() { - return new SubscriptionRetrieveParams(this.expand); + return new SubscriptionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * SubscriptionRetrieveParams#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 SubscriptionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCancelParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCancelParams.java index 6ff76036915..bedf3b9fc1e 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCancelParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCancelParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleCancelParams extends ApiRequestParams { /** 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; + /** * If the subscription schedule is `active`, indicates whether or not to generate a final invoice * that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults @@ -28,8 +39,9 @@ public class SubscriptionScheduleCancelParams extends ApiRequestParams { Boolean prorate; private SubscriptionScheduleCancelParams( - List expand, Boolean invoiceNow, Boolean prorate) { + List expand, Map extraParams, Boolean invoiceNow, Boolean prorate) { this.expand = expand; + this.extraParams = extraParams; this.invoiceNow = invoiceNow; this.prorate = prorate; } @@ -41,13 +53,16 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Boolean invoiceNow; private Boolean prorate; /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCancelParams build() { - return new SubscriptionScheduleCancelParams(this.expand, this.invoiceNow, this.prorate); + return new SubscriptionScheduleCancelParams( + this.expand, this.extraParams, this.invoiceNow, this.prorate); } /** @@ -76,6 +91,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleCancelParams#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 SubscriptionScheduleCancelParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * If the subscription schedule is `active`, indicates whether or not to generate a final * invoice that contains any un-invoiced metered usage and new/pending proration invoice items. diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 3d94985bb3b..1f2213b0e9d 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -37,6 +37,15 @@ public class SubscriptionScheduleCreateParams extends ApiRequestParams { @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; + /** * Migrate an existing subscription to be managed by a subscription schedule. If this parameter is * set, a subscription schedule will be created using the subscription's plan(s), set to @@ -91,6 +100,7 @@ private SubscriptionScheduleCreateParams( Object billingThresholds, String customer, List expand, + Map extraParams, String fromSubscription, InvoiceSettings invoiceSettings, Map metadata, @@ -102,6 +112,7 @@ private SubscriptionScheduleCreateParams( this.billingThresholds = billingThresholds; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.fromSubscription = fromSubscription; this.invoiceSettings = invoiceSettings; this.metadata = metadata; @@ -124,6 +135,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String fromSubscription; private InvoiceSettings invoiceSettings; @@ -145,6 +158,7 @@ public SubscriptionScheduleCreateParams build() { this.billingThresholds, this.customer, this.expand, + this.extraParams, this.fromSubscription, this.invoiceSettings, this.metadata, @@ -215,6 +229,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleCreateParams#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 SubscriptionScheduleCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Migrate an existing subscription to be managed by a subscription schedule. If this parameter * is set, a subscription schedule will be created using the subscription's plan(s), set to @@ -324,6 +364,15 @@ public static class BillingThresholds { @SerializedName("amount_gte") Long amountGte; + /** + * 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; + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, * `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; @@ -332,8 +381,10 @@ public static class BillingThresholds { @SerializedName("reset_billing_cycle_anchor") Boolean resetBillingCycleAnchor; - private BillingThresholds(Long amountGte, Boolean resetBillingCycleAnchor) { + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { this.amountGte = amountGte; + this.extraParams = extraParams; this.resetBillingCycleAnchor = resetBillingCycleAnchor; } @@ -344,11 +395,14 @@ public static Builder builder() { public static class Builder { private Long amountGte; + private Map extraParams; + private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.amountGte, this.resetBillingCycleAnchor); + return new BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } /** Monetary threshold that triggers the subscription to advance to a new billing period. */ @@ -357,6 +411,34 @@ public Builder setAmountGte(Long amountGte) { 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 + * SubscriptionScheduleCreateParams.BillingThresholds#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 SubscriptionScheduleCreateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If * true, `billing_cycle_anchor` will be updated to the date/time the threshold was last @@ -373,8 +455,18 @@ public static class InvoiceSettings { @SerializedName("days_until_due") Long daysUntilDue; - private InvoiceSettings(Long daysUntilDue) { + /** + * 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 InvoiceSettings(Long daysUntilDue, Map extraParams) { this.daysUntilDue = daysUntilDue; + this.extraParams = extraParams; } public static Builder builder() { @@ -384,15 +476,44 @@ public static Builder builder() { public static class Builder { private Long daysUntilDue; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue); + return new InvoiceSettings(this.daysUntilDue, this.extraParams); } public Builder setDaysUntilDue(Long daysUntilDue) { this.daysUntilDue = daysUntilDue; 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 + * SubscriptionScheduleCreateParams.InvoiceSettings#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 SubscriptionScheduleCreateParams.InvoiceSettings#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } @@ -425,6 +546,15 @@ public static class Phase { @SerializedName("end_date") Long endDate; + /** + * 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; + /** * Integer representing the multiplier applied to the plan interval. For example, `iterations=2` * applied to a plan with `interval=month` and `interval_count=3` results in a phase of duration @@ -471,6 +601,7 @@ private Phase( String coupon, Object defaultTaxRates, Long endDate, + Map extraParams, Long iterations, List plans, BigDecimal taxPercent, @@ -480,6 +611,7 @@ private Phase( this.coupon = coupon; this.defaultTaxRates = defaultTaxRates; this.endDate = endDate; + this.extraParams = extraParams; this.iterations = iterations; this.plans = plans; this.taxPercent = taxPercent; @@ -500,6 +632,8 @@ public static class Builder { private Long endDate; + private Map extraParams; + private Long iterations; private List plans; @@ -517,6 +651,7 @@ public Phase build() { this.coupon, this.defaultTaxRates, this.endDate, + this.extraParams, this.iterations, this.plans, this.taxPercent, @@ -569,6 +704,32 @@ public Builder setEndDate(Long endDate) { 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 + * SubscriptionScheduleCreateParams.Phase#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 SubscriptionScheduleCreateParams.Phase#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Integer representing the multiplier applied to the plan interval. For example, * `iterations=2` applied to a plan with `interval=month` and `interval_count=3` results in a @@ -646,6 +807,15 @@ public static class Plan { @SerializedName("billing_thresholds") Object billingThresholds; + /** + * 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; + /** The plan ID to subscribe to. */ @SerializedName("plan") String plan; @@ -664,8 +834,14 @@ public static class Plan { @SerializedName("tax_rates") Object taxRates; - private Plan(Object billingThresholds, String plan, Long quantity, Object taxRates) { + private Plan( + Object billingThresholds, + Map extraParams, + String plan, + Long quantity, + Object taxRates) { this.billingThresholds = billingThresholds; + this.extraParams = extraParams; this.plan = plan; this.quantity = quantity; this.taxRates = taxRates; @@ -678,6 +854,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private Map extraParams; + private String plan; private Long quantity; @@ -686,7 +864,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Plan build() { - return new Plan(this.billingThresholds, this.plan, this.quantity, this.taxRates); + return new Plan( + this.billingThresholds, this.extraParams, this.plan, this.quantity, this.taxRates); } /** @@ -707,6 +886,34 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { 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 SubscriptionScheduleCreateParams.Phase.Plan#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 SubscriptionScheduleCreateParams.Phase.Plan#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The plan ID to subscribe to. */ public Builder setPlan(String plan) { this.plan = plan; @@ -742,11 +949,22 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -756,11 +974,43 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 + * SubscriptionScheduleCreateParams.Phase.Plan.BillingThresholds#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 + * SubscriptionScheduleCreateParams.Phase.Plan.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ @@ -774,6 +1024,15 @@ public Builder setUsageGte(Long usageGte) { } public static class RenewalInterval { + /** + * 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; + /** * Interval at which to renew the subscription schedule for when it ends. Possible values are * `day`, `week`, `month`, or `year`. @@ -785,7 +1044,8 @@ public static class RenewalInterval { @SerializedName("length") Long length; - private RenewalInterval(Interval interval, Long length) { + private RenewalInterval(Map extraParams, Interval interval, Long length) { + this.extraParams = extraParams; this.interval = interval; this.length = length; } @@ -795,13 +1055,42 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Interval interval; private Long length; /** Finalize and obtain parameter instance from this builder. */ public RenewalInterval build() { - return new RenewalInterval(this.interval, this.length); + return new RenewalInterval(this.extraParams, this.interval, this.length); + } + + /** + * 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 + * SubscriptionScheduleCreateParams.RenewalInterval#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 SubscriptionScheduleCreateParams.RenewalInterval#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java index 65da7c19126..f051ca928c9 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleListParams extends ApiRequestParams { /** Only return subscription schedules that were created canceled the given date interval. */ @@ -37,6 +39,15 @@ public class SubscriptionScheduleListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -68,6 +79,7 @@ private SubscriptionScheduleListParams( String customer, String endingBefore, List expand, + Map extraParams, Long limit, Object releasedAt, Boolean scheduled, @@ -78,6 +90,7 @@ private SubscriptionScheduleListParams( this.customer = customer; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.releasedAt = releasedAt; this.scheduled = scheduled; @@ -101,6 +114,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private Object releasedAt; @@ -118,6 +133,7 @@ public SubscriptionScheduleListParams build() { this.customer, this.endingBefore, this.expand, + this.extraParams, this.limit, this.releasedAt, this.scheduled, @@ -203,6 +219,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleListParams#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 SubscriptionScheduleListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -243,6 +285,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class CanceledAt { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -259,7 +310,8 @@ public static class CanceledAt { @SerializedName("lte") Long lte; - private CanceledAt(Long gt, Long gte, Long lt, Long lte) { + private CanceledAt(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -271,6 +323,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -281,7 +335,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CanceledAt build() { - return new CanceledAt(this.gt, this.gte, this.lt, this.lte); + return new CanceledAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * SubscriptionScheduleListParams.CanceledAt#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 SubscriptionScheduleListParams.CanceledAt#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -311,6 +392,15 @@ public Builder setLte(Long lte) { } public static class CompletedAt { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -327,7 +417,8 @@ public static class CompletedAt { @SerializedName("lte") Long lte; - private CompletedAt(Long gt, Long gte, Long lt, Long lte) { + private CompletedAt(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -339,6 +430,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -349,7 +442,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CompletedAt build() { - return new CompletedAt(this.gt, this.gte, this.lt, this.lte); + return new CompletedAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * SubscriptionScheduleListParams.CompletedAt#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 SubscriptionScheduleListParams.CompletedAt#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -379,6 +499,15 @@ public Builder setLte(Long lte) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -395,7 +524,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -407,6 +537,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -417,7 +549,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * SubscriptionScheduleListParams.Created#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 SubscriptionScheduleListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -447,6 +605,15 @@ public Builder setLte(Long lte) { } public static class ReleasedAt { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -463,7 +630,8 @@ public static class ReleasedAt { @SerializedName("lte") Long lte; - private ReleasedAt(Long gt, Long gte, Long lt, Long lte) { + private ReleasedAt(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -475,6 +643,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -485,7 +655,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ReleasedAt build() { - return new ReleasedAt(this.gt, this.gte, this.lt, this.lte); + return new ReleasedAt(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * SubscriptionScheduleListParams.ReleasedAt#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 SubscriptionScheduleListParams.ReleasedAt#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleReleaseParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleReleaseParams.java index 1d12f38ca7f..76344c2d138 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleReleaseParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleReleaseParams.java @@ -5,19 +5,32 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleReleaseParams extends ApiRequestParams { /** 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; + /** Keep any cancellation on the subscription that the schedule has set. */ @SerializedName("preserve_cancel_date") Boolean preserveCancelDate; - private SubscriptionScheduleReleaseParams(List expand, Boolean preserveCancelDate) { + private SubscriptionScheduleReleaseParams( + List expand, Map extraParams, Boolean preserveCancelDate) { this.expand = expand; + this.extraParams = extraParams; this.preserveCancelDate = preserveCancelDate; } @@ -28,11 +41,14 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Boolean preserveCancelDate; /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleReleaseParams build() { - return new SubscriptionScheduleReleaseParams(this.expand, this.preserveCancelDate); + return new SubscriptionScheduleReleaseParams( + this.expand, this.extraParams, this.preserveCancelDate); } /** @@ -61,6 +77,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleReleaseParams#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 SubscriptionScheduleReleaseParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Keep any cancellation on the subscription that the schedule has set. */ public Builder setPreserveCancelDate(Boolean preserveCancelDate) { this.preserveCancelDate = preserveCancelDate; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleRetrieveParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleRetrieveParams.java index 056a5bb048a..8489a813d31 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleRetrieveParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SubscriptionScheduleRetrieveParams(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; + + private SubscriptionScheduleRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleRetrieveParams build() { - return new SubscriptionScheduleRetrieveParams(this.expand); + return new SubscriptionScheduleRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * SubscriptionScheduleRetrieveParams#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 SubscriptionScheduleRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionListParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionListParams.java index 2644a7ebc32..c218aab10dc 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleRevisionCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class SubscriptionScheduleRevisionCollectionListParams extends ApiRequest @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class SubscriptionScheduleRevisionCollectionListParams extends ApiRequest String startingAfter; private SubscriptionScheduleRevisionCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleRevisionCollectionListParams build() { return new SubscriptionScheduleRevisionCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,33 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleRevisionCollectionListParams#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 SubscriptionScheduleRevisionCollectionListParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionRetrieveParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionRetrieveParams.java index 53305c56959..7b928e40839 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionCollectionRetrieveParams.java @@ -5,15 +5,28 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleRevisionCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SubscriptionScheduleRevisionCollectionRetrieveParams(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; + + private SubscriptionScheduleRevisionCollectionRetrieveParams( + List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +36,12 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleRevisionCollectionRetrieveParams build() { - return new SubscriptionScheduleRevisionCollectionRetrieveParams(this.expand); + return new SubscriptionScheduleRevisionCollectionRetrieveParams( + this.expand, this.extraParams); } /** @@ -53,5 +69,33 @@ public Builder addAllExpand(List elements) { 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 + * SubscriptionScheduleRevisionCollectionRetrieveParams#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 SubscriptionScheduleRevisionCollectionRetrieveParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionsParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionsParams.java index 05f43613166..cf789556f7d 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleRevisionsParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleRevisionsParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SubscriptionScheduleRevisionsParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class SubscriptionScheduleRevisionsParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class SubscriptionScheduleRevisionsParams extends ApiRequestParams { String startingAfter; private SubscriptionScheduleRevisionsParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleRevisionsParams build() { return new SubscriptionScheduleRevisionsParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleRevisionsParams#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 SubscriptionScheduleRevisionsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index 89467a0d162..14b21b8be68 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -33,6 +33,15 @@ public class SubscriptionScheduleUpdateParams extends ApiRequestParams { @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; + /** All invoices will be billed using the specified settings. */ @SerializedName("invoice_settings") InvoiceSettings invoiceSettings; @@ -81,6 +90,7 @@ private SubscriptionScheduleUpdateParams( Billing billing, Object billingThresholds, List expand, + Map extraParams, InvoiceSettings invoiceSettings, Map metadata, List phases, @@ -90,6 +100,7 @@ private SubscriptionScheduleUpdateParams( this.billing = billing; this.billingThresholds = billingThresholds; this.expand = expand; + this.extraParams = extraParams; this.invoiceSettings = invoiceSettings; this.metadata = metadata; this.phases = phases; @@ -109,6 +120,8 @@ public static class Builder { private List expand; + private Map extraParams; + private InvoiceSettings invoiceSettings; private Map metadata; @@ -127,6 +140,7 @@ public SubscriptionScheduleUpdateParams build() { this.billing, this.billingThresholds, this.expand, + this.extraParams, this.invoiceSettings, this.metadata, this.phases, @@ -190,6 +204,32 @@ public Builder addAllExpand(List 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 + * SubscriptionScheduleUpdateParams#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 SubscriptionScheduleUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** All invoices will be billed using the specified settings. */ public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) { this.invoiceSettings = invoiceSettings; @@ -285,6 +325,15 @@ public static class BillingThresholds { @SerializedName("amount_gte") Long amountGte; + /** + * 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; + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, * `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; @@ -293,8 +342,10 @@ public static class BillingThresholds { @SerializedName("reset_billing_cycle_anchor") Boolean resetBillingCycleAnchor; - private BillingThresholds(Long amountGte, Boolean resetBillingCycleAnchor) { + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { this.amountGte = amountGte; + this.extraParams = extraParams; this.resetBillingCycleAnchor = resetBillingCycleAnchor; } @@ -305,11 +356,14 @@ public static Builder builder() { public static class Builder { private Long amountGte; + private Map extraParams; + private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.amountGte, this.resetBillingCycleAnchor); + return new BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } /** Monetary threshold that triggers the subscription to advance to a new billing period. */ @@ -318,6 +372,34 @@ public Builder setAmountGte(Long amountGte) { 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 + * SubscriptionScheduleUpdateParams.BillingThresholds#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 SubscriptionScheduleUpdateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If * true, `billing_cycle_anchor` will be updated to the date/time the threshold was last @@ -334,8 +416,18 @@ public static class InvoiceSettings { @SerializedName("days_until_due") Long daysUntilDue; - private InvoiceSettings(Long daysUntilDue) { + /** + * 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 InvoiceSettings(Long daysUntilDue, Map extraParams) { this.daysUntilDue = daysUntilDue; + this.extraParams = extraParams; } public static Builder builder() { @@ -345,15 +437,44 @@ public static Builder builder() { public static class Builder { private Long daysUntilDue; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceSettings build() { - return new InvoiceSettings(this.daysUntilDue); + return new InvoiceSettings(this.daysUntilDue, this.extraParams); } public Builder setDaysUntilDue(Long daysUntilDue) { this.daysUntilDue = daysUntilDue; 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 + * SubscriptionScheduleUpdateParams.InvoiceSettings#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 SubscriptionScheduleUpdateParams.InvoiceSettings#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } @@ -386,6 +507,15 @@ public static class Phase { @SerializedName("end_date") Object endDate; + /** + * 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; + /** * Integer representing the multiplier applied to the plan interval. For example, `iterations=2` * applied to a plan with `interval=month` and `interval_count=3` results in a phase of duration @@ -436,6 +566,7 @@ private Phase( String coupon, Object defaultTaxRates, Object endDate, + Map extraParams, Long iterations, List plans, Object startDate, @@ -446,6 +577,7 @@ private Phase( this.coupon = coupon; this.defaultTaxRates = defaultTaxRates; this.endDate = endDate; + this.extraParams = extraParams; this.iterations = iterations; this.plans = plans; this.startDate = startDate; @@ -467,6 +599,8 @@ public static class Builder { private Object endDate; + private Map extraParams; + private Long iterations; private List plans; @@ -486,6 +620,7 @@ public Phase build() { this.coupon, this.defaultTaxRates, this.endDate, + this.extraParams, this.iterations, this.plans, this.startDate, @@ -548,6 +683,32 @@ public Builder setEndDate(Long endDate) { 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 + * SubscriptionScheduleUpdateParams.Phase#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 SubscriptionScheduleUpdateParams.Phase#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Integer representing the multiplier applied to the plan interval. For example, * `iterations=2` applied to a plan with `interval=month` and `interval_count=3` results in a @@ -646,6 +807,15 @@ public static class Plan { @SerializedName("billing_thresholds") Object billingThresholds; + /** + * 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; + /** The plan ID to subscribe to. */ @SerializedName("plan") String plan; @@ -664,8 +834,14 @@ public static class Plan { @SerializedName("tax_rates") Object taxRates; - private Plan(Object billingThresholds, String plan, Long quantity, Object taxRates) { + private Plan( + Object billingThresholds, + Map extraParams, + String plan, + Long quantity, + Object taxRates) { this.billingThresholds = billingThresholds; + this.extraParams = extraParams; this.plan = plan; this.quantity = quantity; this.taxRates = taxRates; @@ -678,6 +854,8 @@ public static Builder builder() { public static class Builder { private Object billingThresholds; + private Map extraParams; + private String plan; private Long quantity; @@ -686,7 +864,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Plan build() { - return new Plan(this.billingThresholds, this.plan, this.quantity, this.taxRates); + return new Plan( + this.billingThresholds, this.extraParams, this.plan, this.quantity, this.taxRates); } /** @@ -707,6 +886,34 @@ public Builder setBillingThresholds(EmptyParam billingThresholds) { 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 SubscriptionScheduleUpdateParams.Phase.Plan#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 SubscriptionScheduleUpdateParams.Phase.Plan#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The plan ID to subscribe to. */ public Builder setPlan(String plan) { this.plan = plan; @@ -742,11 +949,22 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -756,11 +974,43 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 + * SubscriptionScheduleUpdateParams.Phase.Plan.BillingThresholds#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 + * SubscriptionScheduleUpdateParams.Phase.Plan.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ @@ -810,6 +1060,15 @@ public enum TrialEnd implements ApiRequestParams.EnumParam { } public static class RenewalInterval { + /** + * 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; + /** * Interval at which to renew the subscription schedule for when it ends. Possible values are * `day`, `week`, `month`, or `year`. @@ -821,7 +1080,8 @@ public static class RenewalInterval { @SerializedName("length") Long length; - private RenewalInterval(Interval interval, Long length) { + private RenewalInterval(Map extraParams, Interval interval, Long length) { + this.extraParams = extraParams; this.interval = interval; this.length = length; } @@ -831,13 +1091,42 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Interval interval; private Long length; /** Finalize and obtain parameter instance from this builder. */ public RenewalInterval build() { - return new RenewalInterval(this.interval, this.length); + return new RenewalInterval(this.extraParams, this.interval, this.length); + } + + /** + * 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 + * SubscriptionScheduleUpdateParams.RenewalInterval#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 SubscriptionScheduleUpdateParams.RenewalInterval#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 9ca785bef9c..c8026555e20 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -101,6 +101,15 @@ public class SubscriptionUpdateParams extends ApiRequestParams { @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; + /** List of subscription items, each with an attached plan. */ @SerializedName("items") List items; @@ -183,6 +192,7 @@ private SubscriptionUpdateParams( String defaultSource, Object defaultTaxRates, List expand, + Map extraParams, List items, Map metadata, Boolean prorate, @@ -203,6 +213,7 @@ private SubscriptionUpdateParams( this.defaultSource = defaultSource; this.defaultTaxRates = defaultTaxRates; this.expand = expand; + this.extraParams = extraParams; this.items = items; this.metadata = metadata; this.prorate = prorate; @@ -242,6 +253,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List items; private Map metadata; @@ -273,6 +286,7 @@ public SubscriptionUpdateParams build() { this.defaultSource, this.defaultTaxRates, this.expand, + this.extraParams, this.items, this.metadata, this.prorate, @@ -442,6 +456,32 @@ public Builder addAllExpand(List 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 + * SubscriptionUpdateParams#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 SubscriptionUpdateParams#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 an element to `items` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -606,6 +646,15 @@ public static class BillingThresholds { @SerializedName("amount_gte") Long amountGte; + /** + * 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; + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, * `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; @@ -614,8 +663,10 @@ public static class BillingThresholds { @SerializedName("reset_billing_cycle_anchor") Boolean resetBillingCycleAnchor; - private BillingThresholds(Long amountGte, Boolean resetBillingCycleAnchor) { + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { this.amountGte = amountGte; + this.extraParams = extraParams; this.resetBillingCycleAnchor = resetBillingCycleAnchor; } @@ -626,11 +677,14 @@ public static Builder builder() { public static class Builder { private Long amountGte; + private Map extraParams; + private Boolean resetBillingCycleAnchor; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.amountGte, this.resetBillingCycleAnchor); + return new BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); } /** Monetary threshold that triggers the subscription to advance to a new billing period. */ @@ -639,6 +693,33 @@ public Builder setAmountGte(Long amountGte) { 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 + * SubscriptionUpdateParams.BillingThresholds#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 SubscriptionUpdateParams.BillingThresholds#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If * true, `billing_cycle_anchor` will be updated to the date/time the threshold was last @@ -670,6 +751,15 @@ public static class Item { @SerializedName("deleted") Boolean deleted; + /** + * 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; + /** Subscription item to update. */ @SerializedName("id") String id; @@ -700,6 +790,7 @@ private Item( Object billingThresholds, Boolean clearUsage, Boolean deleted, + Map extraParams, String id, Map metadata, String plan, @@ -708,6 +799,7 @@ private Item( this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; this.deleted = deleted; + this.extraParams = extraParams; this.id = id; this.metadata = metadata; this.plan = plan; @@ -726,6 +818,8 @@ public static class Builder { private Boolean deleted; + private Map extraParams; + private String id; private Map metadata; @@ -742,6 +836,7 @@ public Item build() { this.billingThresholds, this.clearUsage, this.deleted, + this.extraParams, this.id, this.metadata, this.plan, @@ -782,6 +877,32 @@ public Builder setDeleted(Boolean deleted) { 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 + * SubscriptionUpdateParams.Item#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 SubscriptionUpdateParams.Item#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Subscription item to update. */ public Builder setId(String id) { this.id = id; @@ -846,11 +967,21 @@ public Builder setTaxRates(List taxRates) { } public static class BillingThresholds { + /** + * 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; + /** Usage threshold that triggers the subscription to advance to a new billing period. */ @SerializedName("usage_gte") Long usageGte; - private BillingThresholds(Long usageGte) { + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; this.usageGte = usageGte; } @@ -859,11 +990,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long usageGte; /** Finalize and obtain parameter instance from this builder. */ public BillingThresholds build() { - return new BillingThresholds(this.usageGte); + return new BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * 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 SubscriptionUpdateParams.Item.BillingThresholds#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 SubscriptionUpdateParams.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Usage threshold that triggers the subscription to advance to a new billing period. */ @@ -880,8 +1041,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -891,9 +1062,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** ID of an existing, connected Stripe account. */ @@ -901,6 +1074,32 @@ public Builder setDestination(String destination) { this.destination = destination; 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 + * SubscriptionUpdateParams.TransferData#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 SubscriptionUpdateParams.TransferData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index 330cb6e54bf..2836e5dd25f 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class TaxIdCollectionCreateParams extends ApiRequestParams { @@ -13,6 +15,15 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { @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; + /** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */ @SerializedName("type") Type type; @@ -21,8 +32,10 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { @SerializedName("value") String value; - private TaxIdCollectionCreateParams(List expand, Type type, String value) { + private TaxIdCollectionCreateParams( + List expand, Map extraParams, Type type, String value) { this.expand = expand; + this.extraParams = extraParams; this.type = type; this.value = value; } @@ -34,13 +47,15 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Type type; private String value; /** Finalize and obtain parameter instance from this builder. */ public TaxIdCollectionCreateParams build() { - return new TaxIdCollectionCreateParams(this.expand, this.type, this.value); + return new TaxIdCollectionCreateParams(this.expand, this.extraParams, this.type, this.value); } /** @@ -69,6 +84,32 @@ public Builder addAllExpand(List 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 + * TaxIdCollectionCreateParams#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 TaxIdCollectionCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */ public Builder setType(Type type) { this.type = type; diff --git a/src/main/java/com/stripe/param/TaxIdCollectionListParams.java b/src/main/java/com/stripe/param/TaxIdCollectionListParams.java index fbec1cedee0..7e3727e3373 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionListParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TaxIdCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class TaxIdCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class TaxIdCollectionListParams extends ApiRequestParams { String startingAfter; private TaxIdCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public TaxIdCollectionListParams build() { return new TaxIdCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * TaxIdCollectionListParams#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 TaxIdCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/TaxIdCollectionRetrieveParams.java b/src/main/java/com/stripe/param/TaxIdCollectionRetrieveParams.java index b48d96098d2..274ec1c1754 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TaxIdCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TaxIdCollectionRetrieveParams(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; + + private TaxIdCollectionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TaxIdCollectionRetrieveParams build() { - return new TaxIdCollectionRetrieveParams(this.expand); + return new TaxIdCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TaxIdCollectionRetrieveParams#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 TaxIdCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TaxRateCreateParams.java b/src/main/java/com/stripe/param/TaxRateCreateParams.java index 46e97815c2a..7c3c64b6ec9 100644 --- a/src/main/java/com/stripe/param/TaxRateCreateParams.java +++ b/src/main/java/com/stripe/param/TaxRateCreateParams.java @@ -33,6 +33,15 @@ public class TaxRateCreateParams extends ApiRequestParams { @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; + /** This specifies if the tax rate is inclusive or exclusive. */ @SerializedName("inclusive") Boolean inclusive; @@ -58,6 +67,7 @@ private TaxRateCreateParams( String description, String displayName, List expand, + Map extraParams, Boolean inclusive, String jurisdiction, Map metadata, @@ -66,6 +76,7 @@ private TaxRateCreateParams( this.description = description; this.displayName = displayName; this.expand = expand; + this.extraParams = extraParams; this.inclusive = inclusive; this.jurisdiction = jurisdiction; this.metadata = metadata; @@ -85,6 +96,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean inclusive; private String jurisdiction; @@ -100,6 +113,7 @@ public TaxRateCreateParams build() { this.description, this.displayName, this.expand, + this.extraParams, this.inclusive, this.jurisdiction, this.metadata, @@ -156,6 +170,32 @@ public Builder addAllExpand(List 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 + * TaxRateCreateParams#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 TaxRateCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** This specifies if the tax rate is inclusive or exclusive. */ public Builder setInclusive(Boolean inclusive) { this.inclusive = inclusive; diff --git a/src/main/java/com/stripe/param/TaxRateListParams.java b/src/main/java/com/stripe/param/TaxRateListParams.java index 420c1ec3683..a49ab104089 100644 --- a/src/main/java/com/stripe/param/TaxRateListParams.java +++ b/src/main/java/com/stripe/param/TaxRateListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TaxRateListParams extends ApiRequestParams { /** Optional flag to filter by tax rates that are either active or not active (archived). */ @@ -29,6 +31,15 @@ public class TaxRateListParams extends ApiRequestParams { @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; + /** Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). */ @SerializedName("inclusive") Boolean inclusive; @@ -58,6 +69,7 @@ private TaxRateListParams( Object created, String endingBefore, List expand, + Map extraParams, Boolean inclusive, Long limit, Object percentage, @@ -66,6 +78,7 @@ private TaxRateListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.inclusive = inclusive; this.limit = limit; this.percentage = percentage; @@ -85,6 +98,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean inclusive; private Long limit; @@ -100,6 +115,7 @@ public TaxRateListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.inclusive, this.limit, this.percentage, @@ -161,6 +177,32 @@ public Builder addAllExpand(List 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 + * TaxRateListParams#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 TaxRateListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). */ @@ -203,6 +245,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -219,7 +270,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -231,6 +283,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -241,7 +295,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TaxRateListParams.Created#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 TaxRateListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -271,6 +351,15 @@ public Builder setLte(Long lte) { } public static class Percentage { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -287,7 +376,8 @@ public static class Percentage { @SerializedName("lte") Long lte; - private Percentage(Long gt, Long gte, Long lt, Long lte) { + private Percentage(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -299,6 +389,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -309,7 +401,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Percentage build() { - return new Percentage(this.gt, this.gte, this.lt, this.lte); + return new Percentage(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TaxRateListParams.Percentage#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 TaxRateListParams.Percentage#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/TaxRateRetrieveParams.java b/src/main/java/com/stripe/param/TaxRateRetrieveParams.java index af69b9448c9..ef90dc2fc29 100644 --- a/src/main/java/com/stripe/param/TaxRateRetrieveParams.java +++ b/src/main/java/com/stripe/param/TaxRateRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TaxRateRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TaxRateRetrieveParams(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; + + private TaxRateRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TaxRateRetrieveParams build() { - return new TaxRateRetrieveParams(this.expand); + return new TaxRateRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TaxRateRetrieveParams#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 TaxRateRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TaxRateUpdateParams.java b/src/main/java/com/stripe/param/TaxRateUpdateParams.java index a218333f74d..b716ca28a39 100644 --- a/src/main/java/com/stripe/param/TaxRateUpdateParams.java +++ b/src/main/java/com/stripe/param/TaxRateUpdateParams.java @@ -32,6 +32,15 @@ public class TaxRateUpdateParams extends ApiRequestParams { @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; + /** The jurisdiction for the tax rate. */ @SerializedName("jurisdiction") String jurisdiction; @@ -49,12 +58,14 @@ private TaxRateUpdateParams( String description, String displayName, List expand, + Map extraParams, String jurisdiction, Map metadata) { this.active = active; this.description = description; this.displayName = displayName; this.expand = expand; + this.extraParams = extraParams; this.jurisdiction = jurisdiction; this.metadata = metadata; } @@ -72,6 +83,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String jurisdiction; private Map metadata; @@ -83,6 +96,7 @@ public TaxRateUpdateParams build() { this.description, this.displayName, this.expand, + this.extraParams, this.jurisdiction, this.metadata); } @@ -137,6 +151,32 @@ public Builder addAllExpand(List 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 + * TaxRateUpdateParams#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 TaxRateUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The jurisdiction for the tax rate. */ public Builder setJurisdiction(String jurisdiction) { this.jurisdiction = jurisdiction; diff --git a/src/main/java/com/stripe/param/ThreeDSecureCreateParams.java b/src/main/java/com/stripe/param/ThreeDSecureCreateParams.java index c29163c491d..cb67404556c 100644 --- a/src/main/java/com/stripe/param/ThreeDSecureCreateParams.java +++ b/src/main/java/com/stripe/param/ThreeDSecureCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ThreeDSecureCreateParams extends ApiRequestParams { /** Amount of the charge that you will create when authentication completes. */ @@ -30,6 +32,15 @@ public class ThreeDSecureCreateParams extends ApiRequestParams { @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; + /** The URL that the cardholder's browser will be returned to when authentication completes. */ @SerializedName("return_url") String returnUrl; @@ -40,12 +51,14 @@ private ThreeDSecureCreateParams( String currency, String customer, List expand, + Map extraParams, String returnUrl) { this.amount = amount; this.card = card; this.currency = currency; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.returnUrl = returnUrl; } @@ -64,12 +77,20 @@ public static class Builder { private List expand; + private Map extraParams; + private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ public ThreeDSecureCreateParams build() { return new ThreeDSecureCreateParams( - this.amount, this.card, this.currency, this.customer, this.expand, this.returnUrl); + this.amount, + this.card, + this.currency, + this.customer, + this.expand, + this.extraParams, + this.returnUrl); } /** Amount of the charge that you will create when authentication completes. */ @@ -124,6 +145,32 @@ public Builder addAllExpand(List 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 + * ThreeDSecureCreateParams#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 ThreeDSecureCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The URL that the cardholder's browser will be returned to when authentication completes. */ public Builder setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; diff --git a/src/main/java/com/stripe/param/ThreeDSecureRetrieveParams.java b/src/main/java/com/stripe/param/ThreeDSecureRetrieveParams.java index 56f9b3f6e35..1e7ac144a19 100644 --- a/src/main/java/com/stripe/param/ThreeDSecureRetrieveParams.java +++ b/src/main/java/com/stripe/param/ThreeDSecureRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ThreeDSecureRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ThreeDSecureRetrieveParams(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; + + private ThreeDSecureRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ThreeDSecureRetrieveParams build() { - return new ThreeDSecureRetrieveParams(this.expand); + return new ThreeDSecureRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ThreeDSecureRetrieveParams#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 ThreeDSecureRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index 5727d31839a..ae661668664 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class TokenCreateParams extends ApiRequestParams { @@ -30,16 +32,31 @@ public class TokenCreateParams extends ApiRequestParams { @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; + /** The PII this token will represent. */ @SerializedName("pii") Pii pii; private TokenCreateParams( - BankAccount bankAccount, Object card, String customer, List expand, Pii pii) { + BankAccount bankAccount, + Object card, + String customer, + List expand, + Map extraParams, + Pii pii) { this.bankAccount = bankAccount; this.card = card; this.customer = customer; this.expand = expand; + this.extraParams = extraParams; this.pii = pii; } @@ -56,12 +73,14 @@ public static class Builder { private List expand; + private Map extraParams; + private Pii pii; /** Finalize and obtain parameter instance from this builder. */ public TokenCreateParams build() { return new TokenCreateParams( - this.bankAccount, this.card, this.customer, this.expand, this.pii); + this.bankAccount, this.card, this.customer, this.expand, this.extraParams, this.pii); } /** The bank account this token will represent. */ @@ -118,6 +137,32 @@ public Builder addAllExpand(List 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 + * TokenCreateParams#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 TokenCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The PII this token will represent. */ public Builder setPii(Pii pii) { this.pii = pii; @@ -155,6 +200,15 @@ public static class BankAccount { @SerializedName("currency") String currency; + /** + * 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; + /** * The routing number, sort code, or other country-appropriateinstitution number for the bank * account. For US bank accounts, this is required and should bethe ACH routing number, not the @@ -170,12 +224,14 @@ private BankAccount( String accountNumber, String country, String currency, + Map extraParams, String routingNumber) { this.accountHolderName = accountHolderName; this.accountHolderType = accountHolderType; this.accountNumber = accountNumber; this.country = country; this.currency = currency; + this.extraParams = extraParams; this.routingNumber = routingNumber; } @@ -194,6 +250,8 @@ public static class Builder { private String currency; + private Map extraParams; + private String routingNumber; /** Finalize and obtain parameter instance from this builder. */ @@ -204,6 +262,7 @@ public BankAccount build() { this.accountNumber, this.country, this.currency, + this.extraParams, this.routingNumber); } @@ -246,6 +305,32 @@ public Builder setCurrency(String currency) { 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 + * TokenCreateParams.BankAccount#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 TokenCreateParams.BankAccount#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The routing number, sort code, or other country-appropriateinstitution number for the bank * account. For US bank accounts, this is required and should bethe ACH routing number, not @@ -305,6 +390,15 @@ public static class Card { @SerializedName("exp_year") String 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; + @SerializedName("name") String name; @@ -322,6 +416,7 @@ private Card( String cvc, String expMonth, String expYear, + Map extraParams, String name, String number) { this.addressCity = addressCity; @@ -334,6 +429,7 @@ private Card( this.cvc = cvc; this.expMonth = expMonth; this.expYear = expYear; + this.extraParams = extraParams; this.name = name; this.number = number; } @@ -363,6 +459,8 @@ public static class Builder { private String expYear; + private Map extraParams; + private String name; private String number; @@ -380,6 +478,7 @@ public Card build() { this.cvc, this.expMonth, this.expYear, + this.extraParams, this.name, this.number); } @@ -434,6 +533,32 @@ public Builder setExpYear(String 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 + * TokenCreateParams.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; + } + + /** + * 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 TokenCreateParams.Card#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + public Builder setName(String name) { this.name = name; return this; @@ -447,11 +572,21 @@ public Builder setNumber(String number) { } public static class Pii { + /** + * 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; + /** The `id_number` for the PII, in string form. */ @SerializedName("id_number") String idNumber; - private Pii(String idNumber) { + private Pii(Map extraParams, String idNumber) { + this.extraParams = extraParams; this.idNumber = idNumber; } @@ -460,11 +595,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String idNumber; /** Finalize and obtain parameter instance from this builder. */ public Pii build() { - return new Pii(this.idNumber); + return new Pii(this.extraParams, this.idNumber); + } + + /** + * 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 + * TokenCreateParams.Pii#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 TokenCreateParams.Pii#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** The `id_number` for the PII, in string form. */ diff --git a/src/main/java/com/stripe/param/TokenRetrieveParams.java b/src/main/java/com/stripe/param/TokenRetrieveParams.java index b371aef0e6e..8eb229e46d0 100644 --- a/src/main/java/com/stripe/param/TokenRetrieveParams.java +++ b/src/main/java/com/stripe/param/TokenRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TokenRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TokenRetrieveParams(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; + + private TokenRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TokenRetrieveParams build() { - return new TokenRetrieveParams(this.expand); + return new TokenRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TokenRetrieveParams#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 TokenRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TopupCancelParams.java b/src/main/java/com/stripe/param/TopupCancelParams.java index eec141ec02e..20b5058acd9 100644 --- a/src/main/java/com/stripe/param/TopupCancelParams.java +++ b/src/main/java/com/stripe/param/TopupCancelParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TopupCancelParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TopupCancelParams(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; + + private TopupCancelParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TopupCancelParams build() { - return new TopupCancelParams(this.expand); + return new TopupCancelParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TopupCancelParams#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 TopupCancelParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TopupCreateParams.java b/src/main/java/com/stripe/param/TopupCreateParams.java index 7fd42be79f4..bfcf75b8147 100644 --- a/src/main/java/com/stripe/param/TopupCreateParams.java +++ b/src/main/java/com/stripe/param/TopupCreateParams.java @@ -29,6 +29,15 @@ public class TopupCreateParams extends ApiRequestParams { @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. @@ -61,6 +70,7 @@ private TopupCreateParams( String currency, String description, List expand, + Map extraParams, Map metadata, String source, String statementDescriptor, @@ -69,6 +79,7 @@ private TopupCreateParams( this.currency = currency; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.source = source; this.statementDescriptor = statementDescriptor; @@ -88,6 +99,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String source; @@ -103,6 +116,7 @@ public TopupCreateParams build() { this.currency, this.description, this.expand, + this.extraParams, this.metadata, this.source, this.statementDescriptor, @@ -156,6 +170,32 @@ public Builder addAllExpand(List 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 + * TopupCreateParams#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 TopupCreateParams#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 diff --git a/src/main/java/com/stripe/param/TopupListParams.java b/src/main/java/com/stripe/param/TopupListParams.java index 88b2515c406..f79c29eadff 100644 --- a/src/main/java/com/stripe/param/TopupListParams.java +++ b/src/main/java/com/stripe/param/TopupListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class TopupListParams extends ApiRequestParams { @@ -33,6 +35,15 @@ public class TopupListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -61,6 +72,7 @@ private TopupListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, Status status) { @@ -68,6 +80,7 @@ private TopupListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.status = status; @@ -86,6 +99,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -99,6 +114,7 @@ public TopupListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.status); @@ -171,6 +187,32 @@ public Builder addAllExpand(List 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 + * TopupListParams#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 TopupListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -202,6 +244,15 @@ public Builder setStatus(Status status) { } public static class Amount { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -218,7 +269,8 @@ public static class Amount { @SerializedName("lte") Long lte; - private Amount(Long gt, Long gte, Long lt, Long lte) { + private Amount(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -230,6 +282,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -240,7 +294,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Amount build() { - return new Amount(this.gt, this.gte, this.lt, this.lte); + return new Amount(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TopupListParams.Amount#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 TopupListParams.Amount#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ @@ -270,6 +350,15 @@ public Builder setLte(Long lte) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -286,7 +375,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -298,6 +388,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -308,7 +400,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TopupListParams.Created#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 TopupListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/TopupRetrieveParams.java b/src/main/java/com/stripe/param/TopupRetrieveParams.java index 5b0705dd7b2..83c6713cbc3 100644 --- a/src/main/java/com/stripe/param/TopupRetrieveParams.java +++ b/src/main/java/com/stripe/param/TopupRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TopupRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TopupRetrieveParams(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; + + private TopupRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TopupRetrieveParams build() { - return new TopupRetrieveParams(this.expand); + return new TopupRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TopupRetrieveParams#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 TopupRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TopupUpdateParams.java b/src/main/java/com/stripe/param/TopupUpdateParams.java index d04ab372531..f44d562ad35 100644 --- a/src/main/java/com/stripe/param/TopupUpdateParams.java +++ b/src/main/java/com/stripe/param/TopupUpdateParams.java @@ -18,6 +18,15 @@ public class TopupUpdateParams extends ApiRequestParams { @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. @@ -25,9 +34,14 @@ public class TopupUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private TopupUpdateParams(String description, List expand, Map metadata) { + private TopupUpdateParams( + String description, + List expand, + Map extraParams, + Map metadata) { this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -40,11 +54,13 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public TopupUpdateParams build() { - return new TopupUpdateParams(this.description, this.expand, this.metadata); + return new TopupUpdateParams(this.description, this.expand, this.extraParams, this.metadata); } /** An arbitrary string attached to the object. Often useful for displaying to users. */ @@ -79,6 +95,32 @@ public Builder addAllExpand(List 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 + * TopupUpdateParams#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 TopupUpdateParams#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 diff --git a/src/main/java/com/stripe/param/TransferCreateParams.java b/src/main/java/com/stripe/param/TransferCreateParams.java index 2972aef8800..1edfe19b511 100644 --- a/src/main/java/com/stripe/param/TransferCreateParams.java +++ b/src/main/java/com/stripe/param/TransferCreateParams.java @@ -34,6 +34,15 @@ public class TransferCreateParams extends ApiRequestParams { @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 @@ -73,6 +82,7 @@ private TransferCreateParams( String description, String destination, List expand, + Map extraParams, Map metadata, String sourceTransaction, SourceType sourceType, @@ -82,6 +92,7 @@ private TransferCreateParams( this.description = description; this.destination = destination; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.sourceTransaction = sourceTransaction; this.sourceType = sourceType; @@ -103,6 +114,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String sourceTransaction; @@ -119,6 +132,7 @@ public TransferCreateParams build() { this.description, this.destination, this.expand, + this.extraParams, this.metadata, this.sourceTransaction, this.sourceType, @@ -178,6 +192,32 @@ public Builder addAllExpand(List 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 + * TransferCreateParams#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 TransferCreateParams#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 diff --git a/src/main/java/com/stripe/param/TransferListParams.java b/src/main/java/com/stripe/param/TransferListParams.java index 577bcae59d6..240fb0a5a0a 100644 --- a/src/main/java/com/stripe/param/TransferListParams.java +++ b/src/main/java/com/stripe/param/TransferListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransferListParams extends ApiRequestParams { @SerializedName("created") @@ -28,6 +30,15 @@ public class TransferListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -53,6 +64,7 @@ private TransferListParams( String destination, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, String transferGroup) { @@ -60,6 +72,7 @@ private TransferListParams( this.destination = destination; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.transferGroup = transferGroup; @@ -78,6 +91,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -91,6 +106,7 @@ public TransferListParams build() { this.destination, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.transferGroup); @@ -149,6 +165,32 @@ public Builder addAllExpand(List 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 + * TransferListParams#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 TransferListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -177,6 +219,15 @@ public Builder setTransferGroup(String transferGroup) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -193,7 +244,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -205,6 +257,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -215,7 +269,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TransferListParams.Created#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 TransferListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/TransferRetrieveParams.java b/src/main/java/com/stripe/param/TransferRetrieveParams.java index 8029685625b..9af0e4bc6f6 100644 --- a/src/main/java/com/stripe/param/TransferRetrieveParams.java +++ b/src/main/java/com/stripe/param/TransferRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransferRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TransferRetrieveParams(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; + + private TransferRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferRetrieveParams build() { - return new TransferRetrieveParams(this.expand); + return new TransferRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TransferRetrieveParams#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 TransferRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TransferReversalCollectionCreateParams.java b/src/main/java/com/stripe/param/TransferReversalCollectionCreateParams.java index 3ff5b785dae..cdfdb47b438 100644 --- a/src/main/java/com/stripe/param/TransferReversalCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TransferReversalCollectionCreateParams.java @@ -29,6 +29,15 @@ public class TransferReversalCollectionCreateParams extends ApiRequestParams { @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 @@ -50,11 +59,13 @@ private TransferReversalCollectionCreateParams( Long amount, String description, List expand, + Map extraParams, Map metadata, Boolean refundApplicationFee) { this.amount = amount; this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.refundApplicationFee = refundApplicationFee; } @@ -70,6 +81,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Boolean refundApplicationFee; @@ -77,7 +90,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public TransferReversalCollectionCreateParams build() { return new TransferReversalCollectionCreateParams( - this.amount, this.description, this.expand, this.metadata, this.refundApplicationFee); + this.amount, + this.description, + this.expand, + this.extraParams, + this.metadata, + this.refundApplicationFee); } /** @@ -125,6 +143,32 @@ public Builder addAllExpand(List 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 + * TransferReversalCollectionCreateParams#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 TransferReversalCollectionCreateParams#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 diff --git a/src/main/java/com/stripe/param/TransferReversalCollectionListParams.java b/src/main/java/com/stripe/param/TransferReversalCollectionListParams.java index 0aaace5d2b4..87f40a6b5da 100644 --- a/src/main/java/com/stripe/param/TransferReversalCollectionListParams.java +++ b/src/main/java/com/stripe/param/TransferReversalCollectionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransferReversalCollectionListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class TransferReversalCollectionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class TransferReversalCollectionListParams extends ApiRequestParams { String startingAfter; private TransferReversalCollectionListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public TransferReversalCollectionListParams build() { return new TransferReversalCollectionListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * TransferReversalCollectionListParams#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 TransferReversalCollectionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/TransferReversalCollectionRetrieveParams.java b/src/main/java/com/stripe/param/TransferReversalCollectionRetrieveParams.java index 4254b0b76e4..73c252b75db 100644 --- a/src/main/java/com/stripe/param/TransferReversalCollectionRetrieveParams.java +++ b/src/main/java/com/stripe/param/TransferReversalCollectionRetrieveParams.java @@ -5,15 +5,28 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransferReversalCollectionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TransferReversalCollectionRetrieveParams(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; + + private TransferReversalCollectionRetrieveParams( + List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +36,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferReversalCollectionRetrieveParams build() { - return new TransferReversalCollectionRetrieveParams(this.expand); + return new TransferReversalCollectionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +68,31 @@ public Builder addAllExpand(List elements) { 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 + * TransferReversalCollectionRetrieveParams#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 TransferReversalCollectionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/TransferReversalUpdateParams.java b/src/main/java/com/stripe/param/TransferReversalUpdateParams.java index 7919a12baa4..2f4a25f034e 100644 --- a/src/main/java/com/stripe/param/TransferReversalUpdateParams.java +++ b/src/main/java/com/stripe/param/TransferReversalUpdateParams.java @@ -14,6 +14,15 @@ public class TransferReversalUpdateParams extends ApiRequestParams { @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 @@ -22,8 +31,10 @@ public class TransferReversalUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private TransferReversalUpdateParams(List expand, Map metadata) { + private TransferReversalUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -34,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public TransferReversalUpdateParams build() { - return new TransferReversalUpdateParams(this.expand, this.metadata); + return new TransferReversalUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -67,6 +80,32 @@ public Builder addAllExpand(List 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 + * TransferReversalUpdateParams#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 TransferReversalUpdateParams#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 diff --git a/src/main/java/com/stripe/param/TransferUpdateParams.java b/src/main/java/com/stripe/param/TransferUpdateParams.java index b2cb0c3e04c..e925869c38c 100644 --- a/src/main/java/com/stripe/param/TransferUpdateParams.java +++ b/src/main/java/com/stripe/param/TransferUpdateParams.java @@ -18,6 +18,15 @@ public class TransferUpdateParams extends ApiRequestParams { @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 @@ -27,9 +36,13 @@ public class TransferUpdateParams extends ApiRequestParams { Map metadata; private TransferUpdateParams( - String description, List expand, Map metadata) { + String description, + List expand, + Map extraParams, + Map metadata) { this.description = description; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -42,11 +55,14 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public TransferUpdateParams build() { - return new TransferUpdateParams(this.description, this.expand, this.metadata); + return new TransferUpdateParams( + this.description, this.expand, this.extraParams, this.metadata); } /** An arbitrary string attached to the object. Often useful for displaying to users. */ @@ -81,6 +97,32 @@ public Builder addAllExpand(List 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 + * TransferUpdateParams#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 TransferUpdateParams#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 diff --git a/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java b/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java index db555aa8f48..690dff5c65e 100644 --- a/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java +++ b/src/main/java/com/stripe/param/UsageRecordCreateOnSubscriptionItemParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class UsageRecordCreateOnSubscriptionItemParams extends ApiRequestParams { @@ -23,6 +25,15 @@ public class UsageRecordCreateOnSubscriptionItemParams extends ApiRequestParams @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; + /** The usage quantity for the specified timestamp. */ @SerializedName("quantity") Long quantity; @@ -35,9 +46,14 @@ public class UsageRecordCreateOnSubscriptionItemParams extends ApiRequestParams Long timestamp; private UsageRecordCreateOnSubscriptionItemParams( - Action action, List expand, Long quantity, Long timestamp) { + Action action, + List expand, + Map extraParams, + Long quantity, + Long timestamp) { this.action = action; this.expand = expand; + this.extraParams = extraParams; this.quantity = quantity; this.timestamp = timestamp; } @@ -51,6 +67,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long quantity; private Long timestamp; @@ -58,7 +76,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public UsageRecordCreateOnSubscriptionItemParams build() { return new UsageRecordCreateOnSubscriptionItemParams( - this.action, this.expand, this.quantity, this.timestamp); + this.action, this.expand, this.extraParams, this.quantity, this.timestamp); } /** @@ -99,6 +117,33 @@ public Builder addAllExpand(List 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 + * UsageRecordCreateOnSubscriptionItemParams#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 UsageRecordCreateOnSubscriptionItemParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The usage quantity for the specified timestamp. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 8e02aa3341a..e28fa7df7b9 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class WebhookEndpointCreateParams extends ApiRequestParams { @@ -33,6 +35,15 @@ public class WebhookEndpointCreateParams extends ApiRequestParams { @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; + /** The URL of the webhook endpoint. */ @SerializedName("url") String url; @@ -42,11 +53,13 @@ private WebhookEndpointCreateParams( Boolean connect, List enabledEvents, List expand, + Map extraParams, String url) { this.apiVersion = apiVersion; this.connect = connect; this.enabledEvents = enabledEvents; this.expand = expand; + this.extraParams = extraParams; this.url = url; } @@ -63,12 +76,19 @@ public static class Builder { private List expand; + private Map extraParams; + private String url; /** Finalize and obtain parameter instance from this builder. */ public WebhookEndpointCreateParams build() { return new WebhookEndpointCreateParams( - this.apiVersion, this.connect, this.enabledEvents, this.expand, this.url); + this.apiVersion, + this.connect, + this.enabledEvents, + this.expand, + this.extraParams, + this.url); } /** @@ -141,6 +161,32 @@ public Builder addAllExpand(List 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 + * WebhookEndpointCreateParams#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 WebhookEndpointCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The URL of the webhook endpoint. */ public Builder setUrl(String url) { this.url = url; @@ -683,6 +729,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("payment_method.detached") PAYMENT_METHOD__DETACHED("payment_method.detached"), + @SerializedName("payment_method.updated") + PAYMENT_METHOD__UPDATED("payment_method.updated"), + @SerializedName("payout.canceled") PAYOUT__CANCELED("payout.canceled"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointListParams.java b/src/main/java/com/stripe/param/WebhookEndpointListParams.java index f5a1e0cbf16..a8aeda835df 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointListParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class WebhookEndpointListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class WebhookEndpointListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class WebhookEndpointListParams extends ApiRequestParams { String startingAfter; private WebhookEndpointListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public WebhookEndpointListParams build() { return new WebhookEndpointListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * WebhookEndpointListParams#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 WebhookEndpointListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/WebhookEndpointRetrieveParams.java b/src/main/java/com/stripe/param/WebhookEndpointRetrieveParams.java index 9143e8949b5..226c7b46ab2 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointRetrieveParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class WebhookEndpointRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private WebhookEndpointRetrieveParams(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; + + private WebhookEndpointRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public WebhookEndpointRetrieveParams build() { - return new WebhookEndpointRetrieveParams(this.expand); + return new WebhookEndpointRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * WebhookEndpointRetrieveParams#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 WebhookEndpointRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index b6ab8f6934d..e1cca7d5ae8 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class WebhookEndpointUpdateParams extends ApiRequestParams { @@ -23,15 +25,29 @@ public class WebhookEndpointUpdateParams extends ApiRequestParams { @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; + /** The URL of the webhook endpoint. */ @SerializedName("url") String url; private WebhookEndpointUpdateParams( - Boolean disabled, List enabledEvents, List expand, String url) { + Boolean disabled, + List enabledEvents, + List expand, + Map extraParams, + String url) { this.disabled = disabled; this.enabledEvents = enabledEvents; this.expand = expand; + this.extraParams = extraParams; this.url = url; } @@ -46,12 +62,14 @@ public static class Builder { private List expand; + private Map extraParams; + private String url; /** Finalize and obtain parameter instance from this builder. */ public WebhookEndpointUpdateParams build() { return new WebhookEndpointUpdateParams( - this.disabled, this.enabledEvents, this.expand, this.url); + this.disabled, this.enabledEvents, this.expand, this.extraParams, this.url); } /** Disable the webhook endpoint if set to true. */ @@ -112,6 +130,32 @@ public Builder addAllExpand(List 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 + * WebhookEndpointUpdateParams#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 WebhookEndpointUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The URL of the webhook endpoint. */ public Builder setUrl(String url) { this.url = url; @@ -384,6 +428,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("payment_method.detached") PAYMENT_METHOD__DETACHED("payment_method.detached"), + @SerializedName("payment_method.updated") + PAYMENT_METHOD__UPDATED("payment_method.updated"), + @SerializedName("payout.canceled") PAYOUT__CANCELED("payout.canceled"), diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index b3b8f016d78..d2ef1e2b3c4 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -56,6 +56,15 @@ public class SessionCreateParams extends ApiRequestParams { @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; + /** * A list of items the customer is purchasing. Use this parameter for one-time payments. To create * subscriptions, use `subscription_data.items`. @@ -100,6 +109,7 @@ private SessionCreateParams( String customer, String customerEmail, List expand, + Map extraParams, List lineItems, Locale locale, PaymentIntentData paymentIntentData, @@ -112,6 +122,7 @@ private SessionCreateParams( this.customer = customer; this.customerEmail = customerEmail; this.expand = expand; + this.extraParams = extraParams; this.lineItems = lineItems; this.locale = locale; this.paymentIntentData = paymentIntentData; @@ -137,6 +148,8 @@ public static class Builder { private List expand; + private Map extraParams; + private List lineItems; private Locale locale; @@ -158,6 +171,7 @@ public SessionCreateParams build() { this.customer, this.customerEmail, this.expand, + this.extraParams, this.lineItems, this.locale, this.paymentIntentData, @@ -244,6 +258,32 @@ public Builder addAllExpand(List 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 + * SessionCreateParams#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 SessionCreateParams#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 an element to `lineItems` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -344,6 +384,15 @@ public static class LineItem { @SerializedName("description") String description; + /** + * 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; + /** A list of images representing this line item. */ @SerializedName("images") List images; @@ -360,12 +409,14 @@ private LineItem( Long amount, String currency, String description, + Map extraParams, List images, String name, Long quantity) { this.amount = amount; this.currency = currency; this.description = description; + this.extraParams = extraParams; this.images = images; this.name = name; this.quantity = quantity; @@ -382,6 +433,8 @@ public static class Builder { private String description; + private Map extraParams; + private List images; private String name; @@ -391,7 +444,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public LineItem build() { return new LineItem( - this.amount, this.currency, this.description, this.images, this.name, this.quantity); + this.amount, + this.currency, + this.description, + this.extraParams, + this.images, + this.name, + this.quantity); } /** The amount to be collected per unit of the line item. */ @@ -415,6 +474,32 @@ public Builder setDescription(String description) { 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 + * SessionCreateParams.LineItem#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 SessionCreateParams.LineItem#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 an element to `images` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -474,6 +559,15 @@ public static class PaymentIntentData { @SerializedName("description") String description; + /** + * 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. @@ -515,6 +609,7 @@ private PaymentIntentData( Long applicationFeeAmount, CaptureMethod captureMethod, String description, + Map extraParams, Map metadata, String onBehalfOf, String receiptEmail, @@ -524,6 +619,7 @@ private PaymentIntentData( this.applicationFeeAmount = applicationFeeAmount; this.captureMethod = captureMethod; this.description = description; + this.extraParams = extraParams; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.receiptEmail = receiptEmail; @@ -543,6 +639,8 @@ public static class Builder { private String description; + private Map extraParams; + private Map metadata; private String onBehalfOf; @@ -561,6 +659,7 @@ public PaymentIntentData build() { this.applicationFeeAmount, this.captureMethod, this.description, + this.extraParams, this.metadata, this.onBehalfOf, this.receiptEmail, @@ -593,6 +692,32 @@ public Builder setDescription(String description) { 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 + * SessionCreateParams.PaymentIntentData#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 SessionCreateParams.PaymentIntentData#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 @@ -670,6 +795,15 @@ public static class Shipping { @SerializedName("carrier") String carrier; + /** + * 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; + /** Recipient name. */ @SerializedName("name") String name; @@ -686,9 +820,15 @@ public static class Shipping { String trackingNumber; private Shipping( - Address address, String carrier, String name, String phone, String trackingNumber) { + Address address, + String carrier, + Map extraParams, + String name, + String phone, + String trackingNumber) { this.address = address; this.carrier = carrier; + this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; @@ -704,6 +844,8 @@ public static class Builder { private String carrier; + private Map extraParams; + private String name; private String phone; @@ -713,7 +855,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { return new Shipping( - this.address, this.carrier, this.name, this.phone, this.trackingNumber); + this.address, + this.carrier, + this.extraParams, + this.name, + this.phone, + this.trackingNumber); } /** Shipping address. */ @@ -728,6 +875,34 @@ public Builder setCarrier(String carrier) { 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 SessionCreateParams.PaymentIntentData.Shipping#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 SessionCreateParams.PaymentIntentData.Shipping#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Recipient name. */ public Builder setName(String name) { this.name = name; @@ -758,6 +933,16 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -773,12 +958,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -795,6 +982,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -806,7 +995,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -819,6 +1014,34 @@ public Builder setCountry(String 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 SessionCreateParams.PaymentIntentData.Shipping.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 SessionCreateParams.PaymentIntentData.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; @@ -851,8 +1074,18 @@ public static class TransferData { @SerializedName("destination") String destination; - private TransferData(String destination) { + /** + * 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 TransferData(String destination, Map extraParams) { this.destination = destination; + this.extraParams = extraParams; } public static Builder builder() { @@ -863,9 +1096,11 @@ public static Builder builder() { public static class Builder { private String destination; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransferData build() { - return new TransferData(this.destination); + return new TransferData(this.destination, this.extraParams); } /** @@ -878,6 +1113,34 @@ public Builder setDestination(String destination) { this.destination = destination; 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 SessionCreateParams.PaymentIntentData.TransferData#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 SessionCreateParams.PaymentIntentData.TransferData#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } @@ -898,6 +1161,15 @@ public enum CaptureMethod implements ApiRequestParams.EnumParam { } public static class SubscriptionData { + /** + * 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; + /** * A list of items, each with an attached plan, that the customer is subscribing to. Use this * parameter for subscriptions. To create one-time payments, use `line_items`. @@ -927,7 +1199,12 @@ public static class SubscriptionData { Long trialPeriodDays; private SubscriptionData( - List items, Map metadata, Long trialEnd, Long trialPeriodDays) { + Map extraParams, + List items, + Map metadata, + Long trialEnd, + Long trialPeriodDays) { + this.extraParams = extraParams; this.items = items; this.metadata = metadata; this.trialEnd = trialEnd; @@ -939,6 +1216,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private List items; private Map metadata; @@ -949,7 +1228,34 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionData build() { - return new SubscriptionData(this.items, this.metadata, this.trialEnd, this.trialPeriodDays); + return new SubscriptionData( + this.extraParams, this.items, this.metadata, this.trialEnd, this.trialPeriodDays); + } + + /** + * 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 + * SessionCreateParams.SubscriptionData#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 SessionCreateParams.SubscriptionData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -1024,6 +1330,15 @@ public Builder setTrialPeriodDays(Long trialPeriodDays) { } public static class Item { + /** + * 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; + /** Plan ID for this item. */ @SerializedName("plan") String plan; @@ -1032,7 +1347,8 @@ public static class Item { @SerializedName("quantity") Long quantity; - private Item(String plan, Long quantity) { + private Item(Map extraParams, String plan, Long quantity) { + this.extraParams = extraParams; this.plan = plan; this.quantity = quantity; } @@ -1042,13 +1358,43 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String plan; private Long quantity; /** Finalize and obtain parameter instance from this builder. */ public Item build() { - return new Item(this.plan, this.quantity); + return new Item(this.extraParams, this.plan, this.quantity); + } + + /** + * 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 SessionCreateParams.SubscriptionData.Item#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 SessionCreateParams.SubscriptionData.Item#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Plan ID for this item. */ diff --git a/src/main/java/com/stripe/param/checkout/SessionRetrieveParams.java b/src/main/java/com/stripe/param/checkout/SessionRetrieveParams.java index 07f93856de1..15673570c28 100644 --- a/src/main/java/com/stripe/param/checkout/SessionRetrieveParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class SessionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private SessionRetrieveParams(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; + + private SessionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public SessionRetrieveParams build() { - return new SessionRetrieveParams(this.expand); + return new SessionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * SessionRetrieveParams#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 SessionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationApproveParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationApproveParams.java index e01ef0c66b2..d9ab59475f1 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationApproveParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationApproveParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AuthorizationApproveParams extends ApiRequestParams { /** 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; + /** * If the authorization's `is_held_amount_controllable` property is `true`, you may provide this * value to control how much to hold for the authorization. Must be positive (use @@ -21,8 +32,10 @@ public class AuthorizationApproveParams extends ApiRequestParams { @SerializedName("held_amount") Long heldAmount; - private AuthorizationApproveParams(List expand, Long heldAmount) { + private AuthorizationApproveParams( + List expand, Map extraParams, Long heldAmount) { this.expand = expand; + this.extraParams = extraParams; this.heldAmount = heldAmount; } @@ -33,11 +46,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Long heldAmount; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationApproveParams build() { - return new AuthorizationApproveParams(this.expand, this.heldAmount); + return new AuthorizationApproveParams(this.expand, this.extraParams, this.heldAmount); } /** @@ -66,6 +81,32 @@ public Builder addAllExpand(List 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 + * AuthorizationApproveParams#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 AuthorizationApproveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * If the authorization's `is_held_amount_controllable` property is `true`, you may provide this * value to control how much to hold for the authorization. Must be positive (use diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationDeclineParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationDeclineParams.java index 02a81494289..b9492a847e8 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationDeclineParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationDeclineParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AuthorizationDeclineParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private AuthorizationDeclineParams(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; + + private AuthorizationDeclineParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public AuthorizationDeclineParams build() { - return new AuthorizationDeclineParams(this.expand); + return new AuthorizationDeclineParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * AuthorizationDeclineParams#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 AuthorizationDeclineParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java index 79f70f7f9ea..9dd317c962d 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class AuthorizationListParams extends ApiRequestParams { @@ -34,6 +36,15 @@ public class AuthorizationListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -60,6 +71,7 @@ private AuthorizationListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, Status status) { @@ -68,6 +80,7 @@ private AuthorizationListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.status = status; @@ -88,6 +101,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -102,6 +117,7 @@ public AuthorizationListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.status); @@ -168,6 +184,32 @@ public Builder addAllExpand(List 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 + * AuthorizationListParams#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 AuthorizationListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -196,6 +238,15 @@ public Builder setStatus(Status status) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -212,7 +263,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -224,6 +276,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -234,7 +288,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * AuthorizationListParams.Created#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 AuthorizationListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationRetrieveParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationRetrieveParams.java index 2cc2dec7d38..5b035c49eae 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationRetrieveParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class AuthorizationRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private AuthorizationRetrieveParams(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; + + private AuthorizationRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public AuthorizationRetrieveParams build() { - return new AuthorizationRetrieveParams(this.expand); + return new AuthorizationRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * AuthorizationRetrieveParams#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 AuthorizationRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationUpdateParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationUpdateParams.java index 776b50aeff6..343775c88e8 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationUpdateParams.java @@ -14,11 +14,22 @@ public class AuthorizationUpdateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; - private AuthorizationUpdateParams(List expand, Map metadata) { + private AuthorizationUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -29,11 +40,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationUpdateParams build() { - return new AuthorizationUpdateParams(this.expand, this.metadata); + return new AuthorizationUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -62,6 +75,32 @@ public Builder addAllExpand(List 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 + * AuthorizationUpdateParams#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 AuthorizationUpdateParams#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 diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index 226a0b41f95..20980c13c73 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -35,6 +35,15 @@ public class CardCreateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -69,6 +78,7 @@ private CardCreateParams( String cardholder, String currency, List expand, + Map extraParams, Map metadata, String replacementFor, ReplacementReason replacementReason, @@ -79,6 +89,7 @@ private CardCreateParams( this.cardholder = cardholder; this.currency = currency; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.replacementFor = replacementFor; this.replacementReason = replacementReason; @@ -100,6 +111,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String replacementFor; @@ -119,6 +132,7 @@ public CardCreateParams build() { this.cardholder, this.currency, this.expand, + this.extraParams, this.metadata, this.replacementFor, this.replacementReason, @@ -178,6 +192,32 @@ public Builder addAllExpand(List 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 + * CardCreateParams#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#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 @@ -258,6 +298,15 @@ public static class AuthorizationControls { @SerializedName("blocked_categories") List blockedCategories; + /** + * 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; + /** * Maximum amount allowed per authorization on this card, in the currency of the card. * Authorization amounts in a different currency will be converted to the card's currency when @@ -280,11 +329,13 @@ public static class AuthorizationControls { private AuthorizationControls( List allowedCategories, List blockedCategories, + Map extraParams, Long maxAmount, Long maxApprovals, List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; + this.extraParams = extraParams; this.maxAmount = maxAmount; this.maxApprovals = maxApprovals; this.spendingLimits = spendingLimits; @@ -299,6 +350,8 @@ public static class Builder { private List blockedCategories; + private Map extraParams; + private Long maxAmount; private Long maxApprovals; @@ -310,6 +363,7 @@ public AuthorizationControls build() { return new AuthorizationControls( this.allowedCategories, this.blockedCategories, + this.extraParams, this.maxAmount, this.maxApprovals, this.spendingLimits); @@ -357,6 +411,32 @@ public Builder addAllBlockedCategory(List 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 + * CardCreateParams.AuthorizationControls#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.AuthorizationControls#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Maximum amount allowed per authorization on this card, in the currency of the card. * Authorization amounts in a different currency will be converted to the card's currency when @@ -430,6 +510,15 @@ public static class SpendingLimit { @SerializedName("categories") List categories; + /** + * 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; + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -437,9 +526,14 @@ public static class SpendingLimit { @SerializedName("interval") Interval interval; - private SpendingLimit(Long amount, List categories, Interval interval) { + private SpendingLimit( + Long amount, + List categories, + Map extraParams, + Interval interval) { this.amount = amount; this.categories = categories; + this.extraParams = extraParams; this.interval = interval; } @@ -453,11 +547,13 @@ public static class Builder { private List categories; + private Map extraParams; + private Interval interval; /** Finalize and obtain parameter instance from this builder. */ public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.interval); + return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per time interval. */ @@ -494,6 +590,34 @@ public Builder addAllCategory(List 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 CardCreateParams.AuthorizationControls.SpendingLimit#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.AuthorizationControls.SpendingLimit#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -3180,6 +3304,15 @@ public static class Shipping { @SerializedName("address") Address address; + /** + * 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; + @SerializedName("name") String name; @@ -3190,8 +3323,13 @@ public static class Shipping { @SerializedName("type") ApiRequestParams.EnumParam type; - private Shipping(Address address, String name, ApiRequestParams.EnumParam type) { + private Shipping( + Address address, + Map extraParams, + String name, + ApiRequestParams.EnumParam type) { this.address = address; + this.extraParams = extraParams; this.name = name; this.type = type; } @@ -3203,13 +3341,15 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; private ApiRequestParams.EnumParam type; /** Finalize and obtain parameter instance from this builder. */ public Shipping build() { - return new Shipping(this.address, this.name, this.type); + return new Shipping(this.address, this.extraParams, this.name, this.type); } public Builder setAddress(Address address) { @@ -3217,6 +3357,32 @@ public Builder setAddress(Address address) { 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.Shipping#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.Shipping#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + public Builder setName(String name) { this.name = name; return this; @@ -3248,6 +3414,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -3263,12 +3438,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -3284,6 +3461,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -3295,7 +3474,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -3308,6 +3493,34 @@ public Builder setCountry(String 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 CardCreateParams.Shipping.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 CardCreateParams.Shipping.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/issuing/CardDetailsParams.java b/src/main/java/com/stripe/param/issuing/CardDetailsParams.java index 10576977ebf..14bc101178d 100644 --- a/src/main/java/com/stripe/param/issuing/CardDetailsParams.java +++ b/src/main/java/com/stripe/param/issuing/CardDetailsParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CardDetailsParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CardDetailsParams(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; + + private CardDetailsParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CardDetailsParams build() { - return new CardDetailsParams(this.expand); + return new CardDetailsParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CardDetailsParams#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 CardDetailsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/CardListParams.java b/src/main/java/com/stripe/param/issuing/CardListParams.java index 782aaded0aa..2fb6b779e54 100644 --- a/src/main/java/com/stripe/param/issuing/CardListParams.java +++ b/src/main/java/com/stripe/param/issuing/CardListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class CardListParams extends ApiRequestParams { @@ -38,6 +40,15 @@ public class CardListParams extends ApiRequestParams { @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; + /** Only return cards that have the given last four digits. */ @SerializedName("last4") String last4; @@ -84,6 +95,7 @@ private CardListParams( Long expMonth, Long expYear, List expand, + Map extraParams, String last4, Long limit, String name, @@ -97,6 +109,7 @@ private CardListParams( this.expMonth = expMonth; this.expYear = expYear; this.expand = expand; + this.extraParams = extraParams; this.last4 = last4; this.limit = limit; this.name = name; @@ -123,6 +136,8 @@ public static class Builder { private List expand; + private Map extraParams; + private String last4; private Long limit; @@ -146,6 +161,7 @@ public CardListParams build() { this.expMonth, this.expYear, this.expand, + this.extraParams, this.last4, this.limit, this.name, @@ -222,6 +238,32 @@ public Builder addAllExpand(List 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 + * CardListParams#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 CardListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Only return cards that have the given last four digits. */ public Builder setLast4(String last4) { this.last4 = last4; @@ -277,6 +319,15 @@ public Builder setType(Type type) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -293,7 +344,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -305,6 +357,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -315,7 +369,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * CardListParams.Created#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 CardListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/issuing/CardRetrieveParams.java b/src/main/java/com/stripe/param/issuing/CardRetrieveParams.java index 7fe334d2acb..6a88a854ab3 100644 --- a/src/main/java/com/stripe/param/issuing/CardRetrieveParams.java +++ b/src/main/java/com/stripe/param/issuing/CardRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CardRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CardRetrieveParams(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; + + private CardRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CardRetrieveParams build() { - return new CardRetrieveParams(this.expand); + return new CardRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CardRetrieveParams#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 CardRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java index a64c6056361..0c499f07439 100644 --- a/src/main/java/com/stripe/param/issuing/CardUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardUpdateParams.java @@ -30,6 +30,15 @@ public class CardUpdateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; @@ -44,11 +53,13 @@ private CardUpdateParams( AuthorizationControls authorizationControls, String cardholder, List expand, + Map extraParams, Map metadata, Status status) { this.authorizationControls = authorizationControls; this.cardholder = cardholder; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.status = status; } @@ -64,6 +75,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Status status; @@ -71,7 +84,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CardUpdateParams build() { return new CardUpdateParams( - this.authorizationControls, this.cardholder, this.expand, this.metadata, this.status); + this.authorizationControls, + this.cardholder, + this.expand, + this.extraParams, + this.metadata, + this.status); } /** @@ -119,6 +137,32 @@ public Builder addAllExpand(List 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 + * CardUpdateParams#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 CardUpdateParams#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 @@ -172,6 +216,15 @@ public static class AuthorizationControls { @SerializedName("blocked_categories") List blockedCategories; + /** + * 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; + /** * Maximum amount allowed per authorization on this card, in the currency of the card. * Authorization amounts in a different currency will be converted to the card's currency when @@ -194,11 +247,13 @@ public static class AuthorizationControls { private AuthorizationControls( List allowedCategories, List blockedCategories, + Map extraParams, Long maxAmount, Long maxApprovals, List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; + this.extraParams = extraParams; this.maxAmount = maxAmount; this.maxApprovals = maxApprovals; this.spendingLimits = spendingLimits; @@ -213,6 +268,8 @@ public static class Builder { private List blockedCategories; + private Map extraParams; + private Long maxAmount; private Long maxApprovals; @@ -224,6 +281,7 @@ public AuthorizationControls build() { return new AuthorizationControls( this.allowedCategories, this.blockedCategories, + this.extraParams, this.maxAmount, this.maxApprovals, this.spendingLimits); @@ -271,6 +329,32 @@ public Builder addAllBlockedCategory(List 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 + * CardUpdateParams.AuthorizationControls#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 CardUpdateParams.AuthorizationControls#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Maximum amount allowed per authorization on this card, in the currency of the card. * Authorization amounts in a different currency will be converted to the card's currency when @@ -344,6 +428,15 @@ public static class SpendingLimit { @SerializedName("categories") List categories; + /** + * 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; + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -351,9 +444,14 @@ public static class SpendingLimit { @SerializedName("interval") Interval interval; - private SpendingLimit(Long amount, List categories, Interval interval) { + private SpendingLimit( + Long amount, + List categories, + Map extraParams, + Interval interval) { this.amount = amount; this.categories = categories; + this.extraParams = extraParams; this.interval = interval; } @@ -367,11 +465,13 @@ public static class Builder { private List categories; + private Map extraParams; + private Interval interval; /** Finalize and obtain parameter instance from this builder. */ public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.interval); + return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per time interval. */ @@ -408,6 +508,34 @@ public Builder addAllCategory(List 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 CardUpdateParams.AuthorizationControls.SpendingLimit#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 CardUpdateParams.AuthorizationControls.SpendingLimit#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. diff --git a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java index 3510f15d535..790d267bc9a 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderCreateParams.java @@ -31,6 +31,15 @@ public class CardholderCreateParams extends ApiRequestParams { @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; + /** Specifies whether to set this as the default cardholder. */ @SerializedName("is_default") Boolean isDefault; @@ -65,6 +74,7 @@ private CardholderCreateParams( Billing billing, String email, List expand, + Map extraParams, Boolean isDefault, Map metadata, String name, @@ -75,6 +85,7 @@ private CardholderCreateParams( this.billing = billing; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.isDefault = isDefault; this.metadata = metadata; this.name = name; @@ -96,6 +107,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean isDefault; private Map metadata; @@ -115,6 +128,7 @@ public CardholderCreateParams build() { this.billing, this.email, this.expand, + this.extraParams, this.isDefault, this.metadata, this.name, @@ -171,6 +185,32 @@ public Builder addAllExpand(List 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 + * CardholderCreateParams#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 CardholderCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Specifies whether to set this as the default cardholder. */ public Builder setIsDefault(Boolean isDefault) { this.isDefault = isDefault; @@ -251,6 +291,15 @@ public static class AuthorizationControls { @SerializedName("blocked_categories") List blockedCategories; + /** + * 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; + /** Limit the spending with rules based on time intervals and categories. */ @SerializedName("spending_limits") List spendingLimits; @@ -258,9 +307,11 @@ public static class AuthorizationControls { private AuthorizationControls( List allowedCategories, List blockedCategories, + Map extraParams, List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; + this.extraParams = extraParams; this.spendingLimits = spendingLimits; } @@ -273,12 +324,14 @@ public static class Builder { private List blockedCategories; + private Map extraParams; + private List spendingLimits; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationControls build() { return new AuthorizationControls( - this.allowedCategories, this.blockedCategories, this.spendingLimits); + this.allowedCategories, this.blockedCategories, this.extraParams, this.spendingLimits); } /** @@ -323,6 +376,33 @@ public Builder addAllBlockedCategory(List 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 + * CardholderCreateParams.AuthorizationControls#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 CardholderCreateParams.AuthorizationControls#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 an element to `spendingLimits` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -377,6 +457,15 @@ public static class SpendingLimit { @SerializedName("categories") List categories; + /** + * 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; + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -384,9 +473,14 @@ public static class SpendingLimit { @SerializedName("interval") Interval interval; - private SpendingLimit(Long amount, List categories, Interval interval) { + private SpendingLimit( + Long amount, + List categories, + Map extraParams, + Interval interval) { this.amount = amount; this.categories = categories; + this.extraParams = extraParams; this.interval = interval; } @@ -400,11 +494,13 @@ public static class Builder { private List categories; + private Map extraParams; + private Interval interval; /** Finalize and obtain parameter instance from this builder. */ public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.interval); + return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per time interval. */ @@ -441,6 +537,34 @@ public Builder addAllCategory(List 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 CardholderCreateParams.AuthorizationControls.SpendingLimit#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 CardholderCreateParams.AuthorizationControls.SpendingLimit#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -3127,11 +3251,21 @@ public static class Billing { @SerializedName("address") Address address; + /** + * 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; + @SerializedName("name") String name; - private Billing(Address address, String name) { + private Billing(Address address, Map extraParams, String name) { this.address = address; + this.extraParams = extraParams; this.name = name; } @@ -3142,11 +3276,13 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; /** Finalize and obtain parameter instance from this builder. */ public Billing build() { - return new Billing(this.address, this.name); + return new Billing(this.address, this.extraParams, this.name); } public Builder setAddress(Address address) { @@ -3154,6 +3290,32 @@ public Builder setAddress(Address address) { 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 + * CardholderCreateParams.Billing#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 CardholderCreateParams.Billing#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + public Builder setName(String name) { this.name = name; return this; @@ -3167,6 +3329,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -3182,12 +3353,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -3203,6 +3376,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -3214,7 +3389,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -3227,6 +3408,34 @@ public Builder setCountry(String 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 CardholderCreateParams.Billing.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 CardholderCreateParams.Billing.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/issuing/CardholderListParams.java b/src/main/java/com/stripe/param/issuing/CardholderListParams.java index 397562bfdb2..a27fed3d6cc 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderListParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class CardholderListParams extends ApiRequestParams { @@ -30,6 +32,15 @@ public class CardholderListParams extends ApiRequestParams { @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; + /** Only return the default cardholder. */ @SerializedName("is_default") Boolean isDefault; @@ -69,6 +80,7 @@ private CardholderListParams( String email, String endingBefore, List expand, + Map extraParams, Boolean isDefault, Long limit, String phoneNumber, @@ -79,6 +91,7 @@ private CardholderListParams( this.email = email; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.isDefault = isDefault; this.limit = limit; this.phoneNumber = phoneNumber; @@ -100,6 +113,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean isDefault; private Long limit; @@ -119,6 +134,7 @@ public CardholderListParams build() { this.email, this.endingBefore, this.expand, + this.extraParams, this.isDefault, this.limit, this.phoneNumber, @@ -182,6 +198,32 @@ public Builder addAllExpand(List 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 + * CardholderListParams#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 CardholderListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Only return the default cardholder. */ public Builder setIsDefault(Boolean isDefault) { this.isDefault = isDefault; @@ -233,6 +275,15 @@ public Builder setType(Type type) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -249,7 +300,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -261,6 +313,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -271,7 +325,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * CardholderListParams.Created#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 CardholderListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/issuing/CardholderRetrieveParams.java b/src/main/java/com/stripe/param/issuing/CardholderRetrieveParams.java index fa54ce94e9e..3f1221c184e 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderRetrieveParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class CardholderRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private CardholderRetrieveParams(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; + + private CardholderRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public CardholderRetrieveParams build() { - return new CardholderRetrieveParams(this.expand); + return new CardholderRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * CardholderRetrieveParams#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 CardholderRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java index 098ba2c26b1..3730ac1ccc0 100644 --- a/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardholderUpdateParams.java @@ -31,6 +31,15 @@ public class CardholderUpdateParams extends ApiRequestParams { @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; + /** Specifies whether to set this as the default cardholder. */ @SerializedName("is_default") Boolean isDefault; @@ -59,6 +68,7 @@ private CardholderUpdateParams( Billing billing, String email, List expand, + Map extraParams, Boolean isDefault, Map metadata, String phoneNumber, @@ -67,6 +77,7 @@ private CardholderUpdateParams( this.billing = billing; this.email = email; this.expand = expand; + this.extraParams = extraParams; this.isDefault = isDefault; this.metadata = metadata; this.phoneNumber = phoneNumber; @@ -86,6 +97,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Boolean isDefault; private Map metadata; @@ -101,6 +114,7 @@ public CardholderUpdateParams build() { this.billing, this.email, this.expand, + this.extraParams, this.isDefault, this.metadata, this.phoneNumber, @@ -155,6 +169,32 @@ public Builder addAllExpand(List 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 + * CardholderUpdateParams#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 CardholderUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Specifies whether to set this as the default cardholder. */ public Builder setIsDefault(Boolean isDefault) { this.isDefault = isDefault; @@ -220,6 +260,15 @@ public static class AuthorizationControls { @SerializedName("blocked_categories") List blockedCategories; + /** + * 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; + /** Limit the spending with rules based on time intervals and categories. */ @SerializedName("spending_limits") List spendingLimits; @@ -227,9 +276,11 @@ public static class AuthorizationControls { private AuthorizationControls( List allowedCategories, List blockedCategories, + Map extraParams, List spendingLimits) { this.allowedCategories = allowedCategories; this.blockedCategories = blockedCategories; + this.extraParams = extraParams; this.spendingLimits = spendingLimits; } @@ -242,12 +293,14 @@ public static class Builder { private List blockedCategories; + private Map extraParams; + private List spendingLimits; /** Finalize and obtain parameter instance from this builder. */ public AuthorizationControls build() { return new AuthorizationControls( - this.allowedCategories, this.blockedCategories, this.spendingLimits); + this.allowedCategories, this.blockedCategories, this.extraParams, this.spendingLimits); } /** @@ -292,6 +345,33 @@ public Builder addAllBlockedCategory(List 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 + * CardholderUpdateParams.AuthorizationControls#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 CardholderUpdateParams.AuthorizationControls#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 an element to `spendingLimits` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -346,6 +426,15 @@ public static class SpendingLimit { @SerializedName("categories") List categories; + /** + * 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; + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -353,9 +442,14 @@ public static class SpendingLimit { @SerializedName("interval") Interval interval; - private SpendingLimit(Long amount, List categories, Interval interval) { + private SpendingLimit( + Long amount, + List categories, + Map extraParams, + Interval interval) { this.amount = amount; this.categories = categories; + this.extraParams = extraParams; this.interval = interval; } @@ -369,11 +463,13 @@ public static class Builder { private List categories; + private Map extraParams; + private Interval interval; /** Finalize and obtain parameter instance from this builder. */ public SpendingLimit build() { - return new SpendingLimit(this.amount, this.categories, this.interval); + return new SpendingLimit(this.amount, this.categories, this.extraParams, this.interval); } /** Maximum amount allowed to spend per time interval. */ @@ -410,6 +506,34 @@ public Builder addAllCategory(List 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 CardholderUpdateParams.AuthorizationControls.SpendingLimit#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 CardholderUpdateParams.AuthorizationControls.SpendingLimit#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * The time interval with which to apply this spending limit towards. Allowed values are * 'per_authorization', 'daily', 'weekly', 'monthly', 'yearly', and 'all_time'. @@ -3096,11 +3220,21 @@ public static class Billing { @SerializedName("address") Address address; + /** + * 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; + @SerializedName("name") String name; - private Billing(Address address, String name) { + private Billing(Address address, Map extraParams, String name) { this.address = address; + this.extraParams = extraParams; this.name = name; } @@ -3111,11 +3245,13 @@ public static Builder builder() { public static class Builder { private Address address; + private Map extraParams; + private String name; /** Finalize and obtain parameter instance from this builder. */ public Billing build() { - return new Billing(this.address, this.name); + return new Billing(this.address, this.extraParams, this.name); } public Builder setAddress(Address address) { @@ -3123,6 +3259,32 @@ public Builder setAddress(Address address) { 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 + * CardholderUpdateParams.Billing#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 CardholderUpdateParams.Billing#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + public Builder setName(String name) { this.name = name; return this; @@ -3136,6 +3298,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -3151,12 +3322,14 @@ public static class Address { private Address( String city, String country, + Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -3172,6 +3345,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -3183,7 +3358,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -3196,6 +3377,34 @@ public Builder setCountry(String 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 CardholderUpdateParams.Billing.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 CardholderUpdateParams.Billing.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java b/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java index 98088bc6aef..9bedcc37306 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeCreateParams.java @@ -32,6 +32,15 @@ public class DisputeCreateParams extends ApiRequestParams { @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 @@ -49,12 +58,14 @@ private DisputeCreateParams( String disputedTransaction, Evidence evidence, List expand, + Map extraParams, Map metadata, Reason reason) { this.amount = amount; this.disputedTransaction = disputedTransaction; this.evidence = evidence; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.reason = reason; } @@ -72,6 +83,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private Reason reason; @@ -83,6 +96,7 @@ public DisputeCreateParams build() { this.disputedTransaction, this.evidence, this.expand, + this.extraParams, this.metadata, this.reason); } @@ -136,6 +150,32 @@ public Builder addAllExpand(List 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 + * DisputeCreateParams#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 DisputeCreateParams#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 @@ -170,6 +210,15 @@ public Builder setReason(Reason reason) { } public static class Evidence { + /** + * 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; + /** * Evidence to support a fraudulent dispute. Only provide this if your dispute's `reason` is * `fraudulent`. @@ -184,7 +233,8 @@ public static class Evidence { @SerializedName("other") Other other; - private Evidence(Fraudulent fraudulent, Other other) { + private Evidence(Map extraParams, Fraudulent fraudulent, Other other) { + this.extraParams = extraParams; this.fraudulent = fraudulent; this.other = other; } @@ -194,13 +244,41 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Fraudulent fraudulent; private Other other; /** Finalize and obtain parameter instance from this builder. */ public Evidence build() { - return new Evidence(this.fraudulent, this.other); + return new Evidence(this.extraParams, this.fraudulent, this.other); + } + + /** + * 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 + * DisputeCreateParams.Evidence#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 DisputeCreateParams.Evidence#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** @@ -227,6 +305,15 @@ public static class Fraudulent { @SerializedName("dispute_explanation") String disputeExplanation; + /** + * 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; + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional file * evidence supporting your dispute. @@ -234,8 +321,10 @@ public static class Fraudulent { @SerializedName("uncategorized_file") String uncategorizedFile; - private Fraudulent(String disputeExplanation, String uncategorizedFile) { + private Fraudulent( + String disputeExplanation, Map extraParams, String uncategorizedFile) { this.disputeExplanation = disputeExplanation; + this.extraParams = extraParams; this.uncategorizedFile = uncategorizedFile; } @@ -246,11 +335,13 @@ public static Builder builder() { public static class Builder { private String disputeExplanation; + private Map extraParams; + private String uncategorizedFile; /** Finalize and obtain parameter instance from this builder. */ public Fraudulent build() { - return new Fraudulent(this.disputeExplanation, this.uncategorizedFile); + return new Fraudulent(this.disputeExplanation, this.extraParams, this.uncategorizedFile); } /** Brief freeform text explaining why you are disputing this transaction. */ @@ -259,6 +350,34 @@ public Builder setDisputeExplanation(String disputeExplanation) { 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 DisputeCreateParams.Evidence.Fraudulent#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 DisputeCreateParams.Evidence.Fraudulent#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional file * evidence supporting your dispute. @@ -275,6 +394,15 @@ public static class Other { @SerializedName("dispute_explanation") String disputeExplanation; + /** + * 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; + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional file * evidence supporting your dispute. @@ -282,8 +410,10 @@ public static class Other { @SerializedName("uncategorized_file") String uncategorizedFile; - private Other(String disputeExplanation, String uncategorizedFile) { + private Other( + String disputeExplanation, Map extraParams, String uncategorizedFile) { this.disputeExplanation = disputeExplanation; + this.extraParams = extraParams; this.uncategorizedFile = uncategorizedFile; } @@ -294,11 +424,13 @@ public static Builder builder() { public static class Builder { private String disputeExplanation; + private Map extraParams; + private String uncategorizedFile; /** Finalize and obtain parameter instance from this builder. */ public Other build() { - return new Other(this.disputeExplanation, this.uncategorizedFile); + return new Other(this.disputeExplanation, this.extraParams, this.uncategorizedFile); } /** Brief freeform text explaining why you are disputing this transaction. */ @@ -307,6 +439,34 @@ public Builder setDisputeExplanation(String disputeExplanation) { 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 DisputeCreateParams.Evidence.Other#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 DisputeCreateParams.Evidence.Other#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional file * evidence supporting your dispute. diff --git a/src/main/java/com/stripe/param/issuing/DisputeListParams.java b/src/main/java/com/stripe/param/issuing/DisputeListParams.java index d6d06a502e6..46bbc0cad10 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeListParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class DisputeListParams extends ApiRequestParams { /** Only return issuing disputes that were created during the given date interval. */ @@ -29,6 +31,15 @@ public class DisputeListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -50,12 +61,14 @@ private DisputeListParams( String disputedTransaction, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.created = created; this.disputedTransaction = disputedTransaction; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -73,6 +86,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -84,6 +99,7 @@ public DisputeListParams build() { this.disputedTransaction, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -143,6 +159,32 @@ public Builder addAllExpand(List 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 + * DisputeListParams#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 DisputeListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -165,6 +207,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -181,7 +232,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -193,6 +245,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -203,7 +257,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * DisputeListParams.Created#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 DisputeListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/issuing/DisputeRetrieveParams.java b/src/main/java/com/stripe/param/issuing/DisputeRetrieveParams.java index d809055f8b3..d6fbe78121a 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeRetrieveParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class DisputeRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private DisputeRetrieveParams(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; + + private DisputeRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public DisputeRetrieveParams build() { - return new DisputeRetrieveParams(this.expand); + return new DisputeRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * DisputeRetrieveParams#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 DisputeRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java b/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java index 74c9c948e71..955833628a8 100644 --- a/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/DisputeUpdateParams.java @@ -14,6 +14,15 @@ public class DisputeUpdateParams extends ApiRequestParams { @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 @@ -22,8 +31,10 @@ public class DisputeUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; - private DisputeUpdateParams(List expand, Map metadata) { + private DisputeUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -34,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public DisputeUpdateParams build() { - return new DisputeUpdateParams(this.expand, this.metadata); + return new DisputeUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -67,6 +80,32 @@ public Builder addAllExpand(List 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 + * DisputeUpdateParams#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 DisputeUpdateParams#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 diff --git a/src/main/java/com/stripe/param/issuing/TransactionListParams.java b/src/main/java/com/stripe/param/issuing/TransactionListParams.java index dffa5068976..6a76fe66163 100644 --- a/src/main/java/com/stripe/param/issuing/TransactionListParams.java +++ b/src/main/java/com/stripe/param/issuing/TransactionListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransactionListParams extends ApiRequestParams { /** Only return issuing transactions that belong to the given card. */ @@ -37,6 +39,15 @@ public class TransactionListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -60,6 +71,7 @@ private TransactionListParams( String dispute, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.card = card; @@ -68,6 +80,7 @@ private TransactionListParams( this.dispute = dispute; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -89,6 +102,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -102,6 +117,7 @@ public TransactionListParams build() { this.dispute, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -173,6 +189,32 @@ public Builder addAllExpand(List 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 + * TransactionListParams#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 TransactionListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -195,6 +237,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -211,7 +262,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -223,6 +275,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -233,7 +287,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * TransactionListParams.Created#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 TransactionListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/issuing/TransactionRetrieveParams.java b/src/main/java/com/stripe/param/issuing/TransactionRetrieveParams.java index 44165cbddaa..8ac1be58c46 100644 --- a/src/main/java/com/stripe/param/issuing/TransactionRetrieveParams.java +++ b/src/main/java/com/stripe/param/issuing/TransactionRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TransactionRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private TransactionRetrieveParams(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; + + private TransactionRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public TransactionRetrieveParams build() { - return new TransactionRetrieveParams(this.expand); + return new TransactionRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * TransactionRetrieveParams#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 TransactionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/issuing/TransactionUpdateParams.java b/src/main/java/com/stripe/param/issuing/TransactionUpdateParams.java index 8458804d476..8d86848fd8d 100644 --- a/src/main/java/com/stripe/param/issuing/TransactionUpdateParams.java +++ b/src/main/java/com/stripe/param/issuing/TransactionUpdateParams.java @@ -14,11 +14,22 @@ public class TransactionUpdateParams extends ApiRequestParams { @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; + @SerializedName("metadata") Map metadata; - private TransactionUpdateParams(List expand, Map metadata) { + private TransactionUpdateParams( + List expand, Map extraParams, Map metadata) { this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; } @@ -29,11 +40,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Map metadata; /** Finalize and obtain parameter instance from this builder. */ public TransactionUpdateParams build() { - return new TransactionUpdateParams(this.expand, this.metadata); + return new TransactionUpdateParams(this.expand, this.extraParams, this.metadata); } /** @@ -62,6 +75,32 @@ public Builder addAllExpand(List 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 + * TransactionUpdateParams#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 TransactionUpdateParams#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 diff --git a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java index eed9b81825b..4bdc44d3f92 100644 --- a/src/main/java/com/stripe/param/radar/ValueListCreateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListCreateParams.java @@ -19,6 +19,15 @@ public class ValueListCreateParams extends ApiRequestParams { @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; + /** * Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, * `ip_address`, `country`, `string`, or `case_sensitive_string`. Use `string` if the item type is @@ -42,11 +51,13 @@ public class ValueListCreateParams extends ApiRequestParams { private ValueListCreateParams( String alias, List expand, + Map extraParams, ItemType itemType, Map metadata, String name) { this.alias = alias; this.expand = expand; + this.extraParams = extraParams; this.itemType = itemType; this.metadata = metadata; this.name = name; @@ -61,6 +72,8 @@ public static class Builder { private List expand; + private Map extraParams; + private ItemType itemType; private Map metadata; @@ -70,7 +83,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ValueListCreateParams build() { return new ValueListCreateParams( - this.alias, this.expand, this.itemType, this.metadata, this.name); + this.alias, this.expand, this.extraParams, this.itemType, this.metadata, this.name); } /** The name of the value list for use in rules. */ @@ -105,6 +118,32 @@ public Builder addAllExpand(List 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 + * ValueListCreateParams#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 ValueListCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, * `ip_address`, `country`, `string`, or `case_sensitive_string`. Use `string` if the item type diff --git a/src/main/java/com/stripe/param/radar/ValueListItemCreateParams.java b/src/main/java/com/stripe/param/radar/ValueListItemCreateParams.java index cba2a30bfc1..5a45b039f42 100644 --- a/src/main/java/com/stripe/param/radar/ValueListItemCreateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListItemCreateParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ValueListItemCreateParams extends ApiRequestParams { /** 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; + /** The value of the item (whose type must match the type of the parent value list). */ @SerializedName("value") String value; @@ -20,8 +31,10 @@ public class ValueListItemCreateParams extends ApiRequestParams { @SerializedName("value_list") String valueList; - private ValueListItemCreateParams(List expand, String value, String valueList) { + private ValueListItemCreateParams( + List expand, Map extraParams, String value, String valueList) { this.expand = expand; + this.extraParams = extraParams; this.value = value; this.valueList = valueList; } @@ -33,13 +46,16 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String value; private String valueList; /** Finalize and obtain parameter instance from this builder. */ public ValueListItemCreateParams build() { - return new ValueListItemCreateParams(this.expand, this.value, this.valueList); + return new ValueListItemCreateParams( + this.expand, this.extraParams, this.value, this.valueList); } /** @@ -68,6 +84,32 @@ public Builder addAllExpand(List 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 + * ValueListItemCreateParams#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 ValueListItemCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The value of the item (whose type must match the type of the parent value list). */ public Builder setValue(String value) { this.value = value; diff --git a/src/main/java/com/stripe/param/radar/ValueListItemListParams.java b/src/main/java/com/stripe/param/radar/ValueListItemListParams.java index 4b708104808..26b4e180744 100644 --- a/src/main/java/com/stripe/param/radar/ValueListItemListParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListItemListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ValueListItemListParams extends ApiRequestParams { @SerializedName("created") @@ -24,6 +26,15 @@ public class ValueListItemListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -55,6 +66,7 @@ private ValueListItemListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter, String value, @@ -62,6 +74,7 @@ private ValueListItemListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; this.value = value; @@ -79,6 +92,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -93,6 +108,7 @@ public ValueListItemListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter, this.value, @@ -146,6 +162,32 @@ public Builder addAllExpand(List 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 + * ValueListItemListParams#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 ValueListItemListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -183,6 +225,15 @@ public Builder setValueList(String valueList) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -199,7 +250,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -211,6 +263,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -221,7 +275,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ValueListItemListParams.Created#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 ValueListItemListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/radar/ValueListItemRetrieveParams.java b/src/main/java/com/stripe/param/radar/ValueListItemRetrieveParams.java index 0760f8fd1e1..b852a3741e4 100644 --- a/src/main/java/com/stripe/param/radar/ValueListItemRetrieveParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListItemRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ValueListItemRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ValueListItemRetrieveParams(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; + + private ValueListItemRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ValueListItemRetrieveParams build() { - return new ValueListItemRetrieveParams(this.expand); + return new ValueListItemRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ValueListItemRetrieveParams#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 ValueListItemRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/radar/ValueListListParams.java b/src/main/java/com/stripe/param/radar/ValueListListParams.java index aa03c974aee..dae6c307b7f 100644 --- a/src/main/java/com/stripe/param/radar/ValueListListParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ValueListListParams extends ApiRequestParams { /** The alias used to reference the value list when writing rules. */ @@ -32,6 +34,15 @@ public class ValueListListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -54,6 +65,7 @@ private ValueListListParams( Object created, String endingBefore, List expand, + Map extraParams, Long limit, String startingAfter) { this.alias = alias; @@ -61,6 +73,7 @@ private ValueListListParams( this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -80,6 +93,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -92,6 +107,7 @@ public ValueListListParams build() { this.created, this.endingBefore, this.expand, + this.extraParams, this.limit, this.startingAfter); } @@ -155,6 +171,32 @@ public Builder addAllExpand(List 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 + * ValueListListParams#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 ValueListListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -177,6 +219,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -193,7 +244,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -205,6 +257,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -215,7 +269,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ValueListListParams.Created#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 ValueListListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/radar/ValueListRetrieveParams.java b/src/main/java/com/stripe/param/radar/ValueListRetrieveParams.java index 59e0246fdbd..116780f0275 100644 --- a/src/main/java/com/stripe/param/radar/ValueListRetrieveParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ValueListRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ValueListRetrieveParams(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; + + private ValueListRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ValueListRetrieveParams build() { - return new ValueListRetrieveParams(this.expand); + return new ValueListRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ValueListRetrieveParams#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 ValueListRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/radar/ValueListUpdateParams.java b/src/main/java/com/stripe/param/radar/ValueListUpdateParams.java index 3a584f0045d..f57b2bcef52 100644 --- a/src/main/java/com/stripe/param/radar/ValueListUpdateParams.java +++ b/src/main/java/com/stripe/param/radar/ValueListUpdateParams.java @@ -18,6 +18,15 @@ public class ValueListUpdateParams extends ApiRequestParams { @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 @@ -31,9 +40,14 @@ public class ValueListUpdateParams extends ApiRequestParams { String name; private ValueListUpdateParams( - String alias, List expand, Map metadata, String name) { + String alias, + List expand, + Map extraParams, + Map metadata, + String name) { this.alias = alias; this.expand = expand; + this.extraParams = extraParams; this.metadata = metadata; this.name = name; } @@ -47,13 +61,16 @@ public static class Builder { private List expand; + private Map extraParams; + private Map metadata; private String name; /** Finalize and obtain parameter instance from this builder. */ public ValueListUpdateParams build() { - return new ValueListUpdateParams(this.alias, this.expand, this.metadata, this.name); + return new ValueListUpdateParams( + this.alias, this.expand, this.extraParams, this.metadata, this.name); } /** The name of the value list for use in rules. */ @@ -88,6 +105,32 @@ public Builder addAllExpand(List 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 + * ValueListUpdateParams#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 ValueListUpdateParams#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 diff --git a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java index 700642b3c26..407666cada1 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import lombok.Getter; public class ReportRunCreateParams extends ApiRequestParams { @@ -13,6 +15,15 @@ public class ReportRunCreateParams extends ApiRequestParams { @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; + /** * Parameters specifying how the report should be run. Different Report Types have different * required and optional parameters, listed in the [API Access to @@ -28,8 +39,13 @@ public class ReportRunCreateParams extends ApiRequestParams { @SerializedName("report_type") String reportType; - private ReportRunCreateParams(List expand, Parameters parameters, String reportType) { + private ReportRunCreateParams( + List expand, + Map extraParams, + Parameters parameters, + String reportType) { this.expand = expand; + this.extraParams = extraParams; this.parameters = parameters; this.reportType = reportType; } @@ -41,13 +57,16 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private Parameters parameters; private String reportType; /** Finalize and obtain parameter instance from this builder. */ public ReportRunCreateParams build() { - return new ReportRunCreateParams(this.expand, this.parameters, this.reportType); + return new ReportRunCreateParams( + this.expand, this.extraParams, this.parameters, this.reportType); } /** @@ -76,6 +95,32 @@ public Builder addAllExpand(List 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 + * ReportRunCreateParams#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 ReportRunCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Parameters specifying how the report should be run. Different Report Types have different * required and optional parameters, listed in the [API Access to @@ -112,6 +157,15 @@ public static class Parameters { @SerializedName("currency") String currency; + /** + * 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; + /** Ending timestamp of data to be included in the report run (exclusive). */ @SerializedName("interval_end") Long intervalEnd; @@ -132,6 +186,7 @@ private Parameters( List columns, String connectedAccount, String currency, + Map extraParams, Long intervalEnd, Long intervalStart, String payout, @@ -139,6 +194,7 @@ private Parameters( this.columns = columns; this.connectedAccount = connectedAccount; this.currency = currency; + this.extraParams = extraParams; this.intervalEnd = intervalEnd; this.intervalStart = intervalStart; this.payout = payout; @@ -156,6 +212,8 @@ public static class Builder { private String currency; + private Map extraParams; + private Long intervalEnd; private Long intervalStart; @@ -170,6 +228,7 @@ public Parameters build() { this.columns, this.connectedAccount, this.currency, + this.extraParams, this.intervalEnd, this.intervalStart, this.payout, @@ -214,6 +273,32 @@ public Builder setCurrency(String currency) { 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 + * ReportRunCreateParams.Parameters#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 ReportRunCreateParams.Parameters#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** Ending timestamp of data to be included in the report run (exclusive). */ public Builder setIntervalEnd(Long intervalEnd) { this.intervalEnd = intervalEnd; diff --git a/src/main/java/com/stripe/param/reporting/ReportRunListParams.java b/src/main/java/com/stripe/param/reporting/ReportRunListParams.java index a3f070ac89c..37cf8bd3619 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunListParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReportRunListParams extends ApiRequestParams { @SerializedName("created") @@ -24,6 +26,15 @@ public class ReportRunListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -41,10 +52,16 @@ public class ReportRunListParams extends ApiRequestParams { String startingAfter; private ReportRunListParams( - Object created, String endingBefore, List expand, Long limit, String startingAfter) { + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -60,6 +77,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -67,7 +86,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ReportRunListParams build() { return new ReportRunListParams( - this.created, this.endingBefore, this.expand, this.limit, this.startingAfter); + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); } public Builder setCreated(Created created) { @@ -117,6 +141,32 @@ public Builder addAllExpand(List 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 + * ReportRunListParams#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 ReportRunListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -139,6 +189,15 @@ public Builder setStartingAfter(String startingAfter) { } public static class Created { + /** + * 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; + /** Minimum value to filter by (exclusive). */ @SerializedName("gt") Long gt; @@ -155,7 +214,8 @@ public static class Created { @SerializedName("lte") Long lte; - private Created(Long gt, Long gte, Long lt, Long lte) { + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; this.gt = gt; this.gte = gte; this.lt = lt; @@ -167,6 +227,8 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private Long gt; private Long gte; @@ -177,7 +239,33 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Created build() { - return new Created(this.gt, this.gte, this.lt, this.lte); + return new Created(this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * ReportRunListParams.Created#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 ReportRunListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** Minimum value to filter by (exclusive). */ diff --git a/src/main/java/com/stripe/param/reporting/ReportRunRetrieveParams.java b/src/main/java/com/stripe/param/reporting/ReportRunRetrieveParams.java index 71c2ac32604..9115306c269 100644 --- a/src/main/java/com/stripe/param/reporting/ReportRunRetrieveParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportRunRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReportRunRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ReportRunRetrieveParams(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; + + private ReportRunRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ReportRunRetrieveParams build() { - return new ReportRunRetrieveParams(this.expand); + return new ReportRunRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ReportRunRetrieveParams#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 ReportRunRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/reporting/ReportTypeListParams.java b/src/main/java/com/stripe/param/reporting/ReportTypeListParams.java index be4a079aa35..fcfd7df40ab 100644 --- a/src/main/java/com/stripe/param/reporting/ReportTypeListParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportTypeListParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReportTypeListParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ReportTypeListParams(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; + + private ReportTypeListParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ReportTypeListParams build() { - return new ReportTypeListParams(this.expand); + return new ReportTypeListParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ReportTypeListParams#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 ReportTypeListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/reporting/ReportTypeRetrieveParams.java b/src/main/java/com/stripe/param/reporting/ReportTypeRetrieveParams.java index 4d41e03d8fd..24e2a734639 100644 --- a/src/main/java/com/stripe/param/reporting/ReportTypeRetrieveParams.java +++ b/src/main/java/com/stripe/param/reporting/ReportTypeRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReportTypeRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ReportTypeRetrieveParams(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; + + private ReportTypeRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ReportTypeRetrieveParams build() { - return new ReportTypeRetrieveParams(this.expand); + return new ReportTypeRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ReportTypeRetrieveParams#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 ReportTypeRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/sigma/ScheduledQueryRunListParams.java b/src/main/java/com/stripe/param/sigma/ScheduledQueryRunListParams.java index 7ac78d675d6..a5fd13fad48 100644 --- a/src/main/java/com/stripe/param/sigma/ScheduledQueryRunListParams.java +++ b/src/main/java/com/stripe/param/sigma/ScheduledQueryRunListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ScheduledQueryRunListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class ScheduledQueryRunListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -38,9 +49,14 @@ public class ScheduledQueryRunListParams extends ApiRequestParams { String startingAfter; private ScheduledQueryRunListParams( - String endingBefore, List expand, Long limit, String startingAfter) { + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; } @@ -54,6 +70,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String startingAfter; @@ -61,7 +79,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ScheduledQueryRunListParams build() { return new ScheduledQueryRunListParams( - this.endingBefore, this.expand, this.limit, this.startingAfter); + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); } /** @@ -101,6 +119,32 @@ public Builder addAllExpand(List 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 + * ScheduledQueryRunListParams#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 ScheduledQueryRunListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/sigma/ScheduledQueryRunRetrieveParams.java b/src/main/java/com/stripe/param/sigma/ScheduledQueryRunRetrieveParams.java index f826067d09c..f51f03b3e4a 100644 --- a/src/main/java/com/stripe/param/sigma/ScheduledQueryRunRetrieveParams.java +++ b/src/main/java/com/stripe/param/sigma/ScheduledQueryRunRetrieveParams.java @@ -5,15 +5,27 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ScheduledQueryRunRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; - private ScheduledQueryRunRetrieveParams(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; + + private ScheduledQueryRunRetrieveParams(List expand, Map extraParams) { this.expand = expand; + this.extraParams = extraParams; } public static Builder builder() { @@ -23,9 +35,11 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ public ScheduledQueryRunRetrieveParams build() { - return new ScheduledQueryRunRetrieveParams(this.expand); + return new ScheduledQueryRunRetrieveParams(this.expand, this.extraParams); } /** @@ -53,5 +67,31 @@ public Builder addAllExpand(List elements) { 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 + * ScheduledQueryRunRetrieveParams#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 ScheduledQueryRunRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } } } diff --git a/src/main/java/com/stripe/param/terminal/ConnectionTokenCreateParams.java b/src/main/java/com/stripe/param/terminal/ConnectionTokenCreateParams.java index 6ff44a9505a..fc53d792293 100644 --- a/src/main/java/com/stripe/param/terminal/ConnectionTokenCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConnectionTokenCreateParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ConnectionTokenCreateParams extends ApiRequestParams { /** 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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -20,8 +31,10 @@ public class ConnectionTokenCreateParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private ConnectionTokenCreateParams(List expand, String operatorAccount) { + private ConnectionTokenCreateParams( + List expand, Map extraParams, String operatorAccount) { this.expand = expand; + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -32,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public ConnectionTokenCreateParams build() { - return new ConnectionTokenCreateParams(this.expand, this.operatorAccount); + return new ConnectionTokenCreateParams(this.expand, this.extraParams, this.operatorAccount); } /** @@ -65,6 +80,32 @@ public Builder addAllExpand(List 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 + * ConnectionTokenCreateParams#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 ConnectionTokenCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) diff --git a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java index 57160d5a596..0c351999a1b 100644 --- a/src/main/java/com/stripe/param/terminal/LocationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationCreateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class LocationCreateParams extends ApiRequestParams { /** The full address of the location. */ @@ -20,6 +22,15 @@ public class LocationCreateParams extends ApiRequestParams { @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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -29,10 +40,15 @@ public class LocationCreateParams extends ApiRequestParams { String operatorAccount; private LocationCreateParams( - Address address, String displayName, List expand, String operatorAccount) { + Address address, + String displayName, + List expand, + Map extraParams, + String operatorAccount) { this.address = address; this.displayName = displayName; this.expand = expand; + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -47,12 +63,14 @@ public static class Builder { private List expand; + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public LocationCreateParams build() { return new LocationCreateParams( - this.address, this.displayName, this.expand, this.operatorAccount); + this.address, this.displayName, this.expand, this.extraParams, this.operatorAccount); } /** The full address of the location. */ @@ -93,6 +111,32 @@ public Builder addAllExpand(List 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 + * LocationCreateParams#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 LocationCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -112,6 +156,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -125,9 +178,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -143,6 +203,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -154,7 +216,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -167,6 +235,32 @@ public Builder setCountry(String 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 + * LocationCreateParams.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 LocationCreateParams.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/terminal/LocationDeleteParams.java b/src/main/java/com/stripe/param/terminal/LocationDeleteParams.java index 61c32a1fc70..dbf6c99e7d7 100644 --- a/src/main/java/com/stripe/param/terminal/LocationDeleteParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationDeleteParams.java @@ -4,8 +4,19 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; public class LocationDeleteParams extends ApiRequestParams { + /** + * 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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -14,7 +25,8 @@ public class LocationDeleteParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private LocationDeleteParams(String operatorAccount) { + private LocationDeleteParams(Map extraParams, String operatorAccount) { + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -23,11 +35,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public LocationDeleteParams build() { - return new LocationDeleteParams(this.operatorAccount); + return new LocationDeleteParams(this.extraParams, this.operatorAccount); + } + + /** + * 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 + * LocationDeleteParams#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 LocationDeleteParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/terminal/LocationListParams.java b/src/main/java/com/stripe/param/terminal/LocationListParams.java index 1a9573ad40a..4182f353703 100644 --- a/src/main/java/com/stripe/param/terminal/LocationListParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class LocationListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class LocationListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -48,11 +59,13 @@ public class LocationListParams extends ApiRequestParams { private LocationListParams( String endingBefore, List expand, + Map extraParams, Long limit, String operatorAccount, String startingAfter) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.operatorAccount = operatorAccount; this.startingAfter = startingAfter; @@ -67,6 +80,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String operatorAccount; @@ -76,7 +91,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public LocationListParams build() { return new LocationListParams( - this.endingBefore, this.expand, this.limit, this.operatorAccount, this.startingAfter); + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.operatorAccount, + this.startingAfter); } /** @@ -116,6 +136,32 @@ public Builder addAllExpand(List 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 + * LocationListParams#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 LocationListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/terminal/LocationRetrieveParams.java b/src/main/java/com/stripe/param/terminal/LocationRetrieveParams.java index 61ae8422f83..93802ff2b38 100644 --- a/src/main/java/com/stripe/param/terminal/LocationRetrieveParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationRetrieveParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class LocationRetrieveParams extends ApiRequestParams { /** 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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -20,8 +31,10 @@ public class LocationRetrieveParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private LocationRetrieveParams(List expand, String operatorAccount) { + private LocationRetrieveParams( + List expand, Map extraParams, String operatorAccount) { this.expand = expand; + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -32,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public LocationRetrieveParams build() { - return new LocationRetrieveParams(this.expand, this.operatorAccount); + return new LocationRetrieveParams(this.expand, this.extraParams, this.operatorAccount); } /** @@ -65,6 +80,32 @@ public Builder addAllExpand(List 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 + * LocationRetrieveParams#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 LocationRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) diff --git a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java index 98980336001..b0c8cbd1746 100644 --- a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class LocationUpdateParams extends ApiRequestParams { /** The full address of the location. */ @@ -20,6 +22,15 @@ public class LocationUpdateParams extends ApiRequestParams { @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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -29,10 +40,15 @@ public class LocationUpdateParams extends ApiRequestParams { String operatorAccount; private LocationUpdateParams( - Address address, String displayName, List expand, String operatorAccount) { + Address address, + String displayName, + List expand, + Map extraParams, + String operatorAccount) { this.address = address; this.displayName = displayName; this.expand = expand; + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -47,12 +63,14 @@ public static class Builder { private List expand; + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public LocationUpdateParams build() { return new LocationUpdateParams( - this.address, this.displayName, this.expand, this.operatorAccount); + this.address, this.displayName, this.expand, this.extraParams, this.operatorAccount); } /** The full address of the location. */ @@ -93,6 +111,32 @@ public Builder addAllExpand(List 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 + * LocationUpdateParams#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 LocationUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -112,6 +156,15 @@ public static class Address { @SerializedName("country") String 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; + @SerializedName("line1") String line1; @@ -125,9 +178,16 @@ public static class Address { String state; private Address( - String city, String country, String line1, String line2, String postalCode, String state) { + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { this.city = city; this.country = country; + this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; @@ -143,6 +203,8 @@ public static class Builder { private String country; + private Map extraParams; + private String line1; private String line2; @@ -154,7 +216,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public Address build() { return new Address( - this.city, this.country, this.line1, this.line2, this.postalCode, this.state); + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); } public Builder setCity(String city) { @@ -167,6 +235,32 @@ public Builder setCountry(String 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 + * LocationUpdateParams.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 LocationUpdateParams.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; + } + public Builder setLine1(String line1) { this.line1 = line1; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderCreateParams.java b/src/main/java/com/stripe/param/terminal/ReaderCreateParams.java index 79150e41323..2df0948c5c7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderCreateParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReaderCreateParams extends ApiRequestParams { /** 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; + /** * Custom label given to the reader for easier identification. If no label is specified, the * registration code will be used. @@ -40,11 +51,13 @@ public class ReaderCreateParams extends ApiRequestParams { private ReaderCreateParams( List expand, + Map extraParams, String label, String location, String operatorAccount, String registrationCode) { this.expand = expand; + this.extraParams = extraParams; this.label = label; this.location = location; this.operatorAccount = operatorAccount; @@ -58,6 +71,8 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String label; private String location; @@ -69,7 +84,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public ReaderCreateParams build() { return new ReaderCreateParams( - this.expand, this.label, this.location, this.operatorAccount, this.registrationCode); + this.expand, + this.extraParams, + this.label, + this.location, + this.operatorAccount, + this.registrationCode); } /** @@ -98,6 +118,32 @@ public Builder addAllExpand(List 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 + * ReaderCreateParams#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 ReaderCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * Custom label given to the reader for easier identification. If no label is specified, the * registration code will be used. diff --git a/src/main/java/com/stripe/param/terminal/ReaderDeleteParams.java b/src/main/java/com/stripe/param/terminal/ReaderDeleteParams.java index c19707a0a15..072d08baca7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderDeleteParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderDeleteParams.java @@ -4,8 +4,19 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; public class ReaderDeleteParams extends ApiRequestParams { + /** + * 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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -14,7 +25,8 @@ public class ReaderDeleteParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private ReaderDeleteParams(String operatorAccount) { + private ReaderDeleteParams(Map extraParams, String operatorAccount) { + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -23,11 +35,39 @@ public static Builder builder() { } public static class Builder { + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public ReaderDeleteParams build() { - return new ReaderDeleteParams(this.operatorAccount); + return new ReaderDeleteParams(this.extraParams, this.operatorAccount); + } + + /** + * 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 + * ReaderDeleteParams#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 ReaderDeleteParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; } /** diff --git a/src/main/java/com/stripe/param/terminal/ReaderListParams.java b/src/main/java/com/stripe/param/terminal/ReaderListParams.java index 66dc73200e5..8c023fcf65d 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderListParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderListParams.java @@ -5,7 +5,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReaderListParams extends ApiRequestParams { /** @@ -21,6 +23,15 @@ public class ReaderListParams extends ApiRequestParams { @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; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -56,6 +67,7 @@ public class ReaderListParams extends ApiRequestParams { private ReaderListParams( String endingBefore, List expand, + Map extraParams, Long limit, String location, String operatorAccount, @@ -63,6 +75,7 @@ private ReaderListParams( String status) { this.endingBefore = endingBefore; this.expand = expand; + this.extraParams = extraParams; this.limit = limit; this.location = location; this.operatorAccount = operatorAccount; @@ -79,6 +92,8 @@ public static class Builder { private List expand; + private Map extraParams; + private Long limit; private String location; @@ -94,6 +109,7 @@ public ReaderListParams build() { return new ReaderListParams( this.endingBefore, this.expand, + this.extraParams, this.limit, this.location, this.operatorAccount, @@ -138,6 +154,32 @@ public Builder addAllExpand(List 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 + * ReaderListParams#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 ReaderListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. diff --git a/src/main/java/com/stripe/param/terminal/ReaderRetrieveParams.java b/src/main/java/com/stripe/param/terminal/ReaderRetrieveParams.java index 336c2f7d21a..945964f56ff 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderRetrieveParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderRetrieveParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReaderRetrieveParams extends ApiRequestParams { /** 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; + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) @@ -20,8 +31,10 @@ public class ReaderRetrieveParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private ReaderRetrieveParams(List expand, String operatorAccount) { + private ReaderRetrieveParams( + List expand, Map extraParams, String operatorAccount) { this.expand = expand; + this.extraParams = extraParams; this.operatorAccount = operatorAccount; } @@ -32,11 +45,13 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public ReaderRetrieveParams build() { - return new ReaderRetrieveParams(this.expand, this.operatorAccount); + return new ReaderRetrieveParams(this.expand, this.extraParams, this.operatorAccount); } /** @@ -65,6 +80,32 @@ public Builder addAllExpand(List 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 + * ReaderRetrieveParams#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 ReaderRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** * To [group * objects](https://stripe.com/docs/terminal/payments/connect#grouping-objects-by-connected-account) diff --git a/src/main/java/com/stripe/param/terminal/ReaderUpdateParams.java b/src/main/java/com/stripe/param/terminal/ReaderUpdateParams.java index 1fbd7ee37ef..94955aa8d61 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderUpdateParams.java @@ -5,13 +5,24 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ReaderUpdateParams extends ApiRequestParams { /** 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; + /** The new label of the reader. */ @SerializedName("label") String label; @@ -24,8 +35,10 @@ public class ReaderUpdateParams extends ApiRequestParams { @SerializedName("operator_account") String operatorAccount; - private ReaderUpdateParams(List expand, String label, String operatorAccount) { + private ReaderUpdateParams( + List expand, Map extraParams, String label, String operatorAccount) { this.expand = expand; + this.extraParams = extraParams; this.label = label; this.operatorAccount = operatorAccount; } @@ -37,13 +50,16 @@ public static Builder builder() { public static class Builder { private List expand; + private Map extraParams; + private String label; private String operatorAccount; /** Finalize and obtain parameter instance from this builder. */ public ReaderUpdateParams build() { - return new ReaderUpdateParams(this.expand, this.label, this.operatorAccount); + return new ReaderUpdateParams( + this.expand, this.extraParams, this.label, this.operatorAccount); } /** @@ -72,6 +88,32 @@ public Builder addAllExpand(List 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 + * ReaderUpdateParams#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 ReaderUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + /** The new label of the reader. */ public Builder setLabel(String label) { this.label = label; diff --git a/src/test/java/com/stripe/functional/InvoiceTest.java b/src/test/java/com/stripe/functional/InvoiceTest.java index d1852748610..4c2039bede7 100644 --- a/src/test/java/com/stripe/functional/InvoiceTest.java +++ b/src/test/java/com/stripe/functional/InvoiceTest.java @@ -4,19 +4,23 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableMap; + import com.stripe.BaseStripeTest; import com.stripe.exception.StripeException; import com.stripe.model.Invoice; import com.stripe.model.InvoiceCollection; import com.stripe.net.ApiResource; - import com.stripe.net.RequestOptions; +import com.stripe.param.InvoiceCreateParams; import com.stripe.param.InvoiceUpcomingParams; import com.stripe.param.InvoiceUpdateParams; import com.stripe.param.common.EmptyParam; + import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; @@ -77,7 +81,7 @@ public void testUpdate() throws StripeException { } @Test - public void testUpdateWithTypeParams() throws StripeException { + public void testUpdateWithTypedParams() throws StripeException { final Invoice invoice = getInvoiceFixture(); final Map metadata = new HashMap<>(); @@ -114,13 +118,17 @@ public void testUpdateWithTypeParams() throws StripeException { String.format("/v1/invoices/%s", invoice.getId()), params ); + } + @Test + public void testUpdateWithTypedParamsContainingEmptyParamEnum() throws StripeException { + final Invoice invoice = getInvoiceFixture(); InvoiceUpdateParams typedParamsWithEmpty = InvoiceUpdateParams.builder() .setCustomFields(EmptyParam.EMPTY) .setTaxPercent(EmptyParam.EMPTY) .build(); - updatedInvoice = invoice.update(typedParamsWithEmpty, RequestOptions.getDefault()); + Invoice updatedInvoice = invoice.update(typedParamsWithEmpty, RequestOptions.getDefault()); Map paramsWithEmpty = new HashMap<>(); paramsWithEmpty.put("custom_fields", null); @@ -134,6 +142,49 @@ public void testUpdateWithTypeParams() throws StripeException { ); } + @Test + public void testUpdateWithExtraParams() throws StripeException { + final Invoice invoice = getInvoiceFixture(); + // suppose that `custom_fields` isn't available yet, pretend + // that users want this beta feature and use untyped map in our + // main typed param via `putExtraParam` + List> customFields = new ArrayList<>(); + customFields.add( + ImmutableMap.of( + "name", "A", + "value", "1" + )); + customFields.add( + ImmutableMap.of( + "name", "B", + "value", "2" + ) + ); + + InvoiceUpdateParams paramsWithExtraParam = InvoiceUpdateParams.builder() + .putExtraParam("custom_fields", customFields) + .build(); + + Invoice updatedInvoice = invoice.update(paramsWithExtraParam, RequestOptions.getDefault()); + + assertNotNull(updatedInvoice); + + assertNotNull(invoice); + verifyRequest( + ApiResource.RequestMethod.POST, + String.format("/v1/invoices/%s", invoice.getId()), + // param with extra param has the same map as that using standard builder + InvoiceCreateParams.builder() + .setCustomFields(Arrays.asList( + InvoiceCreateParams.CustomField.builder() + .setName("A").setValue("1").build(), + InvoiceCreateParams.CustomField.builder() + .setName("B").setValue("2").build() + )) + .build().toMap() + ); + } + @Test public void testList() throws StripeException { final Map params = new HashMap<>(); diff --git a/src/test/java/com/stripe/net/ApiRequestParamsConverterTest.java b/src/test/java/com/stripe/net/ApiRequestParamsConverterTest.java new file mode 100644 index 00000000000..c9b3d57875e --- /dev/null +++ b/src/test/java/com/stripe/net/ApiRequestParamsConverterTest.java @@ -0,0 +1,221 @@ +package com.stripe.net; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.gson.annotations.SerializedName; + +import com.stripe.param.common.EmptyParam; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +public class ApiRequestParamsConverterTest { + private ApiRequestParamsConverter converter = new ApiRequestParamsConverter(); + + // To test interactions between the flattening and empty enums + enum ParamCode implements ApiRequestParams.EnumParam { + ENUM_FOO("enum_foo"), + ENUM_BAR("enum_bar"),; + + private final String value; + + ParamCode(String value) { + this.value = value; + } + + @Override + public String getValue() { + return this.value; + } + } + + // The fields are implicitly used in testing serialization + @SuppressWarnings("UnusedVariable") + private static class ModelHasExtraParams extends ApiRequestParams { + private String stringValue; + private EnumParam enumValue; + + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + private Map extraParams; + + public ModelHasExtraParams(EnumParam enumValue) { + this.stringValue = "foo"; + this.enumValue = enumValue; + this.extraParams = new HashMap<>(); + this.extraParams.put("hello", "world"); + } + + static Map expectedParams(String enumString) { + Map paramMap = new HashMap<>(); + paramMap.put("string_value", "foo"); + paramMap.put("enum_value", enumString); + // "hello" key is flattened to the same level as root-level params + // and the key for `extraParams` is dropped + paramMap.put("hello", "world"); + return paramMap; + } + } + + // The fields are implicitly used in testing serialization + @SuppressWarnings("UnusedVariable") + private static class RootModelHasNestedExtraParams extends ApiRequestParams { + private String rootStringValue; + private EnumParam rootEnumValue; + private ModelHasExtraParams subParamFoo; + + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + private Map extraParams; + + public RootModelHasNestedExtraParams(EnumParam rootEnumValue, + ModelHasExtraParams subParamFoo) { + this.rootStringValue = "bar"; + this.rootEnumValue = rootEnumValue; + this.subParamFoo = subParamFoo; + this.extraParams = new HashMap<>(); + this.extraParams.put("bar_hello", "bar_world"); + } + + static Map expectedParams(String enumString) { + Map rootLevelParams = new HashMap<>(); + rootLevelParams.put("root_string_value", "bar"); + rootLevelParams.put("root_enum_value", enumString); + // similar to the `ModelHasExtraParams` test model, + // "bar_hello" key is flattened to the same level as root-level params + rootLevelParams.put("bar_hello", "bar_world"); + return rootLevelParams; + } + } + + private static class ModelHasListExtraParams extends ApiRequestParams { + List paramFooList; + } + + private static class ModelHasExtraParamsWithWrongSerializedName extends ApiRequestParams { + @SerializedName("extra_params") + private Map extraParams; + } + + private static class IllegalModelHasWrongExtraParamsType extends ApiRequestParams { + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + String extraParams; + } + + @Test + public void testHasExtraParams() { + ModelHasExtraParams params = new ModelHasExtraParams(ParamCode.ENUM_FOO); + + assertEquals( + ModelHasExtraParams.expectedParams("enum_foo"), + toMap(params)); + } + + @Test + public void testHasExtraParamsWithFormEncodedKeys() { + ModelHasExtraParams params = new ModelHasExtraParams(ParamCode.ENUM_FOO); + params.extraParams.put("root_param[foo][string]", "value_foo"); + params.extraParams.put("root_param[bar][integer]", "123"); + + Map expected = ModelHasExtraParams.expectedParams("enum_foo"); + assertNotEquals(expected, toMap(params)); + + expected.put("root_param[foo][string]", "value_foo"); + expected.put("root_param[bar][integer]", "123"); + assertEquals(expected, toMap(params)); + } + + @Test + public void testHasNestedExtraParams() { + ModelHasExtraParams fooParams = new ModelHasExtraParams(ParamCode.ENUM_FOO); + RootModelHasNestedExtraParams barParams = new RootModelHasNestedExtraParams( + ParamCode.ENUM_BAR, fooParams); + + Map expected = RootModelHasNestedExtraParams + .expectedParams("enum_bar"); + expected.put("sub_param_foo", ModelHasExtraParams.expectedParams("enum_foo")); + + assertEquals(expected, toMap(barParams)); + } + + @Test + public void testHasNestedExtraParamsWithEmpty() { + ModelHasExtraParams fooParams = new ModelHasExtraParams(EmptyParam.EMPTY); + + RootModelHasNestedExtraParams barParams = new RootModelHasNestedExtraParams( + EmptyParam.EMPTY, fooParams); + + Map expected = RootModelHasNestedExtraParams.expectedParams(null); + expected.put("sub_param_foo", ModelHasExtraParams.expectedParams(null)); + + assertEquals(expected, toMap(barParams)); + } + + @Test + public void testHasListExtraParams() { + ModelHasListExtraParams params = new ModelHasListExtraParams(); + params.paramFooList = Arrays.asList( + new ModelHasExtraParams(ParamCode.ENUM_FOO), + new ModelHasExtraParams(ParamCode.ENUM_BAR) + ); + + Map expected = new HashMap<>(); + expected.put("param_foo_list", + Arrays.asList( + ModelHasExtraParams.expectedParams("enum_foo"), + ModelHasExtraParams.expectedParams("enum_bar") + )); + assertEquals(expected, toMap(params)); + } + + @SuppressWarnings("unchecked") + @Test + public void testHasExtraParamsWithWrongSerializedName() { + ModelHasExtraParamsWithWrongSerializedName params = + new ModelHasExtraParamsWithWrongSerializedName(); + params.extraParams = new HashMap<>(); + params.extraParams.put("foo", "bar"); + + Map untypedParams = toMap(params); + assertEquals(1, untypedParams.size()); + assertTrue(untypedParams.containsKey("extra_params")); + Map subParams = (Map)untypedParams.get("extra_params"); + assertEquals(1, subParams.size()); + assertEquals("bar", subParams.get("foo")); + } + + @Test + public void testIllegalExtraParamsType() { + IllegalModelHasWrongExtraParamsType params = new IllegalModelHasWrongExtraParamsType(); + params.extraParams = "should have been a map"; + + IllegalStateException exception = assertThrows(IllegalStateException.class, () -> { + toMap(params); + }); + assertTrue(exception.getMessage().contains("Unexpected schema for extra params")); + } + + @Test + public void testIllegalConflictingExtraParams() { + ModelHasExtraParams fooParams = new ModelHasExtraParams(ParamCode.ENUM_FOO); + // `string_value` will find two param values: one from the original param, the other from the + // flattened extra param map. + assertTrue(fooParams.toMap().containsKey("string_value")); + fooParams.extraParams.put("string_value", "my conflicting param value"); + + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + toMap(fooParams); + }); + assertTrue(exception.getMessage().contains( + "Found param key `string_value` with values `foo` and `my conflicting param value`.")); + } + + private Map toMap(ApiRequestParams params) { + return converter.convert(params); + } +} \ No newline at end of file diff --git a/src/test/java/com/stripe/net/LiveStripeResponseGetterTest.java b/src/test/java/com/stripe/net/LiveStripeResponseGetterTest.java index e8c3672e639..f7352979de9 100644 --- a/src/test/java/com/stripe/net/LiveStripeResponseGetterTest.java +++ b/src/test/java/com/stripe/net/LiveStripeResponseGetterTest.java @@ -123,6 +123,27 @@ public void testCreateQueryWithListOfHashes() throws StripeException, LiveStripeResponseGetter.createQuery(params)); } + @Test + public void testCreateQueryWithFormEncodedKeys() throws StripeException, + UnsupportedEncodingException { + /* Use LinkedHashMap because it preserves iteration order */ + final Map params = new LinkedHashMap<>(); + + // Params with form-encoded keys can happen through "extraParams". Instead of passing a + // string key and `Object` value, users can also specify key as form-encoded path to the + // extra param value. + // This "extraParams" behavior is supported by other typed libraries, but not + // intended in `stripe-java`. However, by the virtue of supporting arbitrary string key in + // extra param map, this behavior is implicitly supported. + params.put("nested[0][A]", "A-1"); + params.put("nested[0][B]", "B-1"); + params.put("nested[1][A]", "A-2"); + params.put("nested[1][B]", "B-2"); + + assertEquals("nested[0][A]=A-1&nested[0][B]=B-1&nested[1][A]=A-2&nested[1][B]=B-2", + LiveStripeResponseGetter.createQuery(params)); + } + @SuppressWarnings("ModifiedButNotUsed") @Test public void testCreateQueryWithCollection() throws UnsupportedEncodingException, diff --git a/src/test/java/com/stripe/net/UntypedMapDeserializerTest.java b/src/test/java/com/stripe/net/UntypedMapDeserializerTest.java index ce4472a812d..2fd6da100b6 100644 --- a/src/test/java/com/stripe/net/UntypedMapDeserializerTest.java +++ b/src/test/java/com/stripe/net/UntypedMapDeserializerTest.java @@ -1,6 +1,6 @@ package com.stripe.net; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableMap; import com.google.gson.JsonArray; @@ -10,15 +10,29 @@ import com.google.gson.JsonPrimitive; import java.math.BigDecimal; +import java.util.Arrays; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UntypedMapDeserializerTest { private UntypedMapDeserializer untypedMapDeserializer = new UntypedMapDeserializer(); + private UntypedMapDeserializer flatteningDeserializer = new UntypedMapDeserializer( + (outerMap, jsonEntry, untypedMapDeserializer) -> { + JsonElement value = jsonEntry.getValue(); + if (value.isJsonObject()) { + outerMap.putAll(untypedMapDeserializer.deserialize(value.getAsJsonObject())); + } else { + outerMap.put(jsonEntry.getKey(), + untypedMapDeserializer.deserializeJsonElement(value)); + } + return; + } + ); + @Test @SuppressWarnings("unchecked") public void testMapOfArray() { @@ -90,6 +104,50 @@ public void testMapOfArrayOfMap() { assertEquals(ImmutableMap.of("bar", 3L), objects.get(1)); } + @Test + public void tesStrategyFlattenAllSchema() { + // {"parent": {"child": {"grand_child": 1}}} + JsonObject jsonObject = new JsonObject(); + jsonObject.add("parent", + jsonObject("child", jsonObject("grand_child", jsonNumber(1L)))); + Map untyped = flatteningDeserializer.deserialize(jsonObject); + // innermost remains + assertEquals(ImmutableMap.of("grand_child", 1L), untyped); + } + + @Test + public void tesStrategyFlattenInArraySchema() { + JsonArray jsonArray = jsonArray( + jsonObject("child", jsonObject("grand_child", jsonNumber(1L))), + jsonObject("child", jsonObject("grand_child", jsonNumber(2L))), + jsonObject("child", jsonObject("grand_child", jsonNumber(3L))) + ); + + Object untyped = flatteningDeserializer.deserializeJsonElement(jsonArray); + assertEquals(Arrays.asList( + ImmutableMap.of("grand_child", 1L), + ImmutableMap.of("grand_child", 2L), + ImmutableMap.of("grand_child", 3L)), untyped); + } + + @Test + public void tesStrategyRenameKey() { + UntypedMapDeserializer renamer = new UntypedMapDeserializer( + (outerMap, jsonEntry, untypedMapDeserializer) -> { + JsonElement value = jsonEntry.getValue(); + outerMap.put(jsonEntry.getKey() + "_foo", + untypedMapDeserializer.deserializeJsonElement(value)); + } + ); + + JsonObject jsonObject = new JsonObject(); + jsonObject.add("child", jsonObject("grand_child", jsonNumber(1L))); + Map untyped = renamer.deserialize(jsonObject); + assertEquals(untyped, ImmutableMap.of( + "child_foo", ImmutableMap.of("grand_child_foo", 1L) + )); + } + private JsonArray jsonArray(JsonElement... elements) { JsonArray jsonArray = new JsonArray(); for (JsonElement primitive : elements) { @@ -111,4 +169,4 @@ private JsonObject jsonObject(String key, JsonElement element) { jsonObject.add(key, element); return jsonObject; } -} +} \ No newline at end of file