com.stripe.param.ChargeCaptureParams Maven / Gradle / Ivy
// File generated from our OpenAPI spec
package com.stripe.param;
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;
@Getter
public class ChargeCaptureParams extends ApiRequestParams {
/**
* The amount to capture, which must be less than or equal to the original amount. Any additional
* amount will be automatically refunded.
*/
@SerializedName("amount")
Long amount;
/** An application fee to add on to this charge. */
@SerializedName("application_fee")
Long applicationFee;
/**
* An application fee amount to add on to this charge, which must be less than or equal to the
* original amount.
*/
@SerializedName("application_fee_amount")
Long applicationFeeAmount;
/** 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;
/** Provides industry-specific information about the charge. */
@SerializedName("payment_details")
PaymentDetails paymentDetails;
/**
* 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.
*/
@SerializedName("receipt_email")
String receiptEmail;
/**
* For a non-card charge, text that appears on the customer's statement as the statement
* descriptor. This value overrides the account's default statement descriptor. For information
* about requirements, including the 22-character limit, see the Statement
* Descriptor docs.
*
* For a card charge, this value is ignored unless you don't specify a {@code
* statement_descriptor_suffix}, in which case this value is used as the suffix.
*/
@SerializedName("statement_descriptor")
String statementDescriptor;
/**
* Provides information about a card charge. Concatenated to the account's statement
* descriptor prefix to form the complete statement descriptor that appears on the customer's
* statement. If the account has no prefix value, the suffix is concatenated to the account's
* statement descriptor.
*/
@SerializedName("statement_descriptor_suffix")
String statementDescriptorSuffix;
/**
* An optional dictionary including the account to automatically transfer to as part of a
* destination charge. See the
* Connect documentation for details.
*/
@SerializedName("transfer_data")
TransferData transferData;
/**
* A string that identifies this transaction as part of a group. {@code transfer_group} may only
* be provided if it has not been set. See the Connect
* documentation for details.
*/
@SerializedName("transfer_group")
String transferGroup;
private ChargeCaptureParams(
Long amount,
Long applicationFee,
Long applicationFeeAmount,
List expand,
Map extraParams,
PaymentDetails paymentDetails,
String receiptEmail,
String statementDescriptor,
String statementDescriptorSuffix,
TransferData transferData,
String transferGroup) {
this.amount = amount;
this.applicationFee = applicationFee;
this.applicationFeeAmount = applicationFeeAmount;
this.expand = expand;
this.extraParams = extraParams;
this.paymentDetails = paymentDetails;
this.receiptEmail = receiptEmail;
this.statementDescriptor = statementDescriptor;
this.statementDescriptorSuffix = statementDescriptorSuffix;
this.transferData = transferData;
this.transferGroup = transferGroup;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long amount;
private Long applicationFee;
private Long applicationFeeAmount;
private List expand;
private Map extraParams;
private PaymentDetails paymentDetails;
private String receiptEmail;
private String statementDescriptor;
private String statementDescriptorSuffix;
private TransferData transferData;
private String transferGroup;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams build() {
return new ChargeCaptureParams(
this.amount,
this.applicationFee,
this.applicationFeeAmount,
this.expand,
this.extraParams,
this.paymentDetails,
this.receiptEmail,
this.statementDescriptor,
this.statementDescriptorSuffix,
this.transferData,
this.transferGroup);
}
/**
* The amount to capture, which must be less than or equal to the original amount. Any
* additional amount will be automatically refunded.
*/
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}
/** An application fee to add on to this charge. */
public Builder setApplicationFee(Long applicationFee) {
this.applicationFee = applicationFee;
return this;
}
/**
* An application fee amount to add on to this charge, which must be less than or equal to the
* original amount.
*/
public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
this.applicationFeeAmount = applicationFeeAmount;
return this;
}
/**
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams#expand} for the field documentation.
*/
public Builder addExpand(String element) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.add(element);
return this;
}
/**
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams#expand} for the field documentation.
*/
public Builder addAllExpand(List elements) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.addAll(elements);
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* 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;
}
/** Provides industry-specific information about the charge. */
public Builder setPaymentDetails(ChargeCaptureParams.PaymentDetails paymentDetails) {
this.paymentDetails = paymentDetails;
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
* in test mode.
*/
public Builder setReceiptEmail(String receiptEmail) {
this.receiptEmail = receiptEmail;
return this;
}
/**
* For a non-card charge, text that appears on the customer's statement as the statement
* descriptor. This value overrides the account's default statement descriptor. For information
* about requirements, including the 22-character limit, see the Statement
* Descriptor docs.
*
* For a card charge, this value is ignored unless you don't specify a {@code
* statement_descriptor_suffix}, in which case this value is used as the suffix.
*/
public Builder setStatementDescriptor(String statementDescriptor) {
this.statementDescriptor = statementDescriptor;
return this;
}
/**
* Provides information about a card charge. Concatenated to the account's statement
* descriptor prefix to form the complete statement descriptor that appears on the
* customer's statement. If the account has no prefix value, the suffix is concatenated to the
* account's statement descriptor.
*/
public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) {
this.statementDescriptorSuffix = statementDescriptorSuffix;
return this;
}
/**
* An optional dictionary including the account to automatically transfer to as part of a
* destination charge. See the
* Connect documentation for details.
*/
public Builder setTransferData(ChargeCaptureParams.TransferData transferData) {
this.transferData = transferData;
return this;
}
/**
* A string that identifies this transaction as part of a group. {@code transfer_group} may only
* be provided if it has not been set. See the Connect
* documentation for details.
*/
public Builder setTransferGroup(String transferGroup) {
this.transferGroup = transferGroup;
return this;
}
}
@Getter
public static class PaymentDetails {
/** Car rental details for this PaymentIntent. */
@SerializedName("car_rental")
CarRental carRental;
/** Event details for this PaymentIntent. */
@SerializedName("event_details")
EventDetails eventDetails;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Flight reservation details for this PaymentIntent. */
@SerializedName("flight")
Flight flight;
/** Lodging reservation details for this PaymentIntent. */
@SerializedName("lodging")
Lodging lodging;
/** Subscription details for this PaymentIntent. */
@SerializedName("subscription")
Subscription subscription;
private PaymentDetails(
CarRental carRental,
EventDetails eventDetails,
Map extraParams,
Flight flight,
Lodging lodging,
Subscription subscription) {
this.carRental = carRental;
this.eventDetails = eventDetails;
this.extraParams = extraParams;
this.flight = flight;
this.lodging = lodging;
this.subscription = subscription;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private CarRental carRental;
private EventDetails eventDetails;
private Map extraParams;
private Flight flight;
private Lodging lodging;
private Subscription subscription;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails build() {
return new ChargeCaptureParams.PaymentDetails(
this.carRental,
this.eventDetails,
this.extraParams,
this.flight,
this.lodging,
this.subscription);
}
/** Car rental details for this PaymentIntent. */
public Builder setCarRental(ChargeCaptureParams.PaymentDetails.CarRental carRental) {
this.carRental = carRental;
return this;
}
/** Event details for this PaymentIntent. */
public Builder setEventDetails(ChargeCaptureParams.PaymentDetails.EventDetails eventDetails) {
this.eventDetails = eventDetails;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Flight reservation details for this PaymentIntent. */
public Builder setFlight(ChargeCaptureParams.PaymentDetails.Flight flight) {
this.flight = flight;
return this;
}
/** Lodging reservation details for this PaymentIntent. */
public Builder setLodging(ChargeCaptureParams.PaymentDetails.Lodging lodging) {
this.lodging = lodging;
return this;
}
/** Subscription details for this PaymentIntent. */
public Builder setSubscription(ChargeCaptureParams.PaymentDetails.Subscription subscription) {
this.subscription = subscription;
return this;
}
}
@Getter
public static class CarRental {
/** Affiliate details for this purchase. */
@SerializedName("affiliate")
Affiliate affiliate;
/** Required. The booking number associated with the car rental. */
@SerializedName("booking_number")
String bookingNumber;
/** Class code of the car. */
@SerializedName("car_class_code")
String carClassCode;
/** Make of the car. */
@SerializedName("car_make")
String carMake;
/** Model of the car. */
@SerializedName("car_model")
String carModel;
/** The name of the rental car company. */
@SerializedName("company")
String company;
/** The customer service phone number of the car rental company. */
@SerializedName("customer_service_phone_number")
String customerServicePhoneNumber;
/** Required. Number of days the car is being rented. */
@SerializedName("days_rented")
Long daysRented;
/** Delivery details for this purchase. */
@SerializedName("delivery")
Delivery delivery;
/** The details of the passengers in the travel reservation. */
@SerializedName("drivers")
List drivers;
/** List of additional charges being billed. */
@SerializedName("extra_charges")
List extraCharges;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 customer did not keep nor cancel their booking. */
@SerializedName("no_show")
Boolean noShow;
/** Car pick-up address. */
@SerializedName("pickup_address")
PickupAddress pickupAddress;
/** Required. Car pick-up time. Measured in seconds since the Unix epoch. */
@SerializedName("pickup_at")
Long pickupAt;
/** Rental rate. */
@SerializedName("rate_amount")
Long rateAmount;
/**
* The frequency at which the rate amount is applied. One of {@code day}, {@code week} or
* {@code month}
*/
@SerializedName("rate_interval")
RateInterval rateInterval;
/** The name of the person or entity renting the car. */
@SerializedName("renter_name")
String renterName;
/** Car return address. */
@SerializedName("return_address")
ReturnAddress returnAddress;
/** Required. Car return time. Measured in seconds since the Unix epoch. */
@SerializedName("return_at")
Long returnAt;
/** Indicates whether the goods or services are tax-exempt or tax is not collected. */
@SerializedName("tax_exempt")
Boolean taxExempt;
private CarRental(
Affiliate affiliate,
String bookingNumber,
String carClassCode,
String carMake,
String carModel,
String company,
String customerServicePhoneNumber,
Long daysRented,
Delivery delivery,
List drivers,
List extraCharges,
Map extraParams,
Boolean noShow,
PickupAddress pickupAddress,
Long pickupAt,
Long rateAmount,
RateInterval rateInterval,
String renterName,
ReturnAddress returnAddress,
Long returnAt,
Boolean taxExempt) {
this.affiliate = affiliate;
this.bookingNumber = bookingNumber;
this.carClassCode = carClassCode;
this.carMake = carMake;
this.carModel = carModel;
this.company = company;
this.customerServicePhoneNumber = customerServicePhoneNumber;
this.daysRented = daysRented;
this.delivery = delivery;
this.drivers = drivers;
this.extraCharges = extraCharges;
this.extraParams = extraParams;
this.noShow = noShow;
this.pickupAddress = pickupAddress;
this.pickupAt = pickupAt;
this.rateAmount = rateAmount;
this.rateInterval = rateInterval;
this.renterName = renterName;
this.returnAddress = returnAddress;
this.returnAt = returnAt;
this.taxExempt = taxExempt;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Affiliate affiliate;
private String bookingNumber;
private String carClassCode;
private String carMake;
private String carModel;
private String company;
private String customerServicePhoneNumber;
private Long daysRented;
private Delivery delivery;
private List drivers;
private List extraCharges;
private Map extraParams;
private Boolean noShow;
private PickupAddress pickupAddress;
private Long pickupAt;
private Long rateAmount;
private RateInterval rateInterval;
private String renterName;
private ReturnAddress returnAddress;
private Long returnAt;
private Boolean taxExempt;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental build() {
return new ChargeCaptureParams.PaymentDetails.CarRental(
this.affiliate,
this.bookingNumber,
this.carClassCode,
this.carMake,
this.carModel,
this.company,
this.customerServicePhoneNumber,
this.daysRented,
this.delivery,
this.drivers,
this.extraCharges,
this.extraParams,
this.noShow,
this.pickupAddress,
this.pickupAt,
this.rateAmount,
this.rateInterval,
this.renterName,
this.returnAddress,
this.returnAt,
this.taxExempt);
}
/** Affiliate details for this purchase. */
public Builder setAffiliate(
ChargeCaptureParams.PaymentDetails.CarRental.Affiliate affiliate) {
this.affiliate = affiliate;
return this;
}
/** Required. The booking number associated with the car rental. */
public Builder setBookingNumber(String bookingNumber) {
this.bookingNumber = bookingNumber;
return this;
}
/** Class code of the car. */
public Builder setCarClassCode(String carClassCode) {
this.carClassCode = carClassCode;
return this;
}
/** Make of the car. */
public Builder setCarMake(String carMake) {
this.carMake = carMake;
return this;
}
/** Model of the car. */
public Builder setCarModel(String carModel) {
this.carModel = carModel;
return this;
}
/** The name of the rental car company. */
public Builder setCompany(String company) {
this.company = company;
return this;
}
/** The customer service phone number of the car rental company. */
public Builder setCustomerServicePhoneNumber(String customerServicePhoneNumber) {
this.customerServicePhoneNumber = customerServicePhoneNumber;
return this;
}
/** Required. Number of days the car is being rented. */
public Builder setDaysRented(Long daysRented) {
this.daysRented = daysRented;
return this;
}
/** Delivery details for this purchase. */
public Builder setDelivery(ChargeCaptureParams.PaymentDetails.CarRental.Delivery delivery) {
this.delivery = delivery;
return this;
}
/**
* Add an element to `drivers` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.CarRental#drivers} for the field documentation.
*/
public Builder addDriver(ChargeCaptureParams.PaymentDetails.CarRental.Driver element) {
if (this.drivers == null) {
this.drivers = new ArrayList<>();
}
this.drivers.add(element);
return this;
}
/**
* Add all elements to `drivers` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.CarRental#drivers} for the field documentation.
*/
public Builder addAllDriver(
List elements) {
if (this.drivers == null) {
this.drivers = new ArrayList<>();
}
this.drivers.addAll(elements);
return this;
}
/**
* Add an element to `extraCharges` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.CarRental#extraCharges} for the field documentation.
*/
public Builder addExtraCharge(
ChargeCaptureParams.PaymentDetails.CarRental.ExtraCharge element) {
if (this.extraCharges == null) {
this.extraCharges = new ArrayList<>();
}
this.extraCharges.add(element);
return this;
}
/**
* Add all elements to `extraCharges` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.CarRental#extraCharges} for the field documentation.
*/
public Builder addAllExtraCharge(
List elements) {
if (this.extraCharges == null) {
this.extraCharges = new ArrayList<>();
}
this.extraCharges.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 ChargeCaptureParams.PaymentDetails.CarRental#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental#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 customer did not keep nor cancel their booking. */
public Builder setNoShow(Boolean noShow) {
this.noShow = noShow;
return this;
}
/** Car pick-up address. */
public Builder setPickupAddress(
ChargeCaptureParams.PaymentDetails.CarRental.PickupAddress pickupAddress) {
this.pickupAddress = pickupAddress;
return this;
}
/**
* Required. Car pick-up time. Measured in seconds since the Unix epoch.
*/
public Builder setPickupAt(Long pickupAt) {
this.pickupAt = pickupAt;
return this;
}
/** Rental rate. */
public Builder setRateAmount(Long rateAmount) {
this.rateAmount = rateAmount;
return this;
}
/**
* The frequency at which the rate amount is applied. One of {@code day}, {@code week} or
* {@code month}
*/
public Builder setRateInterval(
ChargeCaptureParams.PaymentDetails.CarRental.RateInterval rateInterval) {
this.rateInterval = rateInterval;
return this;
}
/** The name of the person or entity renting the car. */
public Builder setRenterName(String renterName) {
this.renterName = renterName;
return this;
}
/** Car return address. */
public Builder setReturnAddress(
ChargeCaptureParams.PaymentDetails.CarRental.ReturnAddress returnAddress) {
this.returnAddress = returnAddress;
return this;
}
/** Required. Car return time. Measured in seconds since the Unix epoch. */
public Builder setReturnAt(Long returnAt) {
this.returnAt = returnAt;
return this;
}
/** Indicates whether the goods or services are tax-exempt or tax is not collected. */
public Builder setTaxExempt(Boolean taxExempt) {
this.taxExempt = taxExempt;
return this;
}
}
@Getter
public static class Affiliate {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
private Affiliate(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental.Affiliate build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.Affiliate(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.CarRental.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Required. The name of the affiliate that originated the purchase. */
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class Delivery {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 delivery method for the payment. */
@SerializedName("mode")
Mode mode;
/** Details of the recipient. */
@SerializedName("recipient")
Recipient recipient;
private Delivery(Map extraParams, Mode mode, Recipient recipient) {
this.extraParams = extraParams;
this.mode = mode;
this.recipient = recipient;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Mode mode;
private Recipient recipient;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental.Delivery build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.Delivery(
this.extraParams, this.mode, this.recipient);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.CarRental.Delivery#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.Delivery#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 delivery method for the payment. */
public Builder setMode(ChargeCaptureParams.PaymentDetails.CarRental.Delivery.Mode mode) {
this.mode = mode;
return this;
}
/** Details of the recipient. */
public Builder setRecipient(
ChargeCaptureParams.PaymentDetails.CarRental.Delivery.Recipient recipient) {
this.recipient = recipient;
return this;
}
}
@Getter
public static class Recipient {
/** The email of the recipient the ticket is delivered to. */
@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 name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;
/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
private Recipient(
String email, Map extraParams, String name, String phone) {
this.email = email;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
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 ChargeCaptureParams.PaymentDetails.CarRental.Delivery.Recipient build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.Delivery.Recipient(
this.email, this.extraParams, this.name, this.phone);
}
/** The email of the recipient the ticket is delivered to. */
public Builder setEmail(String email) {
this.email = email;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the
* original map. See {@link
* ChargeCaptureParams.PaymentDetails.CarRental.Delivery.Recipient#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.Delivery.Recipient#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 recipient the ticket is delivered to. */
public Builder setName(String name) {
this.name = name;
return this;
}
/** The phone number of the recipient the ticket is delivered to. */
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
}
}
public enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("email")
EMAIL("email"),
@SerializedName("phone")
PHONE("phone"),
@SerializedName("pickup")
PICKUP("pickup"),
@SerializedName("post")
POST("post");
@Getter(onMethod_ = {@Override})
private final String value;
Mode(String value) {
this.value = value;
}
}
}
@Getter
public static class Driver {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. Full name of the person or entity on the car reservation. */
@SerializedName("name")
String name;
private Driver(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental.Driver build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.Driver(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.CarRental.Driver#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.Driver#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Required. Full name of the person or entity on the car reservation.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class PickupAddress {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@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;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
private PickupAddress(
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;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental.PickupAddress build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.PickupAddress(
this.city,
this.country,
this.extraParams,
this.line1,
this.line2,
this.postalCode,
this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ChargeCaptureParams.PaymentDetails.CarRental.PickupAddress#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.PickupAddress#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/** State, county, province, or region. */
public Builder setState(String state) {
this.state = state;
return this;
}
}
}
@Getter
public static class ReturnAddress {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@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;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
private ReturnAddress(
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;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.CarRental.ReturnAddress build() {
return new ChargeCaptureParams.PaymentDetails.CarRental.ReturnAddress(
this.city,
this.country,
this.extraParams,
this.line1,
this.line2,
this.postalCode,
this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ChargeCaptureParams.PaymentDetails.CarRental.ReturnAddress#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.CarRental.ReturnAddress#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/** State, county, province, or region. */
public Builder setState(String state) {
this.state = state;
return this;
}
}
}
public enum ExtraCharge implements ApiRequestParams.EnumParam {
@SerializedName("extra_mileage")
EXTRA_MILEAGE("extra_mileage"),
@SerializedName("gas")
GAS("gas"),
@SerializedName("late_return")
LATE_RETURN("late_return"),
@SerializedName("one_way_service")
ONE_WAY_SERVICE("one_way_service"),
@SerializedName("parking_violation")
PARKING_VIOLATION("parking_violation");
@Getter(onMethod_ = {@Override})
private final String value;
ExtraCharge(String value) {
this.value = value;
}
}
public enum RateInterval implements ApiRequestParams.EnumParam {
@SerializedName("day")
DAY("day"),
@SerializedName("month")
MONTH("month"),
@SerializedName("week")
WEEK("week");
@Getter(onMethod_ = {@Override})
private final String value;
RateInterval(String value) {
this.value = value;
}
}
}
@Getter
public static class EventDetails {
/** Indicates if the tickets are digitally checked when entering the venue. */
@SerializedName("access_controlled_venue")
Boolean accessControlledVenue;
/** The event location's address. */
@SerializedName("address")
Address address;
/** Affiliate details for this purchase. */
@SerializedName("affiliate")
Affiliate affiliate;
/** The name of the company. */
@SerializedName("company")
String company;
/** Delivery details for this purchase. */
@SerializedName("delivery")
Delivery delivery;
/** Event end time. Measured in seconds since the Unix epoch. */
@SerializedName("ends_at")
Long endsAt;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 event entertainment (concert, sports event etc). */
@SerializedName("genre")
String genre;
/** Required. The name of the event. */
@SerializedName("name")
String name;
/** Event start time. Measured in seconds since the Unix epoch. */
@SerializedName("starts_at")
Long startsAt;
private EventDetails(
Boolean accessControlledVenue,
Address address,
Affiliate affiliate,
String company,
Delivery delivery,
Long endsAt,
Map extraParams,
String genre,
String name,
Long startsAt) {
this.accessControlledVenue = accessControlledVenue;
this.address = address;
this.affiliate = affiliate;
this.company = company;
this.delivery = delivery;
this.endsAt = endsAt;
this.extraParams = extraParams;
this.genre = genre;
this.name = name;
this.startsAt = startsAt;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Boolean accessControlledVenue;
private Address address;
private Affiliate affiliate;
private String company;
private Delivery delivery;
private Long endsAt;
private Map extraParams;
private String genre;
private String name;
private Long startsAt;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.EventDetails build() {
return new ChargeCaptureParams.PaymentDetails.EventDetails(
this.accessControlledVenue,
this.address,
this.affiliate,
this.company,
this.delivery,
this.endsAt,
this.extraParams,
this.genre,
this.name,
this.startsAt);
}
/** Indicates if the tickets are digitally checked when entering the venue. */
public Builder setAccessControlledVenue(Boolean accessControlledVenue) {
this.accessControlledVenue = accessControlledVenue;
return this;
}
/** The event location's address. */
public Builder setAddress(ChargeCaptureParams.PaymentDetails.EventDetails.Address address) {
this.address = address;
return this;
}
/** Affiliate details for this purchase. */
public Builder setAffiliate(
ChargeCaptureParams.PaymentDetails.EventDetails.Affiliate affiliate) {
this.affiliate = affiliate;
return this;
}
/** The name of the company. */
public Builder setCompany(String company) {
this.company = company;
return this;
}
/** Delivery details for this purchase. */
public Builder setDelivery(
ChargeCaptureParams.PaymentDetails.EventDetails.Delivery delivery) {
this.delivery = delivery;
return this;
}
/** Event end time. Measured in seconds since the Unix epoch. */
public Builder setEndsAt(Long endsAt) {
this.endsAt = endsAt;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.EventDetails#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.EventDetails#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 event entertainment (concert, sports event etc). */
public Builder setGenre(String genre) {
this.genre = genre;
return this;
}
/** Required. The name of the event. */
public Builder setName(String name) {
this.name = name;
return this;
}
/** Event start time. Measured in seconds since the Unix epoch. */
public Builder setStartsAt(Long startsAt) {
this.startsAt = startsAt;
return this;
}
}
@Getter
public static class Address {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@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;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
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;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.EventDetails.Address build() {
return new ChargeCaptureParams.PaymentDetails.EventDetails.Address(
this.city,
this.country,
this.extraParams,
this.line1,
this.line2,
this.postalCode,
this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ChargeCaptureParams.PaymentDetails.EventDetails.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 ChargeCaptureParams.PaymentDetails.EventDetails.Address#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/** State, county, province, or region. */
public Builder setState(String state) {
this.state = state;
return this;
}
}
}
@Getter
public static class Affiliate {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
private Affiliate(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.EventDetails.Affiliate build() {
return new ChargeCaptureParams.PaymentDetails.EventDetails.Affiliate(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.EventDetails.Affiliate#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.EventDetails.Affiliate#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Required. The name of the affiliate that originated the purchase. */
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class Delivery {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 delivery method for the payment. */
@SerializedName("mode")
Mode mode;
/** Details of the recipient. */
@SerializedName("recipient")
Recipient recipient;
private Delivery(Map extraParams, Mode mode, Recipient recipient) {
this.extraParams = extraParams;
this.mode = mode;
this.recipient = recipient;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Mode mode;
private Recipient recipient;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.EventDetails.Delivery build() {
return new ChargeCaptureParams.PaymentDetails.EventDetails.Delivery(
this.extraParams, this.mode, this.recipient);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.EventDetails.Delivery#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.EventDetails.Delivery#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 delivery method for the payment. */
public Builder setMode(
ChargeCaptureParams.PaymentDetails.EventDetails.Delivery.Mode mode) {
this.mode = mode;
return this;
}
/** Details of the recipient. */
public Builder setRecipient(
ChargeCaptureParams.PaymentDetails.EventDetails.Delivery.Recipient recipient) {
this.recipient = recipient;
return this;
}
}
@Getter
public static class Recipient {
/** The email of the recipient the ticket is delivered to. */
@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 name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;
/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
private Recipient(
String email, Map extraParams, String name, String phone) {
this.email = email;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
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 ChargeCaptureParams.PaymentDetails.EventDetails.Delivery.Recipient build() {
return new ChargeCaptureParams.PaymentDetails.EventDetails.Delivery.Recipient(
this.email, this.extraParams, this.name, this.phone);
}
/** The email of the recipient the ticket is delivered to. */
public Builder setEmail(String email) {
this.email = email;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the
* original map. See {@link
* ChargeCaptureParams.PaymentDetails.EventDetails.Delivery.Recipient#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.EventDetails.Delivery.Recipient#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 recipient the ticket is delivered to. */
public Builder setName(String name) {
this.name = name;
return this;
}
/** The phone number of the recipient the ticket is delivered to. */
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
}
}
public enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("email")
EMAIL("email"),
@SerializedName("phone")
PHONE("phone"),
@SerializedName("pickup")
PICKUP("pickup"),
@SerializedName("post")
POST("post");
@Getter(onMethod_ = {@Override})
private final String value;
Mode(String value) {
this.value = value;
}
}
}
}
@Getter
public static class Flight {
/** Affiliate details for this purchase. */
@SerializedName("affiliate")
Affiliate affiliate;
/**
* The agency number (i.e. International Air Transport Association (IATA) agency number) of
* the travel agency that made the booking.
*/
@SerializedName("agency_number")
String agencyNumber;
/**
* The International Air Transport Association (IATA) carrier code of the carrier that issued
* the ticket.
*/
@SerializedName("carrier")
String carrier;
/** Delivery details for this purchase. */
@SerializedName("delivery")
Delivery delivery;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 person or entity on the reservation. */
@SerializedName("passenger_name")
String passengerName;
/** The details of the passengers in the travel reservation. */
@SerializedName("passengers")
List passengers;
/** Required. The individual flight segments associated with the trip. */
@SerializedName("segments")
List segments;
/** The ticket number associated with the travel reservation. */
@SerializedName("ticket_number")
String ticketNumber;
private Flight(
Affiliate affiliate,
String agencyNumber,
String carrier,
Delivery delivery,
Map extraParams,
String passengerName,
List passengers,
List segments,
String ticketNumber) {
this.affiliate = affiliate;
this.agencyNumber = agencyNumber;
this.carrier = carrier;
this.delivery = delivery;
this.extraParams = extraParams;
this.passengerName = passengerName;
this.passengers = passengers;
this.segments = segments;
this.ticketNumber = ticketNumber;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Affiliate affiliate;
private String agencyNumber;
private String carrier;
private Delivery delivery;
private Map extraParams;
private String passengerName;
private List passengers;
private List segments;
private String ticketNumber;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Flight build() {
return new ChargeCaptureParams.PaymentDetails.Flight(
this.affiliate,
this.agencyNumber,
this.carrier,
this.delivery,
this.extraParams,
this.passengerName,
this.passengers,
this.segments,
this.ticketNumber);
}
/** Affiliate details for this purchase. */
public Builder setAffiliate(ChargeCaptureParams.PaymentDetails.Flight.Affiliate affiliate) {
this.affiliate = affiliate;
return this;
}
/**
* The agency number (i.e. International Air Transport Association (IATA) agency number) of
* the travel agency that made the booking.
*/
public Builder setAgencyNumber(String agencyNumber) {
this.agencyNumber = agencyNumber;
return this;
}
/**
* The International Air Transport Association (IATA) carrier code of the carrier that
* issued the ticket.
*/
public Builder setCarrier(String carrier) {
this.carrier = carrier;
return this;
}
/** Delivery details for this purchase. */
public Builder setDelivery(ChargeCaptureParams.PaymentDetails.Flight.Delivery delivery) {
this.delivery = delivery;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Flight#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight#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 person or entity on the reservation. */
public Builder setPassengerName(String passengerName) {
this.passengerName = passengerName;
return this;
}
/**
* Add an element to `passengers` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Flight#passengers} for the field documentation.
*/
public Builder addPassenger(ChargeCaptureParams.PaymentDetails.Flight.Passenger element) {
if (this.passengers == null) {
this.passengers = new ArrayList<>();
}
this.passengers.add(element);
return this;
}
/**
* Add all elements to `passengers` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Flight#passengers} for the field documentation.
*/
public Builder addAllPassenger(
List elements) {
if (this.passengers == null) {
this.passengers = new ArrayList<>();
}
this.passengers.addAll(elements);
return this;
}
/**
* Add an element to `segments` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Flight#segments} for the field documentation.
*/
public Builder addSegment(ChargeCaptureParams.PaymentDetails.Flight.Segment element) {
if (this.segments == null) {
this.segments = new ArrayList<>();
}
this.segments.add(element);
return this;
}
/**
* Add all elements to `segments` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Flight#segments} for the field documentation.
*/
public Builder addAllSegment(
List elements) {
if (this.segments == null) {
this.segments = new ArrayList<>();
}
this.segments.addAll(elements);
return this;
}
/** The ticket number associated with the travel reservation. */
public Builder setTicketNumber(String ticketNumber) {
this.ticketNumber = ticketNumber;
return this;
}
}
@Getter
public static class Affiliate {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
private Affiliate(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Flight.Affiliate build() {
return new ChargeCaptureParams.PaymentDetails.Flight.Affiliate(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Flight.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Required. The name of the affiliate that originated the purchase. */
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class Delivery {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 delivery method for the payment. */
@SerializedName("mode")
Mode mode;
/** Details of the recipient. */
@SerializedName("recipient")
Recipient recipient;
private Delivery(Map extraParams, Mode mode, Recipient recipient) {
this.extraParams = extraParams;
this.mode = mode;
this.recipient = recipient;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Mode mode;
private Recipient recipient;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Flight.Delivery build() {
return new ChargeCaptureParams.PaymentDetails.Flight.Delivery(
this.extraParams, this.mode, this.recipient);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Flight.Delivery#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight.Delivery#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 delivery method for the payment. */
public Builder setMode(ChargeCaptureParams.PaymentDetails.Flight.Delivery.Mode mode) {
this.mode = mode;
return this;
}
/** Details of the recipient. */
public Builder setRecipient(
ChargeCaptureParams.PaymentDetails.Flight.Delivery.Recipient recipient) {
this.recipient = recipient;
return this;
}
}
@Getter
public static class Recipient {
/** The email of the recipient the ticket is delivered to. */
@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 name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;
/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
private Recipient(
String email, Map extraParams, String name, String phone) {
this.email = email;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
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 ChargeCaptureParams.PaymentDetails.Flight.Delivery.Recipient build() {
return new ChargeCaptureParams.PaymentDetails.Flight.Delivery.Recipient(
this.email, this.extraParams, this.name, this.phone);
}
/** The email of the recipient the ticket is delivered to. */
public Builder setEmail(String email) {
this.email = email;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the
* original map. See {@link
* ChargeCaptureParams.PaymentDetails.Flight.Delivery.Recipient#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight.Delivery.Recipient#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 recipient the ticket is delivered to. */
public Builder setName(String name) {
this.name = name;
return this;
}
/** The phone number of the recipient the ticket is delivered to. */
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
}
}
public enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("email")
EMAIL("email"),
@SerializedName("phone")
PHONE("phone"),
@SerializedName("pickup")
PICKUP("pickup"),
@SerializedName("post")
POST("post");
@Getter(onMethod_ = {@Override})
private final String value;
Mode(String value) {
this.value = value;
}
}
}
@Getter
public static class Passenger {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Required. Full name of the person or entity on the flight reservation.
*/
@SerializedName("name")
String name;
private Passenger(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Flight.Passenger build() {
return new ChargeCaptureParams.PaymentDetails.Flight.Passenger(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Flight.Passenger#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight.Passenger#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Required. Full name of the person or entity on the flight reservation.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class Segment {
/** The flight segment amount. */
@SerializedName("amount")
Long amount;
/**
* The International Air Transport Association (IATA) airport code for the arrival airport.
*/
@SerializedName("arrival_airport")
String arrivalAirport;
/** The arrival time for the flight segment. Measured in seconds since the Unix epoch. */
@SerializedName("arrives_at")
Long arrivesAt;
/**
* The International Air Transport Association (IATA) carrier code of the carrier operating
* the flight segment.
*/
@SerializedName("carrier")
String carrier;
/**
* Required. The departure time for the flight segment. Measured in seconds
* since the Unix epoch.
*/
@SerializedName("departs_at")
Long departsAt;
/**
* The International Air Transport Association (IATA) airport code for the departure
* airport.
*/
@SerializedName("departure_airport")
String departureAirport;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 flight number associated with the segment. */
@SerializedName("flight_number")
String flightNumber;
/** The fare class for the segment. */
@SerializedName("service_class")
ServiceClass serviceClass;
private Segment(
Long amount,
String arrivalAirport,
Long arrivesAt,
String carrier,
Long departsAt,
String departureAirport,
Map extraParams,
String flightNumber,
ServiceClass serviceClass) {
this.amount = amount;
this.arrivalAirport = arrivalAirport;
this.arrivesAt = arrivesAt;
this.carrier = carrier;
this.departsAt = departsAt;
this.departureAirport = departureAirport;
this.extraParams = extraParams;
this.flightNumber = flightNumber;
this.serviceClass = serviceClass;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long amount;
private String arrivalAirport;
private Long arrivesAt;
private String carrier;
private Long departsAt;
private String departureAirport;
private Map extraParams;
private String flightNumber;
private ServiceClass serviceClass;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Flight.Segment build() {
return new ChargeCaptureParams.PaymentDetails.Flight.Segment(
this.amount,
this.arrivalAirport,
this.arrivesAt,
this.carrier,
this.departsAt,
this.departureAirport,
this.extraParams,
this.flightNumber,
this.serviceClass);
}
/** The flight segment amount. */
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}
/**
* The International Air Transport Association (IATA) airport code for the arrival
* airport.
*/
public Builder setArrivalAirport(String arrivalAirport) {
this.arrivalAirport = arrivalAirport;
return this;
}
/** The arrival time for the flight segment. Measured in seconds since the Unix epoch. */
public Builder setArrivesAt(Long arrivesAt) {
this.arrivesAt = arrivesAt;
return this;
}
/**
* The International Air Transport Association (IATA) carrier code of the carrier
* operating the flight segment.
*/
public Builder setCarrier(String carrier) {
this.carrier = carrier;
return this;
}
/**
* Required. The departure time for the flight segment. Measured in
* seconds since the Unix epoch.
*/
public Builder setDepartsAt(Long departsAt) {
this.departsAt = departsAt;
return this;
}
/**
* The International Air Transport Association (IATA) airport code for the departure
* airport.
*/
public Builder setDepartureAirport(String departureAirport) {
this.departureAirport = departureAirport;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Flight.Segment#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Flight.Segment#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 flight number associated with the segment. */
public Builder setFlightNumber(String flightNumber) {
this.flightNumber = flightNumber;
return this;
}
/** The fare class for the segment. */
public Builder setServiceClass(
ChargeCaptureParams.PaymentDetails.Flight.Segment.ServiceClass serviceClass) {
this.serviceClass = serviceClass;
return this;
}
}
public enum ServiceClass implements ApiRequestParams.EnumParam {
@SerializedName("business")
BUSINESS("business"),
@SerializedName("economy")
ECONOMY("economy"),
@SerializedName("first")
FIRST("first"),
@SerializedName("premium_economy")
PREMIUM_ECONOMY("premium_economy");
@Getter(onMethod_ = {@Override})
private final String value;
ServiceClass(String value) {
this.value = value;
}
}
}
}
@Getter
public static class Lodging {
/** The lodging location's address. */
@SerializedName("address")
Address address;
/** The number of adults on the booking. */
@SerializedName("adults")
Long adults;
/** Affiliate details for this purchase. */
@SerializedName("affiliate")
Affiliate affiliate;
/** The booking number associated with the lodging reservation. */
@SerializedName("booking_number")
String bookingNumber;
/** The lodging category. */
@SerializedName("category")
Category category;
/**
* Required. Loding check-in time. Measured in seconds since the Unix epoch.
*/
@SerializedName("checkin_at")
Long checkinAt;
/**
* Required. Lodging check-out time. Measured in seconds since the Unix
* epoch.
*/
@SerializedName("checkout_at")
Long checkoutAt;
/** The customer service phone number of the lodging company. */
@SerializedName("customer_service_phone_number")
String customerServicePhoneNumber;
/** The daily lodging room rate. */
@SerializedName("daily_room_rate_amount")
Long dailyRoomRateAmount;
/** Delivery details for this purchase. */
@SerializedName("delivery")
Delivery delivery;
/** List of additional charges being billed. */
@SerializedName("extra_charges")
List extraCharges;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 whether the lodging location is compliant with the Fire Safety Act. */
@SerializedName("fire_safety_act_compliance")
Boolean fireSafetyActCompliance;
/** The name of the lodging location. */
@SerializedName("name")
String name;
/**
* Indicates if the customer did not keep their booking while failing to cancel the
* reservation.
*/
@SerializedName("no_show")
Boolean noShow;
/** The number of rooms on the booking. */
@SerializedName("number_of_rooms")
Long numberOfRooms;
/** The details of the passengers in the travel reservation. */
@SerializedName("passengers")
List passengers;
/** The phone number of the lodging location. */
@SerializedName("property_phone_number")
String propertyPhoneNumber;
/** The room class for this purchase. */
@SerializedName("room_class")
String roomClass;
/** The number of room nights. */
@SerializedName("room_nights")
Long roomNights;
/** The total tax amount associating with the room reservation. */
@SerializedName("total_room_tax_amount")
Long totalRoomTaxAmount;
/** The total tax amount. */
@SerializedName("total_tax_amount")
Long totalTaxAmount;
private Lodging(
Address address,
Long adults,
Affiliate affiliate,
String bookingNumber,
Category category,
Long checkinAt,
Long checkoutAt,
String customerServicePhoneNumber,
Long dailyRoomRateAmount,
Delivery delivery,
List extraCharges,
Map extraParams,
Boolean fireSafetyActCompliance,
String name,
Boolean noShow,
Long numberOfRooms,
List passengers,
String propertyPhoneNumber,
String roomClass,
Long roomNights,
Long totalRoomTaxAmount,
Long totalTaxAmount) {
this.address = address;
this.adults = adults;
this.affiliate = affiliate;
this.bookingNumber = bookingNumber;
this.category = category;
this.checkinAt = checkinAt;
this.checkoutAt = checkoutAt;
this.customerServicePhoneNumber = customerServicePhoneNumber;
this.dailyRoomRateAmount = dailyRoomRateAmount;
this.delivery = delivery;
this.extraCharges = extraCharges;
this.extraParams = extraParams;
this.fireSafetyActCompliance = fireSafetyActCompliance;
this.name = name;
this.noShow = noShow;
this.numberOfRooms = numberOfRooms;
this.passengers = passengers;
this.propertyPhoneNumber = propertyPhoneNumber;
this.roomClass = roomClass;
this.roomNights = roomNights;
this.totalRoomTaxAmount = totalRoomTaxAmount;
this.totalTaxAmount = totalTaxAmount;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Address address;
private Long adults;
private Affiliate affiliate;
private String bookingNumber;
private Category category;
private Long checkinAt;
private Long checkoutAt;
private String customerServicePhoneNumber;
private Long dailyRoomRateAmount;
private Delivery delivery;
private List extraCharges;
private Map extraParams;
private Boolean fireSafetyActCompliance;
private String name;
private Boolean noShow;
private Long numberOfRooms;
private List passengers;
private String propertyPhoneNumber;
private String roomClass;
private Long roomNights;
private Long totalRoomTaxAmount;
private Long totalTaxAmount;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Lodging build() {
return new ChargeCaptureParams.PaymentDetails.Lodging(
this.address,
this.adults,
this.affiliate,
this.bookingNumber,
this.category,
this.checkinAt,
this.checkoutAt,
this.customerServicePhoneNumber,
this.dailyRoomRateAmount,
this.delivery,
this.extraCharges,
this.extraParams,
this.fireSafetyActCompliance,
this.name,
this.noShow,
this.numberOfRooms,
this.passengers,
this.propertyPhoneNumber,
this.roomClass,
this.roomNights,
this.totalRoomTaxAmount,
this.totalTaxAmount);
}
/** The lodging location's address. */
public Builder setAddress(ChargeCaptureParams.PaymentDetails.Lodging.Address address) {
this.address = address;
return this;
}
/** The number of adults on the booking. */
public Builder setAdults(Long adults) {
this.adults = adults;
return this;
}
/** Affiliate details for this purchase. */
public Builder setAffiliate(
ChargeCaptureParams.PaymentDetails.Lodging.Affiliate affiliate) {
this.affiliate = affiliate;
return this;
}
/** The booking number associated with the lodging reservation. */
public Builder setBookingNumber(String bookingNumber) {
this.bookingNumber = bookingNumber;
return this;
}
/** The lodging category. */
public Builder setCategory(ChargeCaptureParams.PaymentDetails.Lodging.Category category) {
this.category = category;
return this;
}
/**
* Required. Loding check-in time. Measured in seconds since the Unix
* epoch.
*/
public Builder setCheckinAt(Long checkinAt) {
this.checkinAt = checkinAt;
return this;
}
/**
* Required. Lodging check-out time. Measured in seconds since the Unix
* epoch.
*/
public Builder setCheckoutAt(Long checkoutAt) {
this.checkoutAt = checkoutAt;
return this;
}
/** The customer service phone number of the lodging company. */
public Builder setCustomerServicePhoneNumber(String customerServicePhoneNumber) {
this.customerServicePhoneNumber = customerServicePhoneNumber;
return this;
}
/** The daily lodging room rate. */
public Builder setDailyRoomRateAmount(Long dailyRoomRateAmount) {
this.dailyRoomRateAmount = dailyRoomRateAmount;
return this;
}
/** Delivery details for this purchase. */
public Builder setDelivery(ChargeCaptureParams.PaymentDetails.Lodging.Delivery delivery) {
this.delivery = delivery;
return this;
}
/**
* Add an element to `extraCharges` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Lodging#extraCharges} for the field documentation.
*/
public Builder addExtraCharge(
ChargeCaptureParams.PaymentDetails.Lodging.ExtraCharge element) {
if (this.extraCharges == null) {
this.extraCharges = new ArrayList<>();
}
this.extraCharges.add(element);
return this;
}
/**
* Add all elements to `extraCharges` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Lodging#extraCharges} for the field documentation.
*/
public Builder addAllExtraCharge(
List elements) {
if (this.extraCharges == null) {
this.extraCharges = new ArrayList<>();
}
this.extraCharges.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 ChargeCaptureParams.PaymentDetails.Lodging#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Lodging#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 whether the lodging location is compliant with the Fire Safety Act. */
public Builder setFireSafetyActCompliance(Boolean fireSafetyActCompliance) {
this.fireSafetyActCompliance = fireSafetyActCompliance;
return this;
}
/** The name of the lodging location. */
public Builder setName(String name) {
this.name = name;
return this;
}
/**
* Indicates if the customer did not keep their booking while failing to cancel the
* reservation.
*/
public Builder setNoShow(Boolean noShow) {
this.noShow = noShow;
return this;
}
/** The number of rooms on the booking. */
public Builder setNumberOfRooms(Long numberOfRooms) {
this.numberOfRooms = numberOfRooms;
return this;
}
/**
* Add an element to `passengers` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Lodging#passengers} for the field documentation.
*/
public Builder addPassenger(ChargeCaptureParams.PaymentDetails.Lodging.Passenger element) {
if (this.passengers == null) {
this.passengers = new ArrayList<>();
}
this.passengers.add(element);
return this;
}
/**
* Add all elements to `passengers` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ChargeCaptureParams.PaymentDetails.Lodging#passengers} for the field documentation.
*/
public Builder addAllPassenger(
List elements) {
if (this.passengers == null) {
this.passengers = new ArrayList<>();
}
this.passengers.addAll(elements);
return this;
}
/** The phone number of the lodging location. */
public Builder setPropertyPhoneNumber(String propertyPhoneNumber) {
this.propertyPhoneNumber = propertyPhoneNumber;
return this;
}
/** The room class for this purchase. */
public Builder setRoomClass(String roomClass) {
this.roomClass = roomClass;
return this;
}
/** The number of room nights. */
public Builder setRoomNights(Long roomNights) {
this.roomNights = roomNights;
return this;
}
/** The total tax amount associating with the room reservation. */
public Builder setTotalRoomTaxAmount(Long totalRoomTaxAmount) {
this.totalRoomTaxAmount = totalRoomTaxAmount;
return this;
}
/** The total tax amount. */
public Builder setTotalTaxAmount(Long totalTaxAmount) {
this.totalTaxAmount = totalTaxAmount;
return this;
}
}
@Getter
public static class Address {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@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;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
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;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Lodging.Address build() {
return new ChargeCaptureParams.PaymentDetails.Lodging.Address(
this.city,
this.country,
this.extraParams,
this.line1,
this.line2,
this.postalCode,
this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ChargeCaptureParams.PaymentDetails.Lodging.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 ChargeCaptureParams.PaymentDetails.Lodging.Address#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/** State, county, province, or region. */
public Builder setState(String state) {
this.state = state;
return this;
}
}
}
@Getter
public static class Affiliate {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
private Affiliate(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Lodging.Affiliate build() {
return new ChargeCaptureParams.PaymentDetails.Lodging.Affiliate(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Lodging.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Lodging.Affiliate#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Required. The name of the affiliate that originated the purchase. */
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class Delivery {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 delivery method for the payment. */
@SerializedName("mode")
Mode mode;
/** Details of the recipient. */
@SerializedName("recipient")
Recipient recipient;
private Delivery(Map extraParams, Mode mode, Recipient recipient) {
this.extraParams = extraParams;
this.mode = mode;
this.recipient = recipient;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Mode mode;
private Recipient recipient;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Lodging.Delivery build() {
return new ChargeCaptureParams.PaymentDetails.Lodging.Delivery(
this.extraParams, this.mode, this.recipient);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Lodging.Delivery#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Lodging.Delivery#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 delivery method for the payment. */
public Builder setMode(ChargeCaptureParams.PaymentDetails.Lodging.Delivery.Mode mode) {
this.mode = mode;
return this;
}
/** Details of the recipient. */
public Builder setRecipient(
ChargeCaptureParams.PaymentDetails.Lodging.Delivery.Recipient recipient) {
this.recipient = recipient;
return this;
}
}
@Getter
public static class Recipient {
/** The email of the recipient the ticket is delivered to. */
@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 name of the recipient the ticket is delivered to. */
@SerializedName("name")
String name;
/** The phone number of the recipient the ticket is delivered to. */
@SerializedName("phone")
String phone;
private Recipient(
String email, Map extraParams, String name, String phone) {
this.email = email;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
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 ChargeCaptureParams.PaymentDetails.Lodging.Delivery.Recipient build() {
return new ChargeCaptureParams.PaymentDetails.Lodging.Delivery.Recipient(
this.email, this.extraParams, this.name, this.phone);
}
/** The email of the recipient the ticket is delivered to. */
public Builder setEmail(String email) {
this.email = email;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the
* original map. See {@link
* ChargeCaptureParams.PaymentDetails.Lodging.Delivery.Recipient#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Lodging.Delivery.Recipient#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 recipient the ticket is delivered to. */
public Builder setName(String name) {
this.name = name;
return this;
}
/** The phone number of the recipient the ticket is delivered to. */
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
}
}
public enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("email")
EMAIL("email"),
@SerializedName("phone")
PHONE("phone"),
@SerializedName("pickup")
PICKUP("pickup"),
@SerializedName("post")
POST("post");
@Getter(onMethod_ = {@Override})
private final String value;
Mode(String value) {
this.value = value;
}
}
}
@Getter
public static class Passenger {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Required. Full name of the person or entity on the lodging reservation.
*/
@SerializedName("name")
String name;
private Passenger(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Lodging.Passenger build() {
return new ChargeCaptureParams.PaymentDetails.Lodging.Passenger(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Lodging.Passenger#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Lodging.Passenger#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Required. Full name of the person or entity on the lodging
* reservation.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
public enum Category implements ApiRequestParams.EnumParam {
@SerializedName("hotel")
HOTEL("hotel"),
@SerializedName("vacation_rental")
VACATION_RENTAL("vacation_rental");
@Getter(onMethod_ = {@Override})
private final String value;
Category(String value) {
this.value = value;
}
}
public enum ExtraCharge implements ApiRequestParams.EnumParam {
@SerializedName("gift_shop")
GIFT_SHOP("gift_shop"),
@SerializedName("laundry")
LAUNDRY("laundry"),
@SerializedName("mini_bar")
MINI_BAR("mini_bar"),
@SerializedName("other")
OTHER("other"),
@SerializedName("restaurant")
RESTAURANT("restaurant"),
@SerializedName("telephone")
TELEPHONE("telephone");
@Getter(onMethod_ = {@Override})
private final String value;
ExtraCharge(String value) {
this.value = value;
}
}
}
@Getter
public static class Subscription {
/** Affiliate details for this purchase. */
@SerializedName("affiliate")
Affiliate affiliate;
/** Info whether the subscription will be auto renewed upon expiry. */
@SerializedName("auto_renewal")
Boolean autoRenewal;
/** Subscription billing details for this purchase. */
@SerializedName("billing_interval")
BillingInterval billingInterval;
/** Subscription end time. Measured in seconds since the Unix epoch. */
@SerializedName("ends_at")
Long endsAt;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Required. Name of the product on subscription. e.g. Apple Music
* Subscription
*/
@SerializedName("name")
String name;
/** Subscription start time. Measured in seconds since the Unix epoch. */
@SerializedName("starts_at")
Long startsAt;
private Subscription(
Affiliate affiliate,
Boolean autoRenewal,
BillingInterval billingInterval,
Long endsAt,
Map extraParams,
String name,
Long startsAt) {
this.affiliate = affiliate;
this.autoRenewal = autoRenewal;
this.billingInterval = billingInterval;
this.endsAt = endsAt;
this.extraParams = extraParams;
this.name = name;
this.startsAt = startsAt;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Affiliate affiliate;
private Boolean autoRenewal;
private BillingInterval billingInterval;
private Long endsAt;
private Map extraParams;
private String name;
private Long startsAt;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Subscription build() {
return new ChargeCaptureParams.PaymentDetails.Subscription(
this.affiliate,
this.autoRenewal,
this.billingInterval,
this.endsAt,
this.extraParams,
this.name,
this.startsAt);
}
/** Affiliate details for this purchase. */
public Builder setAffiliate(
ChargeCaptureParams.PaymentDetails.Subscription.Affiliate affiliate) {
this.affiliate = affiliate;
return this;
}
/** Info whether the subscription will be auto renewed upon expiry. */
public Builder setAutoRenewal(Boolean autoRenewal) {
this.autoRenewal = autoRenewal;
return this;
}
/** Subscription billing details for this purchase. */
public Builder setBillingInterval(
ChargeCaptureParams.PaymentDetails.Subscription.BillingInterval billingInterval) {
this.billingInterval = billingInterval;
return this;
}
/** Subscription end time. Measured in seconds since the Unix epoch. */
public Builder setEndsAt(Long endsAt) {
this.endsAt = endsAt;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Subscription#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Subscription#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Required. Name of the product on subscription. e.g. Apple Music
* Subscription
*/
public Builder setName(String name) {
this.name = name;
return this;
}
/** Subscription start time. Measured in seconds since the Unix epoch. */
public Builder setStartsAt(Long startsAt) {
this.startsAt = startsAt;
return this;
}
}
@Getter
public static class Affiliate {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Required. The name of the affiliate that originated the purchase. */
@SerializedName("name")
String name;
private Affiliate(Map extraParams, String name) {
this.extraParams = extraParams;
this.name = name;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String name;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Subscription.Affiliate build() {
return new ChargeCaptureParams.PaymentDetails.Subscription.Affiliate(
this.extraParams, this.name);
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Subscription.Affiliate#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Subscription.Affiliate#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Required. The name of the affiliate that originated the purchase. */
public Builder setName(String name) {
this.name = name;
return this;
}
}
}
@Getter
public static class BillingInterval {
/**
* Required. The number of intervals, as an whole number greater than 0.
* Stripe multiplies this by the interval type to get the overall duration.
*/
@SerializedName("count")
Long count;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Required. Specifies a type of interval unit. Either {@code day}, {@code
* week}, {@code month} or {@code year}.
*/
@SerializedName("interval")
Interval interval;
private BillingInterval(Long count, Map extraParams, Interval interval) {
this.count = count;
this.extraParams = extraParams;
this.interval = interval;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long count;
private Map extraParams;
private Interval interval;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.PaymentDetails.Subscription.BillingInterval build() {
return new ChargeCaptureParams.PaymentDetails.Subscription.BillingInterval(
this.count, this.extraParams, this.interval);
}
/**
* Required. The number of intervals, as an whole number greater than 0.
* Stripe multiplies this by the interval type to get the overall duration.
*/
public Builder setCount(Long count) {
this.count = count;
return this;
}
/**
* Add a key/value pair to `extraParams` map. 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.PaymentDetails.Subscription.BillingInterval#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. 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.PaymentDetails.Subscription.BillingInterval#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Required. Specifies a type of interval unit. Either {@code day},
* {@code week}, {@code month} or {@code year}.
*/
public Builder setInterval(
ChargeCaptureParams.PaymentDetails.Subscription.BillingInterval.Interval interval) {
this.interval = interval;
return this;
}
}
public enum Interval implements ApiRequestParams.EnumParam {
@SerializedName("day")
DAY("day"),
@SerializedName("month")
MONTH("month"),
@SerializedName("week")
WEEK("week"),
@SerializedName("year")
YEAR("year");
@Getter(onMethod_ = {@Override})
private final String value;
Interval(String value) {
this.value = value;
}
}
}
}
}
@Getter
public static class TransferData {
/**
* The amount transferred to the destination account, if specified. By default, the entire
* charge amount is transferred to the destination account.
*/
@SerializedName("amount")
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() {
return new Builder();
}
public static class Builder {
private Long amount;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public ChargeCaptureParams.TransferData build() {
return new ChargeCaptureParams.TransferData(this.amount, this.extraParams);
}
/**
* The amount transferred to the destination account, if specified. By default, the entire
* charge amount is transferred to the destination account.
*/
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;
}
}
}
}