com.withabound.resources.AccessTokens Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of withabound-java Show documentation
Show all versions of withabound-java Show documentation
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);
}
}