Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.scayle.adminapi.service.BrandService Maven / Gradle / Ivy
package com.scayle.adminapi.service;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import com.scayle.adminapi.exception.ApiErrorException;
import com.scayle.adminapi.exception.ConnectionException;
import com.scayle.adminapi.http.HttpClient;
import com.scayle.adminapi.model.*;
@SuppressWarnings("unchecked")
public class BrandService extends AbstractService {
public BrandService(HttpClient httpClient) {
super(httpClient);
}
public ApiCollection all() throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
return this.requestCollection("get", this.resolvePath("/brands"), null, null, responseModel);
}
public ApiCollection all(ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
Map query = options.all();
return this.requestCollection("get", this.resolvePath("/brands"), query, null, responseModel);
}
public Brand get(Integer brandId) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
return this.request("get", this.resolvePath("/brands/%s", brandId), null, null, responseModel);
}
public Brand get(Integer brandId, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
Map query = options.all();
return this.request("get", this.resolvePath("/brands/%s", brandId), query, null, responseModel);
}
public Brand create(Brand model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
return this.request("post", this.resolvePath("/brands"), null, null, responseModel, model);
}
public Brand create(Brand model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
Map query = options.all();
return this.request("post", this.resolvePath("/brands"), query, null, responseModel, model);
}
public Brand update(Integer brandId, Brand model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
return this.request("put", this.resolvePath("/brands/%s", brandId), null, null, responseModel, model);
}
public Brand update(Integer brandId, Brand model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Brand.class;
Map query = options.all();
return this.request("put", this.resolvePath("/brands/%s", brandId), query, null, responseModel, model);
}
public void delete(Integer brandId) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/brands/%s", brandId), null, null, null);
}
public void delete(Integer brandId, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/brands/%s", brandId), query, null, null);
}
public Map createOrUpdateCustomData(Integer brandId, Map model) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
return this.request("put", this.resolvePath("/brands/%s/custom-data", brandId), null, null, responseModel, model);
}
public Map createOrUpdateCustomData(Integer brandId, Map model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
Map query = options.all();
return this.request("put", this.resolvePath("/brands/%s/custom-data", brandId), query, null, responseModel, model);
}
public void deleteCustomData(Integer brandId) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/brands/%s/custom-data", brandId), null, null, null);
}
public void deleteCustomData(Integer brandId, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/brands/%s/custom-data", brandId), query, null, null);
}
public Map getCustomData(Integer brandId) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
return this.request("get", this.resolvePath("/brands/%s/custom-data", brandId), null, null, responseModel);
}
public Map getCustomData(Integer brandId, ApiOptions options) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
Map query = options.all();
return this.request("get", this.resolvePath("/brands/%s/custom-data", brandId), query, null, responseModel);
}
public Map createOrUpdateCustomDataForKey(Integer brandId, String key, Map model) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
return this.request("put", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), null, null, responseModel, model);
}
public Map createOrUpdateCustomDataForKey(Integer brandId, String key, Map model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
Map query = options.all();
return this.request("put", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), query, null, responseModel, model);
}
public void deleteCustomDataForKey(Integer brandId, String key) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), null, null, null);
}
public void deleteCustomDataForKey(Integer brandId, String key, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), query, null, null);
}
public Map getCustomDataForKey(Integer brandId, String key) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
return this.request("get", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), null, null, responseModel);
}
public Map getCustomDataForKey(Integer brandId, String key, ApiOptions options) throws ApiErrorException, ConnectionException {
Class> responseModel = (Class>)(Class>)Map.class;
Map query = options.all();
return this.request("get", this.resolvePath("/brands/%s/custom-data/%s", brandId, key), query, null, responseModel);
}
}