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.ProductImageService 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 ProductImageService extends AbstractService {
public ProductImageService(HttpClient httpClient) {
super(httpClient);
}
public ProductImage create(Identifier productIdentifier, ProductImage model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
return this.request("post", this.resolvePath("/products/%s/images", productIdentifier), null, null, responseModel, model);
}
public ProductImage create(Identifier productIdentifier, ProductImage model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
Map query = options.all();
return this.request("post", this.resolvePath("/products/%s/images", productIdentifier), query, null, responseModel, model);
}
public ApiCollection all(Identifier productIdentifier) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
return this.requestCollection("get", this.resolvePath("/products/%s/images", productIdentifier), null, null, responseModel);
}
public ApiCollection all(Identifier productIdentifier, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
Map query = options.all();
return this.requestCollection("get", this.resolvePath("/products/%s/images", productIdentifier), query, null, responseModel);
}
public ProductImage updatePosition(Identifier productIdentifier, Identifier imageIdentifier, ProductImagePosition model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
return this.request("patch", this.resolvePath("/products/%s/images/%s", productIdentifier, imageIdentifier), null, null, responseModel, model);
}
public ProductImage updatePosition(Identifier productIdentifier, Identifier imageIdentifier, ProductImagePosition model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)ProductImage.class;
Map query = options.all();
return this.request("patch", this.resolvePath("/products/%s/images/%s", productIdentifier, imageIdentifier), query, null, responseModel, model);
}
public void delete(Identifier productIdentifier, Identifier imageIdentifier) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/products/%s/images/%s", productIdentifier, imageIdentifier), null, null, null);
}
public void delete(Identifier productIdentifier, Identifier imageIdentifier, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/products/%s/images/%s", productIdentifier, imageIdentifier), query, null, null);
}
public Attribute updateOrCreateAttribute(Identifier productIdentifier, Identifier imageIdentifier, Attribute model) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.request("post", this.resolvePath("/products/%s/images/%s/attributes", productIdentifier, imageIdentifier), null, null, responseModel, model);
}
public Attribute updateOrCreateAttribute(Identifier productIdentifier, Identifier imageIdentifier, Attribute model, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.request("post", this.resolvePath("/products/%s/images/%s/attributes", productIdentifier, imageIdentifier), query, null, responseModel, model);
}
public void deleteAttribute(Identifier productIdentifier, Identifier imageIdentifier, String attributeGroupName) throws ApiErrorException, ConnectionException {
this.request("delete", this.resolvePath("/products/%s/images/%s/attributes/%s", productIdentifier, imageIdentifier, attributeGroupName), null, null, null);
}
public void deleteAttribute(Identifier productIdentifier, Identifier imageIdentifier, String attributeGroupName, ApiOptions options) throws ApiErrorException, ConnectionException {
Map query = options.all();
this.request("delete", this.resolvePath("/products/%s/images/%s/attributes/%s", productIdentifier, imageIdentifier, attributeGroupName), query, null, null);
}
public Attribute getAttribute(Identifier productIdentifier, Identifier imageIdentifier, String attributeGroupName) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.request("get", this.resolvePath("/products/%s/images/%s/attributes/%s", productIdentifier, imageIdentifier, attributeGroupName), null, null, responseModel);
}
public Attribute getAttribute(Identifier productIdentifier, Identifier imageIdentifier, String attributeGroupName, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.request("get", this.resolvePath("/products/%s/images/%s/attributes/%s", productIdentifier, imageIdentifier, attributeGroupName), query, null, responseModel);
}
public ApiCollection allAttributes(Identifier productIdentifier, Identifier imageIdentifier) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
return this.requestCollection("get", this.resolvePath("/products/%s/images/%s/attributes", productIdentifier, imageIdentifier), null, null, responseModel);
}
public ApiCollection allAttributes(Identifier productIdentifier, Identifier imageIdentifier, ApiOptions options) throws ApiErrorException, ConnectionException {
Class responseModel = (Class)(Class>)Attribute.class;
Map query = options.all();
return this.requestCollection("get", this.resolvePath("/products/%s/images/%s/attributes", productIdentifier, imageIdentifier), query, null, responseModel);
}
}