
com.mangopay.core.APIs.implementation.HookApiImpl Maven / Gradle / Ivy
package com.mangopay.core.APIs.implementation;
import com.mangopay.MangoPayApi;
import com.mangopay.core.APIs.ApiBase;
import com.mangopay.core.APIs.HookApi;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.entities.Hook;
import java.util.List;
/**
* API for hooks.
*/
public class HookApiImpl extends ApiBase implements HookApi {
/**
* Instantiates new HookApiImpl object.
* @param root Root/parent instance that holds the OAuthToken and Configuration instance.
*/
public HookApiImpl(MangoPayApi root) {
super(root);
}
@Override
public Hook create(Hook hook) throws Exception {
return this.create(null, hook);
}
@Override
public Hook create(String idempotencyKey, Hook hook) throws Exception {
return this.createObject(Hook.class, idempotencyKey, "hooks_create", hook);
}
@Override
public Hook get(String hookId) throws Exception {
return this.getObject(Hook.class, "hooks_get", hookId);
}
@Override
public Hook update(Hook hook) throws Exception {
return this.updateObject(Hook.class, "hooks_save", hook);
}
@Override
public List getAll(Pagination pagination, Sorting sorting) throws Exception {
return this.getList(Hook[].class, Hook.class, "hooks_all", pagination, sorting);
}
@Override
public List getAll() throws Exception {
return this.getAll(null, null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy