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.MasterService 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 MasterService extends AbstractService {
public MasterService(HttpClient httpClient) {
super(httpClient);
}
public ProductMasterCategories updateProductMasterMasterCategories(Identifier productMasterIdentifier, ProductMasterCategories model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductMasterCategories.class;
return this.request("put", this.resolvePath("/product-masters/%s/master-categories", productMasterIdentifier), null, null, responseModel, model);
}
public ProductMasterCategories updateProductMasterMasterCategories(Identifier productMasterIdentifier, ProductMasterCategories model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductMasterCategories.class;
Map query = options.all();
return this.request("put", this.resolvePath("/product-masters/%s/master-categories", productMasterIdentifier), query, null, responseModel, model);
}
public ApiCollection allAttributes(Identifier productMasterIdentifier) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.requestCollection("get", this.resolvePath("/product-masters/%s/attributes", productMasterIdentifier), null, null, responseModel);
}
public ApiCollection allAttributes(Identifier productMasterIdentifier, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.requestCollection("get", this.resolvePath("/product-masters/%s/attributes", productMasterIdentifier), query, null, responseModel);
}
public Attribute updateOrCreateAttribute(Identifier productMasterIdentifier, Attribute model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.request("post", this.resolvePath("/product-masters/%s/attributes", productMasterIdentifier), null, null, responseModel, model);
}
public Attribute updateOrCreateAttribute(Identifier productMasterIdentifier, Attribute model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.request("post", this.resolvePath("/product-masters/%s/attributes", productMasterIdentifier), query, null, responseModel, model);
}
public Attribute getAttribute(Identifier productMasterIdentifier, String attributeGroupName) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.request("get", this.resolvePath("/product-masters/%s/attributes/%s", productMasterIdentifier, attributeGroupName), null, null, responseModel);
}
public Attribute getAttribute(Identifier productMasterIdentifier, String attributeGroupName, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.request("get", this.resolvePath("/product-masters/%s/attributes/%s", productMasterIdentifier, attributeGroupName), query, null, responseModel);
}
public void deleteAttribute(Identifier productMasterIdentifier, String attributeGroupName) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/product-masters/%s/attributes/%s", productMasterIdentifier, attributeGroupName), null, null, null);
}
public void deleteAttribute(Identifier productMasterIdentifier, String attributeGroupName, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/product-masters/%s/attributes/%s", productMasterIdentifier, attributeGroupName), query, null, null);
}
}