All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.withabound.resources.Payers Maven / Gradle / Ivy

Go to download

The Abound Java SDK provides convenient access to the Abound API from applications written in Java.

The newest version!
package com.withabound.resources;

import com.withabound.AboundConfig;
import com.withabound.models.payers.Payer;
import com.withabound.models.payers.PayerParams;
import com.withabound.models.payers.PayerRequest;
import com.withabound.resources.base.AboundBaseResource;
import com.withabound.resources.base.AboundBulkResponse;
import com.withabound.resources.base.AboundResponse;
import com.withabound.resources.base.EmptyJsonObject;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import okhttp3.OkHttpClient;

/** See https://docs.withabound.com/reference/payers */
public class Payers extends AboundBaseResource {
  public Payers(final AboundConfig aboundConfig, final OkHttpClient httpClient) {
    super(aboundConfig, httpClient, Payer.class);
  }

  @Override
  protected String getPath() {
    return "/payers";
  }

  public AboundBulkResponse create(final List toCreate) throws IOException {
    final Map> requestBody =
        Collections.singletonMap("payers", toCreate);

    return super.bulkCreate(requestBody);
  }

  @Override
  public AboundBulkResponse list() throws IOException {
    return super.list();
  }

  public AboundBulkResponse list(final PayerParams params) throws IOException {
    return super.list(params);
  }

  @Override
  public AboundResponse retrieve(final String payerId) throws IOException {
    return super.retrieve(payerId);
  }

  public AboundResponse update(final String payerId, final PayerRequest toUpdate)
      throws IOException {
    final Map requestBody = Collections.singletonMap("payer", toUpdate);

    return super.update(payerId, requestBody);
  }

  @Override
  public AboundResponse delete(final String payerId) throws IOException {
    return super.delete(payerId);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy