jp.gopay.sdk.builders.bankaccount.BankAccountsBuilders Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gopay-java-sdk Show documentation
Show all versions of gopay-java-sdk Show documentation
Official Gyro-n Payments Java SDK
package jp.gopay.sdk.builders.bankaccount;
import jp.gopay.sdk.builders.bankaccount.AbstractBankAccountsBuilders.*;
import jp.gopay.sdk.models.common.BankAccountId;
import jp.gopay.sdk.models.common.Void;
import jp.gopay.sdk.models.common.bankaccounts.BaseBankAccount;
import jp.gopay.sdk.models.request.bankaccount.BankAccountPatchData;
import jp.gopay.sdk.models.response.PaginatedList;
import jp.gopay.sdk.models.response.bankaccount.BankAccount;
import jp.gopay.sdk.resources.BankAccountsResource;
import retrofit2.Call;
import retrofit2.Retrofit;
public abstract class BankAccountsBuilders {
public static class CreateBankAccountRequestBuilder
extends AbstractCreateBankAccountRequestBuilder{
public CreateBankAccountRequestBuilder(Retrofit retrofit, BaseBankAccount bankAccount) {
super(retrofit, bankAccount);
}
@Override
protected Call getRequest(BankAccountsResource resource) {
return resource.create(bankAccount, idempotencyKey);
}
}
public static class DeleteBankAccountRequestBuilder
extends AbstractDeleteBankAccountRequestBuilder{
public DeleteBankAccountRequestBuilder(Retrofit retrofit, BankAccountId bankAccountId) {
super(retrofit, bankAccountId);
}
@Override
protected Call getRequest(BankAccountsResource resource) {
return resource.delete(bankAccountId);
}
}
public static class GetBankAccountRequestBuilder
extends AbstractGetBankAccountRequestBuilder{
public GetBankAccountRequestBuilder(Retrofit retrofit, BankAccountId bankAccountId) {
super(retrofit, bankAccountId);
}
@Override
protected Call getRequest(BankAccountsResource resource) {
return resource.get(bankAccountId);
}
}
public static class ListAllBankAccountsRequestBuilder
extends AbstractListAllBankAccountsRequestBuilder{
public ListAllBankAccountsRequestBuilder(Retrofit retrofit) {
super(retrofit);
}
@Override
protected Call> getRequest(BankAccountsResource resource) {
return resource.list(getLimit(), getCursorDirection(), getCursor());
}
}
public static class GetPrimaryBankAccountRequestBuilder
extends AbstractGetPrimaryBankAccountRequestBuilder{
public GetPrimaryBankAccountRequestBuilder(Retrofit retrofit) {
super(retrofit);
}
@Override
protected Call getRequest(BankAccountsResource resource) {
return resource.getPrimary();
}
}
public static class UpdateBankAccountRequestBuilder
extends AbstractUpdateBankAccountRequestBuilder{
public UpdateBankAccountRequestBuilder(Retrofit retrofit, BankAccountId bankAccountId) {
super(retrofit, bankAccountId);
}
@Override
protected Call getRequest(BankAccountsResource resource) {
return resource.update(bankAccountId,
new BankAccountPatchData(isPrimary, holderName, bankName, branchName, bankAddress, currency, accountNumber, swiftCode, routingNumber), idempotencyKey);
}
}
}