it.netgrid.woocommerce.jersey.crud.ProductAttributeCrudService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwcrc Show documentation
Show all versions of jwcrc Show documentation
JWCRC provides a client for the Woocommerce API v1. (2.6.x)
package it.netgrid.woocommerce.jersey.crud;
import javax.ws.rs.client.WebTarget;
import it.netgrid.woocommerce.model.ProductAttribute;
import it.netgrid.woocommerce.model.request.ProductAttributeRequest;
public class ProductAttributeCrudService extends TemplateCrudService {
public static final String BASE_PATH = "products/attributes";
public static final String BASE_PATH_FORMAT = "products/attributes/%d";
public ProductAttributeCrudService(WebTarget target) {
super(target);
}
@Override
public String getCreatePath(Object context) {
return BASE_PATH;
}
@Override
public String getReadPath(Integer id, Object context) {
return String.format(BASE_PATH_FORMAT, id);
}
@Override
public String getUpdatePath(Integer id, Object context) {
return String.format(BASE_PATH_FORMAT, id);
}
@Override
public String getDeletePath(Integer id, Object context) {
return String.format(BASE_PATH_FORMAT, id);
}
@Override
public Class getResponseClass() {
return ProductAttribute.class;
}
@Override
public ProductAttributeRequest getRequest(ProductAttribute object) {
return new ProductAttributeRequest(object);
}
@Override
public ProductAttribute getResult(ProductAttribute network) {
return network;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy