diff --git a/src/main/java/com/gocardless/services/MandateService.java b/src/main/java/com/gocardless/services/MandateService.java index a535a148..d15d554d 100644 --- a/src/main/java/com/gocardless/services/MandateService.java +++ b/src/main/java/com/gocardless/services/MandateService.java @@ -302,6 +302,7 @@ public static final class MandateListRequest extends ListRequest private String creditor; private String customer; private String customerBankAccount; + private List include; private String mandateType; private String reference; private List scheme; @@ -406,6 +407,27 @@ public MandateListRequest withCustomerBankAccount(String customerBankAccount) return this; } + /** + * Includes linked resources in the response. Use customer to embed customer + * details, or bank_account to embed bank account details. + */ + public MandateListRequest withInclude(List include) { + this.include = include; + return this; + } + + /** + * Includes linked resources in the response. Use customer to embed customer + * details, or bank_account to embed bank account details. + */ + public MandateListRequest withInclude(String include) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(include); + return this; + } + /** * Number of records to return. */ @@ -497,6 +519,9 @@ protected Map getQueryParams() { if (customerBankAccount != null) { params.put("customer_bank_account", customerBankAccount); } + if (include != null) { + params.put("include", Joiner.on(",").join(include)); + } if (mandateType != null) { params.put("mandate_type", mandateType); }