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

com.withabound.resources.AccessTokens 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.access_tokens.AccessToken;
import com.withabound.models.access_tokens.AccessTokenRequest;
import com.withabound.resources.base.AboundBaseResource;
import com.withabound.resources.base.AboundResponse;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import okhttp3.OkHttpClient;

/** See https://docs.withabound.com/reference/access-tokens */
public class AccessTokens extends AboundBaseResource {
  @Override
  protected String getPath() {
    return "/accessTokens";
  }

  public AccessTokens(final AboundConfig aboundConfig, final OkHttpClient httpClient) {
    super(aboundConfig, httpClient, AccessToken.class);
  }

  public AboundResponse create(final AccessTokenRequest toCreate) throws IOException {
    final Map requestPayload =
        Collections.singletonMap("accessToken", toCreate);

    return super.create(requestPayload);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy